Fix misdetection of already registered users during registration process.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 22 Aug 2010 16:03:43 +0000 (18:03 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 22 Aug 2010 16:05:27 +0000 (18:05 +0200)
(Close #1216)

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
modules/register/register.inc.php

index 4da836b..b445502 100644 (file)
@@ -30,13 +30,14 @@ function checkId(&$subState)
 
     $uf = new UserFilter(new PFC_And(
             new UFC_SchoolId('xorg', $subState->i('xorgid')),
-            new PFC_Not(new UFC_Dead())
+            new PFC_Not(new UFC_Dead()),
+            new PFC_Not(new UFC_Registered(true))
     ));
     $profile = $uf->getProfile();
-
-    if ($profile->__get('state') == 'active') {
+    if (is_null($profile)) {
         return "Tu es déjà inscrit ou ton matricule est incorrect !";
     }
+
     if ($profile->promo() != $subState->s('promo')) {
         return 'Le matricule est incorrect.';
     }