X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fmassmailer.inc.php;h=fd5093d80486f65cb741072e0a9f626ae9999946;hb=155819d9ece12a06d37df46e22b76e3c71f65fba;hp=02a93a84e8a4ea36ca61f1bbbe06f3b955a57350;hpb=a0f050273b792f222a0ae6ec8baf2f3e4fe23023;p=platal.git diff --git a/include/massmailer.inc.php b/include/massmailer.inc.php index 02a93a8..fd5093d 100644 --- a/include/massmailer.inc.php +++ b/include/massmailer.inc.php @@ -59,7 +59,7 @@ abstract class MassMailer return $this->_head; } else { $head = $this->_head; - $head = str_replace('', $sexe ? 'Chère' : 'Cher', $head); + $head = str_replace('', $sexe ? 'Chère' : 'Cher', $head); $head = str_replace('', $prenom, $head); $head = str_replace('', $nom, $head); return format_text($head, $type, 2, 64); @@ -73,7 +73,7 @@ abstract class MassMailer return true; } else { $css = file_get_contents(dirname(__FILE__) . '/../htdocs/css/' . $this->_css); - return preg_replace('@/\*.*?\*/@s', '', $css); + return preg_replace('@/\*.*?\*/@us', '', $css); } } @@ -121,7 +121,8 @@ abstract class MassMailer protected function getAllRecipients() { - return "SELECT u.user_id, a.alias, + global $globals; + return "SELECT u.user_id, CONCAT(a.alias, '@{$globals->mail->domain}'), u.prenom, IF(u.nom_usage='', u.nom, u.nom_usage), FIND_IN_SET('femme', u.flags), q.core_mail_fmt AS pref, 0 AS hash @@ -141,7 +142,7 @@ abstract class MassMailer while (true) { $res = XDB::iterRow($query, $this->_id, 60); if (!$res->total()) { - exit; + return; } $sent = array(); while (list($uid, $bestalias, $prenom, $nom, $sexe, $fmt, $hash) = $res->next()) { @@ -151,6 +152,7 @@ abstract class MassMailer XDB::execute("UPDATE {$this->subscriptionTable()} SET last = {?} WHERE " . implode(' OR ', $sent), $this->_id); + sleep(60); } } @@ -255,5 +257,5 @@ function enriched_to_text($input,$html=false,$just=false,$indent=0,$width=68) // }}} -// vim:set et sw=4 sts=4 sws=4: +// vim:set et sw=4 sts=4 sws=4 enc=utf-8: ?>