From: Florent Bruneau Date: Fri, 21 Mar 2008 22:18:21 +0000 (+0100) Subject: Really fix dangerous email check on subscription. X-Git-Tag: xorg/0.9.16~86 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=15836cdd5761e97bc31f437f489c50be0a586486;p=platal.git Really fix dangerous email check on subscription. Signed-off-by: Florent Bruneau --- diff --git a/modules/register.php b/modules/register.php index 92088c8..973993f 100644 --- a/modules/register.php +++ b/modules/register.php @@ -161,24 +161,18 @@ class RegisterModule extends PLModule } // Check if the given email is known as dangerous - $res = Xdb::iterRow("SELECT w.state, w.description, a.alias - FROM emails AS e - INNER JOIN emails_watch AS w ON (e.email = w.email AND w.state != 'safe') - INNER JOIN aliases AS a ON (e.uid = a.id AND a.type = 'a_vie') - WHERE e.email = {?} - ORDER BY a.alias", Post::v('email')); - $aliases = array(); + $res = XDB::query("SELECT w.state, w.description + FROM emails_watch AS w + WHERE w.email = {?} AND w.state != 'safe'", + Post::v('email')); $email_banned = false; - while(list($gstate, $gdescription, $alias) = $res->next()) { - $state = $gstate; + if ($res->numRows()) { + list($state, $description) = $res->fetchOneRow(); + $alert .= "Email surveille propose a l'inscription - "; + $sub_state['email_desc'] = $description; if ($state == 'dangerous') { $email_banned = true; } - $description = $gdescription; - $aliases[] = $alias; - } - if (count($aliases) != 0) { - $alert .= "Email surveille propose a l'inscription - "; } if ($sub_state['watch']) { $alter .= "Inscription d'un utilisateur surveillé - ";