X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2Fpagers%2FUsersPager.php;h=aa757e69046c27d9b4f5d18f5767f7f333aa524b;hb=3e83cc276aa498fbf5786a1f9bdd6285fa03cdc9;hp=09d4b5e3eb395bbb269a36f7289d4076bdf505ad;hpb=e69bcfad17d67da5113cdd75276a5f7b5cefb123;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/pagers/UsersPager.php b/includes/specials/pagers/UsersPager.php index 09d4b5e3eb..aa757e6904 100644 --- a/includes/specials/pagers/UsersPager.php +++ b/includes/specials/pagers/UsersPager.php @@ -38,9 +38,9 @@ class UsersPager extends AlphabeticPager { protected $userGroupCache; /** - * @param IContextSource $context - * @param array $par (Default null) - * @param bool $including Whether this page is being transcluded in + * @param IContextSource|null $context + * @param array|null $par (Default null) + * @param bool|null $including Whether this page is being transcluded in * another page */ function __construct( IContextSource $context = null, $par = null, $including = null ) { @@ -70,6 +70,7 @@ class UsersPager extends AlphabeticPager { $this->requestedGroup = ''; } $this->editsOnly = $request->getBool( 'editsOnly' ); + $this->temporaryGroupsOnly = $request->getBool( 'temporaryGroupsOnly' ); $this->creationSort = $request->getBool( 'creationSort' ); $this->including = $including; $this->mDefaultDirection = $request->getBool( 'desc' ) @@ -110,9 +111,13 @@ class UsersPager extends AlphabeticPager { $options = []; + if ( $this->requestedGroup != '' || $this->temporaryGroupsOnly ) { + $conds[] = 'ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ) . + ( !$this->temporaryGroupsOnly ? ' OR ug_expiry IS NULL' : '' ); + } + if ( $this->requestedGroup != '' ) { $conds['ug_group'] = $this->requestedGroup; - $conds[] = 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ); } if ( $this->requestedUser != '' ) { @@ -296,6 +301,13 @@ class UsersPager extends AlphabeticPager { 'id' => 'editsOnly', 'default' => $this->editsOnly ], + 'temporaryGroupsOnly' => [ + 'type' => 'check', + 'label' => $this->msg( 'listusers-temporarygroupsonly' )->text(), + 'name' => 'temporaryGroupsOnly', + 'id' => 'temporaryGroupsOnly', + 'default' => $this->temporaryGroupsOnly + ], 'creationSort' => [ 'type' => 'check', 'label' => $this->msg( 'listusers-creationsort' )->text(), @@ -399,7 +411,7 @@ class UsersPager extends AlphabeticPager { $user = User::newFromId( $uid ); return $user->getGroupMemberships(); } else { - return isset( $cache[$uid] ) ? $cache[$uid] : []; + return $cache[$uid] ?? []; } }