Adds search on broken redirections (Closes #990).
[platal.git] / include / ufbuilder.inc.php
index fecc077..fdd8c6f 100644 (file)
@@ -344,6 +344,7 @@ class UFB_AdvancedSearch extends UserFilterBuilder
             new UFBF_Promo('promo2', 'Promotion', 'egal2'),
             new UFBF_Sex('woman', 'Sexe'),
             new UFBF_Registered('subscriber', 'Inscrit'),
+            new UFBF_HasEmailRedirect('has_email_redirect', 'A une redirection active'),
             new UFBF_Dead('alive', 'En vie'),
 
             new UFBF_Town('city', 'Ville / Code Postal'),
@@ -956,6 +957,25 @@ class UFBF_Registered extends UFBF_Enum
 }
 // }}}
 
+// {{{ class UFBF_HasEmailRedirect
+class UFBF_HasEmailRedirect extends UFBF_Enum
+{
+    public function __construct($envfield, $formtext = '')
+    {
+        parent::__construct($envfield, $formtext, array(1, 2));
+    }
+
+    protected function buildUFC(UserFilterBuilder $ufb)
+    {
+        if ($this->val == 1) {
+            return new UFC_HasEmailRedirect();
+        } else if ($this->val == 2) {
+            return new PFC_Not(new UFC_HasEmailRedirect());
+        }
+    }
+}
+// }}}
+
 // {{{ class UFBF_Dead
 class UFBF_Dead extends UFBF_Enum
 {