Extension:UserRightsList

What can this extension do?
This extension provides an alternative to the standard User rights management special page.
 * Bureaucrats can view users as a list instead of searching for a specific user name
 * Users with account creation privileges can view limited rights for other users they created, if user creation logging is enabled
 * The user list can be filtered by group membership, username (with % wildcards), and/or date ranges for user_registration (by month).

Usage


User rights list will appear as a Restricted special page under Special:Specialpages if the user is logged in and has createaccount privileges. The page will determine whether the logged in user has 'userrights' rights (typically assigned to bureaucrats). If the user has 'userrights', they will see all users and will be able to assign them to all available groups. If the user only has 'createaccount', they will only see users that they have created, and will only be able to assign these to custom groups. In the screenshot, we have created a custom group called 'student'.

Long user lists are divided in pages using the usual paging system from query pages. User lists can also be filtered based on criteria controlled by the form at the top of the page. Filters:
 * By group - select one of the available groups
 * By username - this allows SQL wildcards that work with the LIKE operator. Thus, entering S% will find users whose usernames begin with S.
 * user_registration after - find users whose user_registration is during or after a particular month
 * user_registration before - find users whose user_registration is during or before a particular month

These can be used alone or in combination. For the date filters UserRightsList only displays the years when users have registered in the pulldown menu. The selection is ignored if a month is specified without a year.

Installation
Download and uncompress. Put the UserRightsList directory in your extensions directory

Changes to LocalSettings.php
require_once("$IP/extensions/UserRightsList/UserRightsList.php");

Code
Download from the link in the infobox.

Take DB table prefix into account
Thanks to Schneelocke for his useful patch. Extension should take $wgDBprefix into account if it is specified to work correctly. This is a simple copy of his patch, published here (see discussion page also):

diff -Niru UserRightsList-orig/SpecialUserRightsList.body.php UserRightsList-0.1-schnee1/SpecialUserRightsList.body.php --- UserRightsList-orig/SpecialUserRightsList.body.php	2007-08-20 07:39:18.000000000 +0200 +++ UserRightsList-0.1-schnee1/SpecialUserRightsList.body.php	2007-08-28 22:32:49.979125000 +0200 @@ -157,9 +157,11 @@ 	} 	function getYears{ +		global $wgDBprefix; +		 		$dbr =& wfGetDB( DB_SLAVE ); $years = array; -		$sql = "SELECT DISTINCT SUBSTR(user_registration, 1, 4) as years FROM user ORDER BY years"; +		$sql = "SELECT DISTINCT SUBSTR(user_registration, 1, 4) as years FROM ". $wgDBprefix. "user ORDER BY years"; $results = $dbr->query($sql); if ($results){ while( $x = $dbr->fetchObject ( $results ) ) { @@ -220,20 +222,20 @@ 	} 	function findMyUsers{ -		global $wgUser; +		global $wgUser, $wgDBprefix; $dbr =& wfGetDB( DB_SLAVE ); if(in_array('userrights',$wgUser->getRights)){ -			$sql = "SELECT u.user_id, u.user_name, u.user_registration FROM user u WHERE 1"; +			$sql = "SELECT u.user_id, u.user_name, u.user_registration FROM ". $wgDBprefix. "user u WHERE 1"; }else{ -			$sql = "SELECT u.user_id, u.user_name, u.user_registration FROM logging l, user u WHERE +			$sql = "SELECT u.user_id, u.user_name, u.user_registration FROM " . $wgDBprefix . "logging l, " . $wgDBprefix . "user u WHERE l.log_title = u.user_name AND log_type = 'newusers' AND log_user = '".$wgUser->getID."' "; 		} 		if (isset($this->group) && $this->group !=){ -			$sql = str_replace("FROM","FROM user_groups, ", $sql); +			$sql = str_replace("FROM","FROM " . $wgDBprefix . "user_groups, ", $sql); 			$sql .= " AND ug_user = u.user_id AND ug_group = '".$this->group."' "; 		} 		if (!is_null($this->username) && $this->username != ){

Russian translation
Apply this patch to translate extension to Russian. --- SpecialUserRightsList.i18n.php~    2007-08-20 01:43:16.000000000 +0400 +++ SpecialUserRightsList.i18n.php     2007-09-02 21:23:11.000000000 +0400 @@ -13,6 +13,13 @@                'regbefore' => 'Registered before', 'regafter' => 'Registered after', 'usernamelike' => 'User names like' -       ) +        ), +        'ru' => array( +                'userrightslist' => 'Список прав пользователей', +                'nousersfound' => 'Не найдено пользователей, правами которых вы можете управлять', +                'regbefore' => 'Зарегестрированы до', +                'regafter' => 'Зарегестрированы после', +                'usernamelike' => 'Имена пользователей (SQL "LIKE" синтаксис)' +        ), ); ?> \ No newline at end of file