X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fhomonymes.inc.php;h=881f676df139e8e80f693e3b5f6262ac048ebaaf;hb=8230e9f8eff954fb1103c8bdcf0d22557d419ae7;hp=6ebb4d15917b90b12e6190ae9d3bb1a0507b6368;hpb=5e2307dcebc38ebb0ffe469967a377eb3baed571;p=platal.git diff --git a/include/homonymes.inc.php b/include/homonymes.inc.php index 6ebb4d1..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::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::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: ?>