Add a test on registration to catch too hesitant usurpers
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 22 Jan 2007 16:55:00 +0000 (16:55 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 22 Jan 2007 16:55:00 +0000 (16:55 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1386 839d8a87-29fc-0310-9880-83ba4fa771e5

include/xorg.misc.inc.php
modules/register.php

index f4077d2..5473e7e 100644 (file)
@@ -144,7 +144,7 @@ function send_warning_mail($title)
     $mailer = new PlMailer();
     $mailer->setFrom("webmaster@polytechnique.org");
     $mailer->addTo("hotliners@staff.polytechnique.org");
-    $mailer->setSubject($title);
+    $mailer->setSubject("[Plat/al Security Alert] $title");
     $mailer->setTxtBody("Identifiants de session :\n" . var_export($_SESSION, true) . "\n\n"
                        ."Identifiants de connexion :\n" . var_export($_SERVER, true));
     $mailer->send(); 
index a309bb7..844b2b4 100644 (file)
@@ -38,8 +38,17 @@ class RegisterModule extends PLModule
         if (!isset($sub_state['step'])) {
             $sub_state['step'] = 0;
         }
+        if (!isset($sub_state['backs'])) {
+            $sub_state['backs'] = array();
+        }
         if (Get::has('back') && Get::i('back') < $sub_state['step']) {
             $sub_state['step'] = max(0,Get::i('back'));
+            $state = $sub_state;
+            unset($state['backs']);
+            $sub_state['backs'][] = $state;
+            if (count($sub_state['backs']) == 3) {
+                $alert .= "Tentative d'inscription tres hesitante - ";
+            }   
         }
 
         // Compatibility with old sources, keep it atm
@@ -179,6 +188,9 @@ class RegisterModule extends PLModule
                             $alert .= "Tentative d'inscription depuis une IP surveillee";
                         } else {
                             $sub_state['step'] = 4;
+                            if ($sub_state['backs'] >= 3) {
+                                $alert .= "Fin d'une inscription hésitante";
+                            }
                             finish_ins($sub_state);
                         }
                     }