X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fxorg%2Fsession.inc.php;h=6e8b3e84ff43a26142068c36884e81d43b0d43a8;hb=32111f706bcbf1d3244f64b7928b37bbc5210ab0;hp=c6ea8e4e31b72f974e8b962358bbaf5bcb840e34;hpb=bf517dafc122edf6ccd86847f0626cfd0df9f340;p=platal.git diff --git a/include/xorg/session.inc.php b/include/xorg/session.inc.php index c6ea8e4..6e8b3e8 100644 --- a/include/xorg/session.inc.php +++ b/include/xorg/session.inc.php @@ -25,7 +25,7 @@ class XorgSession { // {{{ public static function init - public static function init() + public static function init() { S::init(); if (!S::has('uid')) { @@ -158,7 +158,7 @@ class XorgSession * @param page the calling page (by reference) */ public static function doAuthCookie() - + { if (S::logged()) { return true; @@ -239,7 +239,7 @@ function try_cookie() function start_connexion ($uid, $identified) { $res = XDB::query(" - SELECT u.user_id AS uid, prenom, nom, perms, promo, matricule, password, FIND_IN_SET('femme', u.flags) AS femme, + SELECT u.user_id AS uid, prenom, nom, nom_usage, perms, promo, matricule, password, FIND_IN_SET('femme', u.flags) AS femme, UNIX_TIMESTAMP(s.start) AS lastlogin, s.host, a.alias AS forlife, a2.alias AS bestalias, q.core_mail_fmt AS mail_fmt, UNIX_TIMESTAMP(q.banana_last) AS banana_last, q.watch_last, q.core_rss_hash, FIND_IN_SET('watch', u.flags) AS watch_account, q.last_version @@ -277,13 +277,23 @@ function start_connexion ($uid, $identified) $mail_subject .= ' - '; } $mail_subject .= "Une IP surveillee a tente de se connecter"; - send_warning_mail($mail_subject); if (check_ip('ban')) { + send_warning_mail($mail_subject); $_SESSION = array(); + $_SESSION['perms'] = new FlagSet(); global $page; + $newpage = false; + if (!$page) { + require_once 'xorg.inc.php'; + new_skinned_page('platal/index.tpl'); + $newpage = true; + } $page->trig("Une erreur est survenue lors de la procédure d'authentification. " ."Merci de contacter au plus vite " ."support@polytechnique.org"); + if ($newpage) { + $page->run(); + } return false; } }