* (bug 3192): properly check 'limit' parameter on Special:Contributions
* (bug 3187) watchlist text refer to unexistent "Stop watching" action
* Add block link and a link to the block log to Special:Contributions
+* Added $wgInvisibleGroups, to hide groups from Special:Listusers
Misc.:
* PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect
*/
# $wgGroupPermissions['developer']['siteadmin'] = true;
+/**
+ * List of groups which won't appear in Special:Listusers
+ */
+$wgInvisibleGroups = array();
/**
* Set of available actions that can be restricted via Special:Protect
'<input type="hidden" name="title" value="'.$special.'" />' .
wfMsgHtml( 'groups-editgroup-name' ) . '<select name="group">';
- // get all group names and IDs
- $groups = User::getAllGroups();
+ // get group names
+ $groups = User::getVisibleGroups();
// we want a default empty group
$out.= '<option value=""></option>';
}
function formatResult( $skin, $result ) {
-
$userPage = Title::makeTitle( $result->namespace, $result->title );
$name = $skin->makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) );
'ListUsersPage::formatResult' );
$groups = array();
while( $row = $dbr->fetchObject( $result ) ) {
- $groups[] = User::getGroupName( $row->ug_group );
+ if ( User::isVisibleGroup( $row->ug_group ) ) {
+ $groups[] = User::getGroupName( $row->ug_group );
+ }
}
$dbr->freeResult( $result );
array( '*', 'user', 'autoconfirmed' ) );
}
+ /**
+ * Return the set of groups which are not marked "invisible"
+ * @return array
+ * @static
+ */
+ function getVisibleGroups() {
+ global $wgGroupPermissions, $wgInvisibleGroups;
+ return array_diff( User::getAllGroups(), $wgInvisibleGroups );
+ }
+
+ /**
+ * Determine if a given group name is a valid, visible group
+ * @param string name
+ * @return bool
+ */
+ function isVisibleGroup( $group ) {
+ global $wgGroupPermissions, $wgInvisibleGroups;
+ return isset( $wgGroupPermissions[$group] ) && !in_array( $group, $wgInvisibleGroups );
+ }
}
?>