From 20fafe37cf7e843833a98541dc52f10bae552a83 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Fri, 21 Mar 2008 23:18:21 +0100 Subject: [PATCH] Really fix dangerous email check on subscription. Signed-off-by: Florent Bruneau --- modules/register.php | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/modules/register.php b/modules/register.php index 2f6cfcc..457235a 100644 --- a/modules/register.php +++ b/modules/register.php @@ -157,24 +157,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é - "; -- 2.1.4