$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()));
}
}
}
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);
}