if ( $res->numRows() ) {
list($h_id, $h_type, $expire) = $res->fetchOneRow();
- $res->free();
if ( $h_type != 'homonyme' and empty($expire) ) {
XDB::execute('UPDATE aliases SET expire=ADDDATE(NOW(),INTERVAL 1 MONTH) WHERE alias={?}', $mailorg);
}
// }}}
+// {{{ function send_alert_mail
+
+function send_alert_mail($state, $body)
+{
+ require_once("diogenes/diogenes.hermes.inc.php");
+ $mailer = new HermesMailer();
+ $mailer->setFrom("webmaster@polytechnique.org");
+ $mailer->addTo("hotliners@staff.polytechnique.org");
+ $mailer->setSubject("ALERTE LORS DE L'INSCRIPTION de "
+ . $state['prenom'] . ' ' . $state['nom'] . '(' . $promo . ')');
+ $mailer->setTxtBody($body
+ . "\n\nIndentifiants :\n" . var_export($state, true)
+ . "\n\nInformations de connexion :\n" . var_export($_SERVER, true));
+ $mailer->send();
+}
+
+// }}}
// {{{ function finish_ins
function finish_ins($sub_state)