X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fcron%2Fcron_ml_moderate.php;h=c6d22a6753fbdcb7cb9481d6586608290630aa19;hb=fdf0eca063baf13cb3f30b1c276d65f9687d5527;hp=268cdd358586af1dbe3b1a9648247ea0d5d0eec6;hpb=0073747ac81cc9cff9e43847eb008f0e815255f0;p=platal.git diff --git a/bin/cron/cron_ml_moderate.php b/bin/cron/cron_ml_moderate.php index 268cdd3..c6d22a6 100755 --- a/bin/cron/cron_ml_moderate.php +++ b/bin/cron/cron_ml_moderate.php @@ -29,17 +29,17 @@ $handler = time(); while ($sent_mails < $globals->lists->max_mail_per_min && time() - $handler < 60) { // take a lock on a mail - XDB::execute("UPDATE email_list_moderate + XDB::execute('UPDATE email_list_moderate SET handler = {?} WHERE handler IS NULL ORDER BY ts - LIMIT 1", $handler); + LIMIT 1', $handler); if (XDB::affectedRows() == 0) { break; } - $query = XDB::query('SELECT a.fullname, a.uid, a.password, + $query = XDB::query('SELECT a.full_name, a.uid, a.password, ml.ml, ml.domain, ml.mid, ml.action, ml.message - FROM accounts AS a + FROM accounts AS a INNER JOIN email_list_moderate AS ml ON (a.uid = ml.uid) WHERE ml.handler = {?}', $handler); list($fullname, $uid, $password, $list, $domain, $mid, $action, $reason) = $query->fetchOneRow(); @@ -48,7 +48,7 @@ while ($sent_mails < $globals->lists->max_mail_per_min $client = new MMList($uid, $password, $domain); // send the mail - $mail = $client->get_pending_mail($list, $mid); + $mail = $client->get_pending_mail($list, $mid); list($det,$mem,$own) = $client->get_members($list); $count = 0; switch ($action) { @@ -70,7 +70,7 @@ while ($sent_mails < $globals->lists->max_mail_per_min $action = 3; /** 3 = DISCARD **/ $subject = "Message supprimé"; $append = "a été supprimé par $fullname.\n\n" - . "Rappel: il ne faut utiliser cette opération " + . "Rappel : il ne faut utiliser cette opération " . "que dans le cas de spams ou de virus !\n"; $type = 'spam'; $count += count($own); @@ -115,7 +115,8 @@ while ($sent_mails < $globals->lists->max_mail_per_min } // release the lock - XDB::execute("DELETE FROM email_list_moderate WHERE handler = {?}", + XDB::execute('DELETE FROM email_list_moderate + WHERE handler = {?}', $handler); sleep(60 * $count / $globals->lists->max_mail_per_min); }