r39519 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39518‎ | r39519 | r39520 >
Date:05:59, 17 August 2008
Author:krimpet
Status:old
Tags:
Comment:
Per bug 14839, split the 'checkuser' right into 'checkuser' and 'checkuser-log', to facilitate creation of an ombuds/oversight group; the stock CheckUser group will continue to hold both rights.
Modified paths:
  • /trunk/extensions/CheckUser/CheckUser.php (modified) (history)
  • /trunk/extensions/CheckUser/CheckUser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CheckUser/CheckUser_body.php
@@ -9,18 +9,18 @@
1010 class CheckUser extends SpecialPage
1111 {
1212 function CheckUser() {
13 - SpecialPage::SpecialPage('CheckUser', 'checkuser');
 13+ global $wgUser;
 14+ if ( $wgUser->isAllowed( 'checkuser' ) || !$wgUser->isAllowed( 'checkuser-log' ) ) {
 15+ SpecialPage::SpecialPage('CheckUser', 'checkuser');
 16+ } else {
 17+ SpecialPage::SpecialPage('CheckUser', 'checkuser-log');
 18+ }
1419 wfLoadExtensionMessages('CheckUser');
1520 }
1621
1722 function execute( $subpage ) {
1823 global $wgRequest, $wgOut, $wgTitle, $wgUser, $wgContLang;
1924
20 - if( !$wgUser->isAllowed( 'checkuser' ) ) {
21 - $wgOut->permissionRequired( 'checkuser' );
22 - return;
23 - }
24 -
2525 $this->setHeaders();
2626 $this->sk = $wgUser->getSkin();
2727
@@ -36,11 +36,28 @@
3737 foreach( $logMatches as $log ) {
3838 if ( str_replace( '_', ' ', $wgContLang->lc( $subpage ) )
3939 == str_replace( '_ ', ' ', $wgContLang->lc( $log ) ) ) {
 40+ if( !$wgUser->isAllowed( 'checkuser-log' ) ) {
 41+ $wgOut->permissionRequired( 'checkuser-log' );
 42+ return;
 43+ }
 44+
4045 $this->showLog();
4146 return;
4247 }
4348 }
4449
 50+ if( !$wgUser->isAllowed( 'checkuser' ) ) {
 51+ if ( $wgUser->isAllowed( 'checkuser-log' ) ) {
 52+ $wgOut->addWikiText( wfMsg( 'checkuser-summary' ) .
 53+ "\n\n[[" . $this->getLogSubpageTitle()->getPrefixedText() . '|' . wfMsg( 'checkuser-showlog' ) . ']]'
 54+ );
 55+ return;
 56+ }
 57+
 58+ $wgOut->permissionRequired( 'checkuser' );
 59+ return;
 60+ }
 61+
4562 $user = $wgRequest->getText( 'user' ) ? $wgRequest->getText( 'user' ) : $wgRequest->getText( 'ip' );
4663 $user = trim($user);
4764 $reason = $wgRequest->getText( 'reason' );
Index: trunk/extensions/CheckUser/CheckUser.php
@@ -23,6 +23,7 @@
2424
2525 $wgAvailableRights[] = 'checkuser';
2626 $wgGroupPermissions['checkuser']['checkuser'] = true;
 27+$wgGroupPermissions['checkuser']['checkuser-log'] = true;
2728
2829 $wgCheckUserLog = '/home/wikipedia/logs/checkuser.log';
2930

Status & tagging log