From: Florent Bruneau Date: Fri, 21 Mar 2008 22:04:39 +0000 (+0100) Subject: Ban dangerous on subscription X-Git-Tag: xorg/0.9.16~87 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;ds=sidebyside;h=706ed3ef1914fca94b79f16d32031db0e65b4c34;p=platal.git Ban dangerous on subscription Signed-off-by: Florent Bruneau --- diff --git a/modules/register.php b/modules/register.php index 2820841..92088c8 100644 --- a/modules/register.php +++ b/modules/register.php @@ -168,8 +168,12 @@ class RegisterModule extends PLModule WHERE e.email = {?} ORDER BY a.alias", Post::v('email')); $aliases = array(); + $email_banned = false; while(list($gstate, $gdescription, $alias) = $res->next()) { $state = $gstate; + if ($state == 'dangerous') { + $email_banned = true; + } $description = $gdescription; $aliases[] = $alias; } @@ -193,12 +197,15 @@ class RegisterModule extends PLModule $alert .= "Date de naissance incorrecte à l'inscription - "; } $sub_state['email'] = Post::v('email'); - if (check_ip('unsafe')) { + $ip_banned = check_ip('unsafe'); + if ($ip_banned) { + $alert .= "Tentative d'inscription depuis une IP surveillee"; + } + if ($email_banned || $ip_banned) { $err = "Une erreur s'est produite lors de l'inscription." . " Merci de contacter = 3) {