From 55aa88ed8b1a2186bf1d081330e756ada0e0c6ac Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Thu, 16 Sep 2010 15:58:13 +0200 Subject: [PATCH] Add UFC_AccountType filter. Signed-off-by: Florent Bruneau --- classes/userfilter.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 -- 2.1.4