Tweak Special:Listusers for CentralAuth
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Fri, 25 Apr 2008 19:18:48 +0000 (19:18 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Fri, 25 Apr 2008 19:18:48 +0000 (19:18 +0000)
includes/SpecialListusers.php

index 924bb5d..102c242 100644 (file)
@@ -140,8 +140,8 @@ class UsersPager extends AlphabeticPager {
                $out .= Xml::label( wfMsg( 'group' ), 'group' ) . ' ' .
                        Xml::openElement('select',  array( 'name' => 'group', 'id' => 'group' ) ) .
                        Xml::option( wfMsg( 'group-all' ), '' );
-               foreach( User::getAllGroups() as $group )
-                       $out .= Xml::option( User::getGroupName( $group ), $group, $group == $this->requestedGroup );
+               foreach( $this->getAllGroups() as $group => $groupText )
+                       $out .= Xml::option( $groupText, $group, $group == $this->requestedGroup );
                $out .= Xml::closeElement( 'select' ) . ' ';
 
                wfRunHooks( 'SpecialListusersHeaderForm', array( $this, &$out ) );
@@ -157,6 +157,14 @@ class UsersPager extends AlphabeticPager {
                return $out;
        }
 
+       function getAllGroups() {
+               $result = array();
+               foreach( User::getAllGroups() as $group ) {
+                       $result[$group] = User::getGroupName( $group );
+               }
+               return $result;
+       }
+
        /**
         * Preserve group and username offset parameters when paging
         * @return array
@@ -195,7 +203,7 @@ class UsersPager extends AlphabeticPager {
         * @param string $group
         * @return string
         */
-       private static function buildGroupLink( $group ) {
+       protected static function buildGroupLink( $group ) {
                static $cache = array();
                if( !isset( $cache[$group] ) )
                        $cache[$group] = User::makeGroupLinkHtml( $group, User::getGroupMember( $group ) );