Cannot configure mbox-helper and banana's spool root anymore.
[platal.git] / classes / userfilter.php
index 743ff44..f78635b 100644 (file)
@@ -52,6 +52,25 @@ class UFC_HasProfile implements UserFilterCondition
 }
 // }}}
 
+// {{{ class UFC_AccountType
+/** Filters users who have the given account types
+ */
+class UFC_AccountType implements UserFilterCondition
+{
+    private $types;
+
+    public function __construct()
+    {
+        $this->types = pl_flatten(func_get_args());
+    }
+
+    public function buildCondition(PlFilter &$uf)
+    {
+        $uf->requireAccounts();
+        return XDB::format('a.type IN {?}', $this->types);
+    }
+}
+
 // {{{ class UFC_Hruid
 /** Filters users based on their hruid
  * @param $val Either an hruid, or a list of those