Index: trunk/extensions/CheckUser/CheckUser_body.php |
— | — | @@ -9,18 +9,18 @@ |
10 | 10 | class CheckUser extends SpecialPage |
11 | 11 | { |
12 | 12 | 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 | + } |
14 | 19 | wfLoadExtensionMessages('CheckUser'); |
15 | 20 | } |
16 | 21 | |
17 | 22 | function execute( $subpage ) { |
18 | 23 | global $wgRequest, $wgOut, $wgTitle, $wgUser, $wgContLang; |
19 | 24 | |
20 | | - if( !$wgUser->isAllowed( 'checkuser' ) ) { |
21 | | - $wgOut->permissionRequired( 'checkuser' ); |
22 | | - return; |
23 | | - } |
24 | | - |
25 | 25 | $this->setHeaders(); |
26 | 26 | $this->sk = $wgUser->getSkin(); |
27 | 27 | |
— | — | @@ -36,11 +36,28 @@ |
37 | 37 | foreach( $logMatches as $log ) { |
38 | 38 | if ( str_replace( '_', ' ', $wgContLang->lc( $subpage ) ) |
39 | 39 | == str_replace( '_ ', ' ', $wgContLang->lc( $log ) ) ) { |
| 40 | + if( !$wgUser->isAllowed( 'checkuser-log' ) ) { |
| 41 | + $wgOut->permissionRequired( 'checkuser-log' ); |
| 42 | + return; |
| 43 | + } |
| 44 | + |
40 | 45 | $this->showLog(); |
41 | 46 | return; |
42 | 47 | } |
43 | 48 | } |
44 | 49 | |
| 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 | + |
45 | 62 | $user = $wgRequest->getText( 'user' ) ? $wgRequest->getText( 'user' ) : $wgRequest->getText( 'ip' ); |
46 | 63 | $user = trim($user); |
47 | 64 | $reason = $wgRequest->getText( 'reason' ); |
Index: trunk/extensions/CheckUser/CheckUser.php |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | |
25 | 25 | $wgAvailableRights[] = 'checkuser'; |
26 | 26 | $wgGroupPermissions['checkuser']['checkuser'] = true; |
| 27 | +$wgGroupPermissions['checkuser']['checkuser-log'] = true; |
27 | 28 | |
28 | 29 | $wgCheckUserLog = '/home/wikipedia/logs/checkuser.log'; |
29 | 30 | |