Skip to content

Commit 0c4b845

Browse files
committed
MR review suggestions/fixes
1 parent 06d5ca4 commit 0c4b845

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

interface/web/mail/form/spamfilter_users.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
'policy_id' => array (
7979
'datatype' => 'INTEGER',
8080
'formtype' => 'SELECT',
81-
'default' => '',
81+
'default' => '0',
8282
'datasource' => array ( 'type' => 'SQL',
8383
'querystring' => 'SELECT id,policy_name FROM spamfilter_policy WHERE {AUTHSQL} ORDER BY policy_name',
8484
'keyfield'=> 'id',

interface/web/mail/mail_user_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ function onAfterInsert() {
296296
"sys_perm_group" => 'riud',
297297
"sys_perm_other" => '',
298298
"server_id" => $domain["server_id"],
299-
"priority" => 5,
299+
"priority" => 7,
300300
"policy_id" => $policy_id,
301301
"email" => $this->dataRecord["email"],
302302
"fullname" => $app->functions->idn_decode($this->dataRecord["email"]),

server/lib/classes/cron.d/600-file_cleanup.inc.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,19 @@ public function onRunJob() {
103103
if(preg_match('/^((?:global|spamfilter)_wblist|ispc_(spamfilter_user|mail_user|mail_forwarding))[_-](\d+)\s/', $line, $matches)) {
104104
switch($matches[1]) {
105105
case 'global_wblist':
106-
$remove = ! isset($mail_access[$matches[3]]);
106+
$remove = isset($mail_access[$matches[3]]) ? false : true;
107107
break;
108108
case 'spamfilter_wblist':
109-
$remove = ! isset($spamfilter_wblist[$matches[3]]);
109+
$remove = isset($spamfilter_wblist[$matches[3]]) ? false : true;
110110
break;
111111
case 'ispc_spamfilter_user':
112-
$remove = ! isset($spamfilter_users[$matches[3]]);
112+
$remove = isset($spamfilter_users[$matches[3]]) ? false : true;
113113
break;
114114
case 'ispc_mail_user':
115-
$remove = ! isset($mail_user[$matches[3]]);
115+
$remove = isset($mail_user[$matches[3]]) ? false : true;
116116
break;
117117
case 'ispc_mail_forwarding':
118-
$remove = ! isset($mail_forwarding[$matches[3]]);
118+
$remove = isset($mail_forwarding[$matches[3]]) ? false : true;
119119
break;
120120
default:
121121
$app->log("conf file has unhandled rule naming convention, ignoring: $file", LOGLEVEL_DEBUG);

server/lib/classes/cronjob.inc.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,26 @@ protected function onCompleted() {
198198
}
199199

200200
// child classes may NOT override this!
201-
protected function restartService($service, $mode='restart') {
201+
protected function restartService($service, $action='restart') {
202202
global $app;
203203

204-
$mode = ($mode == 'reload' ? 'reload' : 'restart');
205-
$app->system->exec_safe('service ? ?', $service, $mode);
204+
$app->uses('system');
205+
206+
$retval = array('output' => '', 'retval' => 0);
207+
if($action == 'reload') {
208+
exec($app->system->getinitcommand($service, 'reload').' 2>&1', $retval['output'], $retval['retval']);
209+
} else {
210+
exec($app->system->getinitcommand($service, 'restart').' 2>&1', $retval['output'], $retval['retval']);
211+
}
212+
return $retval;
206213
}
207214

208215
// child classes may NOT override this!
209-
protected function restartServiceDelayed($service, $mode='restart') {
210-
$mode = ($mode == 'reload' ? 'reload' : 'restart');
216+
protected function restartServiceDelayed($service, $action='restart') {
217+
$action = ($action == 'reload' ? 'reload' : 'restart');
211218

212219
if (is_array($this->_delayed_restart_services)) {
213-
$this->_delayed_restart_services[$service] = $mode;
220+
$this->_delayed_restart_services[$service] = $action;
214221
}
215222
}
216223

0 commit comments

Comments
 (0)