$tables[] = 'user_groups';
$conds[] = 'ug_user = user_id';
$conds['ug_group'] = $this->groups;
+ if ( !$this->getConfig()->get( 'DisableUserGroupExpiry' ) ) {
+ $conds[] = 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() );
+ }
}
if ( $this->excludegroups !== [] ) {
foreach ( $this->excludegroups as $group ) {
$conds[] = 'NOT EXISTS (' . $dbr->selectSQLText(
- 'user_groups', '1', [ 'ug_user = user_id', 'ug_group' => $group ]
- ) . ')';
+ 'user_groups', '1', [
+ 'ug_user = user_id',
+ 'ug_group' => $group,
+ $this->getConfig()->get( 'DisableUserGroupExpiry' ) ?
+ '1' :
+ 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
+ ]
+ ) . ')';
}
}
if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {