Close #717: Emails with .museum or .traveil were not allowed
[platal.git] / include / xorg / session.inc.php
index d98f08e..6e8b3e8 100644 (file)
@@ -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;
@@ -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 "
                        ."<a href='mailto:support@polytechnique.org'>support@polytechnique.org</a>");
+            if ($newpage) {
+                $page->run();
+            }
             return false;
         }
     }