Merge "Update signature of UserGroupsChanged to match documentation"
[lhc/web/wiklou.git] / includes / specials / pagers / ActiveUsersPager.php
index 0d6f493..64af71a 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Copyright © 2008 Aaron Schulz
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -101,9 +99,7 @@ class ActiveUsersPager extends UsersPager {
                        $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() );
-                       }
+                       $conds[] = 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() );
                }
                if ( $this->excludegroups !== [] ) {
                        foreach ( $this->excludegroups as $group ) {
@@ -111,9 +107,7 @@ class ActiveUsersPager extends UsersPager {
                                        '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() )
+                                               'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
                                        ]
                                ) . ')';
                        }
@@ -124,16 +118,15 @@ class ActiveUsersPager extends UsersPager {
                                ) . ')';
                }
 
-               if ( $dbr->implicitGroupby() ) {
-                       $options = [ 'GROUP BY' => [ 'qcc_title' ] ];
-               } else {
-                       $options = [ 'GROUP BY' => [ 'user_name', 'user_id', 'qcc_title' ] ];
-               }
-
                return [
                        'tables' => $tables,
-                       'fields' => [ 'user_name', 'user_id', 'recentedits' => 'COUNT(*)', 'qcc_title' ],
-                       'options' => $options,
+                       'fields' => [
+                               'qcc_title',
+                               'user_name' => 'qcc_title',
+                               'user_id' => 'MAX(user_id)',
+                               'recentedits' => 'COUNT(*)'
+                       ],
+                       'options' => [ 'GROUP BY' => [ 'qcc_title' ] ],
                        'conds' => $conds
                ];
        }