X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fhomonymes.inc.php;h=881f676df139e8e80f693e3b5f6262ac048ebaaf;hb=8230e9f8eff954fb1103c8bdcf0d22557d419ae7;hp=5b37d7c46fe52c2550b45b63c927933abff33998;hpb=a3a049fc80d3707bcc76903ab89f73974c470c0c;p=platal.git diff --git a/include/homonymes.inc.php b/include/homonymes.inc.php index 5b37d7c..881f676 100644 --- a/include/homonymes.inc.php +++ b/include/homonymes.inc.php @@ -1,6 +1,6 @@ mail->domain; $FROM = "\"Support Polytechnique.org\" <$cc>"; - $mymail = new HermesMailer(); + $mymail = new PlMailer(); $mymail->setFrom($FROM); - $mymail->setSubject("Dans 2 semaines, suppression de $loginbis@polytechnique.org"); - $mymail->addTo("$prenom $nom <$forlife@polytechnique.org>"); + $mymail->setSubject("Dans 2 semaines, suppression de $loginbis@" . $globals->mail->domain); + $mymail->addTo("$prenom $nom <$forlife@" . $globals->mail->domain . '>'); $mymail->addCc($cc); - $mymail->setTxtBody(Env::get('mailbody')); + $mymail->setTxtBody(Env::v('mailbody')); $mymail->send(); } function send_robot_homonyme($prenom, $nom, $forlife, $loginbis) { - require_once("diogenes/diogenes.hermes.inc.php"); - $cc = "support+homonyme@polytechnique.org"; + global $globals; + $cc = "support+homonyme@" . $globals->mail->domain; $FROM = "\"Support Polytechnique.org\" <$cc>"; - $mymail = new HermesMailer(); + $mymail = new PlMailer(); $mymail->setFrom($FROM); - $mymail->setSubject("Mise en place du robot $loginbis@polytechnique.org"); - $mymail->addTo("$prenom $nom <$forlife@polytechnique.org>"); + $mymail->setSubject("Mise en place du robot $loginbis@" . $globals->mail->domain); + $mymail->addTo("$prenom $nom <$forlife@" . $globals->mail->domain . '>'); $mymail->addCc($cc); - $mymail->setTxtBody(Env::get('mailbody')); + $mymail->setTxtBody(Env::v('mailbody')); $mymail->send(); } @@ -59,7 +59,7 @@ function switch_bestalias($uid, $loginbis) { $res = XDB::query("SELECT alias FROM aliases WHERE id = {?} AND FIND_IN_SET('bestalias', flags)", $uid); $bestalias = $res->fetchOneCell(); if ($bestalias && $bestalias != $loginbis) return false; - + // select the shortest alias still alive $res = XDB::query("SELECT alias FROM aliases WHERE id = {?} AND alias != {?} AND expire IS NULL ORDER BY LENGTH(alias) LIMIT 1", $uid, $loginbis); $newbest = $res->fetchOneCell(); @@ -69,4 +69,5 @@ function switch_bestalias($uid, $loginbis) { return $newbest; } +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>