From: Florent Bruneau Date: Thu, 16 Sep 2010 13:58:13 +0000 (+0200) Subject: Add UFC_AccountType filter. X-Git-Tag: xorg/1.0.1~194 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=55aa88ed8b1a2186bf1d081330e756ada0e0c6ac;p=platal.git Add UFC_AccountType filter. Signed-off-by: Florent Bruneau --- diff --git a/classes/userfilter.php b/classes/userfilter.php index 743ff44..f78635b 100644 --- a/classes/userfilter.php +++ b/classes/userfilter.php @@ -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