mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2025-12-13 09:56:01 +00:00
Merge branch 'staging' into nightly
This commit is contained in:
@@ -1023,7 +1023,7 @@ function user_get_alias_details($username) {
|
||||
AND `goto` != :username_goto2
|
||||
AND `address` != :username_address");
|
||||
$stmt->execute(array(
|
||||
':username_goto' => '(^|,)'.$username.'($|,)',
|
||||
':username_goto' => '(^|,)'.preg_quote($username, '/').'($|,)',
|
||||
':username_goto2' => $username,
|
||||
':username_address' => $username
|
||||
));
|
||||
@@ -1071,7 +1071,7 @@ function user_get_alias_details($username) {
|
||||
$data['aliases_send_as_all'] = $row['send_as'];
|
||||
}
|
||||
$stmt = $pdo->prepare("SELECT IFNULL(GROUP_CONCAT(`address` SEPARATOR ', '), '') as `address` FROM `alias` WHERE `goto` REGEXP :username AND `address` LIKE '@%';");
|
||||
$stmt->execute(array(':username' => '(^|,)'.$username.'($|,)'));
|
||||
$stmt->execute(array(':username' => '(^|,)'.preg_quote($username, '/').'($|,)'));
|
||||
$run = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
while ($row = array_shift($run)) {
|
||||
$data['is_catch_all'] = $row['address'];
|
||||
@@ -3359,50 +3359,6 @@ function getGUID() {
|
||||
.substr($charid,16, 4).$hyphen
|
||||
.substr($charid,20,12);
|
||||
}
|
||||
function solr_status() {
|
||||
$curl = curl_init();
|
||||
$endpoint = 'http://solr:8983/solr/admin/cores';
|
||||
$params = array(
|
||||
'action' => 'STATUS',
|
||||
'core' => 'dovecot-fts',
|
||||
'indexInfo' => 'true'
|
||||
);
|
||||
$url = $endpoint . '?' . http_build_query($params);
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curl, CURLOPT_POST, 0);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
|
||||
$response_core = curl_exec($curl);
|
||||
if ($response_core === false) {
|
||||
$err = curl_error($curl);
|
||||
curl_close($curl);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
curl_close($curl);
|
||||
$curl = curl_init();
|
||||
$status_core = json_decode($response_core, true);
|
||||
$url = 'http://solr:8983/solr/admin/info/system';
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curl, CURLOPT_POST, 0);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
|
||||
$response_sysinfo = curl_exec($curl);
|
||||
if ($response_sysinfo === false) {
|
||||
$err = curl_error($curl);
|
||||
curl_close($curl);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
curl_close($curl);
|
||||
$status_sysinfo = json_decode($response_sysinfo, true);
|
||||
$status = array_merge($status_core, $status_sysinfo);
|
||||
return (!empty($status['status']['dovecot-fts']) && !empty($status['jvm']['memory'])) ? $status : false;
|
||||
}
|
||||
return (!empty($status['status']['dovecot-fts'])) ? $status['status']['dovecot-fts'] : false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function cleanupJS($ignore = '', $folder = '/tmp/*.js') {
|
||||
$now = time();
|
||||
|
||||
Reference in New Issue
Block a user