X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fregister.inc.php;h=638df1350ba51e5ce5acd0f00a305765525b14a0;hb=4f9e482c39da76dd070b517485b79470d5ffc51b;hp=69ccd7678eeb86b5f803a569504e90e3771430e3;hpb=08cce2ff528b38bde27cdec6d6bc28d6af4a42d4;p=platal.git diff --git a/include/register.inc.php b/include/register.inc.php index 69ccd76..638df13 100644 --- a/include/register.inc.php +++ b/include/register.inc.php @@ -70,7 +70,6 @@ function get_X_mat($ourmat) function check_mat($promo, $mat, $nom, $prenom, &$ourmat, &$ourid) { - global $globals; if (!preg_match('/^[0-9][0-9][0-9][0-9][0-9][0-9]$/', $mat)) { return "Le matricule doit comporter 6 chiffres."; } @@ -105,8 +104,6 @@ function check_mat($promo, $mat, $nom, $prenom, &$ourmat, &$ourid) function check_old_mat($promo, $mat, $nom, $prenom, &$ourmat, &$ourid) { - global $globals; - $res = XDB::iterRow( 'SELECT user_id, nom, prenom, matricule FROM auth_user_md5 @@ -139,7 +136,6 @@ function check_old_mat($promo, $mat, $nom, $prenom, &$ourmat, &$ourid) function check_new_user(&$sub) { - global $globals; extract($sub); $prenom = preg_replace("/[ \t]+/", ' ', trim($prenom)); @@ -172,7 +168,6 @@ function check_new_user(&$sub) function create_aliases (&$sub) { - global $globals; extract ($sub); $mailorg = make_username($prenom, $nom); @@ -246,6 +241,23 @@ function create_aliases (&$sub) } // }}} +// {{{ 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@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)