Merge "Drop index oi_name_archive_name on table oldimage"
[lhc/web/wiklou.git] / includes / api / ApiQueryAllUsers.php
index 3faccf9..9e7ad67 100644 (file)
@@ -122,7 +122,9 @@ class ApiQueryAllUsers extends ApiQueryBase {
                                        [
                                                'ug1.ug_user=user_id',
                                                'ug1.ug_group' => $params['group'],
-                                               'ug1.ug_expiry IS NULL OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+                                               $this->getConfig()->get( 'DisableUserGroupExpiry' ) ?
+                                                       '1' :
+                                                       'ug1.ug_expiry IS NULL OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
                                        ]
                                ]
                        ] );
@@ -145,7 +147,9 @@ class ApiQueryAllUsers extends ApiQueryBase {
                        $this->addJoinConds( [ 'ug1' => [ 'LEFT OUTER JOIN',
                                array_merge( [
                                        'ug1.ug_user=user_id',
-                                       'ug1.ug_expiry IS NULL OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+                                       $this->getConfig()->get( 'DisableUserGroupExpiry' ) ?
+                                               '1' :
+                                               'ug1.ug_expiry IS NULL OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
                                ], $exclude )
                        ] ] );
                        $this->addWhere( 'ug1.ug_user IS NULL' );
@@ -161,7 +165,9 @@ class ApiQueryAllUsers extends ApiQueryBase {
                        $this->addFields( [ 'groups' =>
                                $db->buildGroupConcatField( '|', 'user_groups', 'ug_group', [
                                        'ug_user=user_id',
-                                       'ug_expiry IS NULL OR ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
+                                       $this->getConfig()->get( 'DisableUserGroupExpiry' ) ?
+                                               '1' :
+                                               'ug_expiry IS NULL OR ug_expiry >= ' . $db->addQuotes( $db->timestamp() )
                                ] )
                        ] );
                }
@@ -180,7 +186,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
                                ],
                        ] ] );
 
-                       // Actually count the actions using a subquery (bug 64505 and bug 64507)
+                       // Actually count the actions using a subquery (T66505 and T66507)
                        $timestamp = $db->timestamp( wfTimestamp( TS_UNIX ) - $activeUserSeconds );
                        $this->addFields( [
                                'recentactions' => '(' . $db->selectSQLText(