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.";
}
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
function check_new_user(&$sub)
{
- global $globals;
extract($sub);
$prenom = preg_replace("/[ \t]+/", ' ', trim($prenom));
function create_aliases (&$sub)
{
- global $globals;
extract ($sub);
$mailorg = make_username($prenom, $nom);
}
// }}}
+// {{{ 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)