Merge commit 'origin/master' into fusionax
authorVincent Zanotti <vincent.zanotti@m4x.org>
Fri, 10 Apr 2009 17:00:59 +0000 (19:00 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Fri, 10 Apr 2009 17:00:59 +0000 (19:00 +0200)
Conflicts:
modules/email.php

Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
1  2 
modules/admin.php
modules/email.php
modules/search/classes.inc.php

Simple merge
@@@ -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()));
              }
          }
  
@@@ -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);
      }