X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fuserfilter.php;h=f78635b29f1bff36ffb45f695386dddc4181c93a;hb=c76545c351fae4e2298624ff9ee5bf854dc5a5b6;hp=743ff441718a0bcd743ef552ad632ddee0aef8d2;hpb=4ec03752ab489b6414915b98a459db4bbc5dc95d;p=platal.git 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