From: Vincent Zanotti Date: Fri, 10 Apr 2009 17:00:59 +0000 (+0200) Subject: Merge commit 'origin/master' into fusionax X-Git-Tag: xorg/1.0.0~332^2~337^2~1 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=aef0283bdf24c94d640a16ccac08191980ae7a25;p=platal.git Merge commit 'origin/master' into fusionax Conflicts: modules/email.php Signed-off-by: Vincent Zanotti --- aef0283bdf24c94d640a16ccac08191980ae7a25 diff --cc modules/email.php index 4080b62,c83914e..424feca --- a/modules/email.php +++ b/modules/email.php @@@ -258,19 -259,11 +259,19 @@@ class EmailModule extends PLModul $actifs = Env::v('emails_actifs', Array()); print_r(Env::v('emails_rewrite')); if (Env::v('emailop') == "ajouter" && Env::has('email')) { - $result = $redirect->add_email(Env::v('email')); + $new_email = Env::v('email'); + if ($new_email == "new@example.org") { + $new_email = Env::v('email_new'); + } - $retour = $redirect->add_email($new_email); - if ($retour == ERROR_INVALID_EMAIL) { ++ $result = $redirect->add_email($new_email); ++ if ($result == ERROR_INVALID_EMAIL) { + $page->assign('email', $new_email); + } - $page->assign('retour', $retour); ++ $page->assign('retour', $result); } elseif (empty($actifs)) { - $retour = ERROR_INACTIVE_REDIRECTION; + $result = ERROR_INACTIVE_REDIRECTION; } elseif (is_array($actifs)) { - $retour = $redirect->modify_email($actifs, Env::v('emails_rewrite', Array())); + $result = $redirect->modify_email($actifs, Env::v('emails_rewrite', Array())); } } diff --cc modules/search/classes.inc.php index 62a3ad7,8289da5..3d90887 --- a/modules/search/classes.inc.php +++ b/modules/search/classes.inc.php @@@ -342,13 -308,15 +342,20 @@@ class QuickSearch extends SFiel } if (!empty($this->ip)) { $ip = ip_to_uint($this->ip); - $where[] = "( ls.ip = $ip OR ls.forward_ip = $ip ) AND ls.suid = 0"; + + // If the IP address requested for the search cannot be translated, + // the predicate should always be valued to false. + if ($ip != null) { + $where[] = "( ls.ip = $ip OR ls.forward_ip = $ip ) AND ls.suid = 0"; + } else { + $where[] = "false"; + } } + if (!empty($this->phone)){ + require_once("profil.func.inc.php"); + $phone = format_phone_number($this->phone) . "%"; + $where[] = 't.search_tel LIKE ' . XDB::escape($phone); + } return join(" AND ", $where); }