Commit 0c4b8450 authored by Jesse Norell's avatar Jesse Norell
Browse files

MR review suggestions/fixes

parent 06d5ca47
Pipeline #9244 passed with stage
in 10 minutes and 41 seconds
......@@ -78,7 +78,7 @@ $form["tabs"]['users'] = array (
'policy_id' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '',
'default' => '0',
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT id,policy_name FROM spamfilter_policy WHERE {AUTHSQL} ORDER BY policy_name',
'keyfield'=> 'id',
......
......@@ -296,7 +296,7 @@ class page_action extends tform_actions {
"sys_perm_group" => 'riud',
"sys_perm_other" => '',
"server_id" => $domain["server_id"],
"priority" => 5,
"priority" => 7,
"policy_id" => $policy_id,
"email" => $this->dataRecord["email"],
"fullname" => $app->functions->idn_decode($this->dataRecord["email"]),
......
......@@ -103,19 +103,19 @@ class cronjob_file_cleanup extends cronjob {
if(preg_match('/^((?:global|spamfilter)_wblist|ispc_(spamfilter_user|mail_user|mail_forwarding))[_-](\d+)\s/', $line, $matches)) {
switch($matches[1]) {
case 'global_wblist':
$remove = ! isset($mail_access[$matches[3]]);
$remove = isset($mail_access[$matches[3]]) ? false : true;
break;
case 'spamfilter_wblist':
$remove = ! isset($spamfilter_wblist[$matches[3]]);
$remove = isset($spamfilter_wblist[$matches[3]]) ? false : true;
break;
case 'ispc_spamfilter_user':
$remove = ! isset($spamfilter_users[$matches[3]]);
$remove = isset($spamfilter_users[$matches[3]]) ? false : true;
break;
case 'ispc_mail_user':
$remove = ! isset($mail_user[$matches[3]]);
$remove = isset($mail_user[$matches[3]]) ? false : true;
break;
case 'ispc_mail_forwarding':
$remove = ! isset($mail_forwarding[$matches[3]]);
$remove = isset($mail_forwarding[$matches[3]]) ? false : true;
break;
default:
$app->log("conf file has unhandled rule naming convention, ignoring: $file", LOGLEVEL_DEBUG);
......
......@@ -198,19 +198,26 @@ class cronjob {
}
// child classes may NOT override this!
protected function restartService($service, $mode='restart') {
protected function restartService($service, $action='restart') {
global $app;
$mode = ($mode == 'reload' ? 'reload' : 'restart');
$app->system->exec_safe('service ? ?', $service, $mode);
$app->uses('system');
$retval = array('output' => '', 'retval' => 0);
if($action == 'reload') {
exec($app->system->getinitcommand($service, 'reload').' 2>&1', $retval['output'], $retval['retval']);
} else {
exec($app->system->getinitcommand($service, 'restart').' 2>&1', $retval['output'], $retval['retval']);
}
return $retval;
}
// child classes may NOT override this!
protected function restartServiceDelayed($service, $mode='restart') {
$mode = ($mode == 'reload' ? 'reload' : 'restart');
protected function restartServiceDelayed($service, $action='restart') {
$action = ($action == 'reload' ? 'reload' : 'restart');
if (is_array($this->_delayed_restart_services)) {
$this->_delayed_restart_services[$service] = $mode;
$this->_delayed_restart_services[$service] = $action;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment