From: Pierre Habouzit (MadCoder Date: Fri, 25 Feb 2005 11:59:52 +0000 (+0000) Subject: members that try to register again have a warning X-Git-Tag: xorg/old~256 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=2104480e5aabb6f752e4c926fbd2bfd54656efcc;p=platal.git members that try to register again have a warning 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 --- diff --git a/ChangeLog b/ChangeLog index 258c454..d0134bf 100644 --- 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 diff --git a/include/register.inc.php b/include/register.inc.php index 6edc58c..b96f487 100644 --- a/include/register.inc.php +++ b/include/register.inc.php @@ -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 !"; } // }}}