members that try to register again have a warning
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Fri, 25 Feb 2005 11:59:52 +0000 (11:59 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:17 +0000 (23:28 +0200)
a redirect to recovery.php would be better though, but it's better than nothin

git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-504

ChangeLog
include/register.inc.php

index 258c454..d0134bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@ New :
        * Profile :
                - One can choose precisely which fields appear on his public fiche.     -Car
                - Accents and special chars in name and first name                                      -Car
+
+       * Register :
+               - Already subscribed members now have a warning.                                        -MC
        
        * Search :
                - Public searches display more information.                                                     -Car
index 6edc58c..b96f487 100644 (file)
@@ -111,7 +111,6 @@ function check_old_mat($promo, $mat, $nom, $prenom, &$ourmat, &$ourid)
             'SELECT  user_id, nom, prenom, matricule
                FROM  auth_user_md5
               WHERE  promo={?} AND deces=0 AND perms="pending"', $promo);
-
     while (list($_uid, $_nom, $_prenom, $_mat) = $res->next()) {
         if (user_cmp($prenom, $nom, $_prenom, $_nom)) {
             $ourid  = $_uid;
@@ -120,7 +119,19 @@ function check_old_mat($promo, $mat, $nom, $prenom, &$ourmat, &$ourid)
         }
     }
 
-    return "erreur dans l'identification.  Réessaie, il y a une erreur quelque part !";
+    $res = $globals->xdb->iterRow(
+            'SELECT  user_id, nom, prenom, matricule, alias
+               FROM  auth_user_md5 AS u
+         INNER JOIN  aliases       AS a ON (u.user_id = a.id and FIND_IN_SET("bestalias", a.flags))
+              WHERE  promo={?} AND deces=0 AND perms IN ("user","admin")', $promo);
+    while (list($_uid, $_nom, $_prenom, $_mat, $alias) = $res->next()) {
+        if (user_cmp($prenom, $nom, $_prenom, $_nom)) {
+            $ourid  = $_uid;
+            $ourmat = $_mat;
+            return "Tu es vraissemblablement déjà inscrit !";
+        }
+    }
+    return "erreur: vérifie que tu as bien orthographié ton nom !";
 }
 
 // }}}