r49015 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49014‎ | r49015 | r49016 >
Date:16:42, 29 March 2009
Author:catrope
Status:ok
Tags:
Comment:
CentralAuth changes for r49013
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuth.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuthHooks.php (modified) (history)
  • /trunk/extensions/CentralAuth/SpecialGlobalGroupMembership.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/SpecialGlobalGroupMembership.php
@@ -73,18 +73,17 @@
7474 }
7575
7676 function fetchUser( $username ) {
77 - global $wgOut, $wgUser, $wgRequest;
 77+ global $wgUser, $wgRequest;
7878
7979 $knownwiki = $wgRequest->getVal('wpKnownWiki');
8080
8181 $user = CentralAuthGroupMembershipProxy::newFromName( $username );
8282
8383 if( !$user ) {
84 - $wgOut->addWikiMsg( 'nosuchusershort', $username );
85 - return null;
 84+ return new WikiErrorMsg( 'nosuchusershort', $username );
8685 } elseif (!$wgRequest->getCheck( 'saveusergroups' ) && !$user->attachedOn($knownwiki)) {
87 - $wgOut->addWikiMsg( 'centralauth-globalgroupmembership-badknownwiki', $username, $knownwiki );
88 - return null;
 86+ return new WikiErrorMsg( 'centralauth-globalgroupmembership-badknownwiki',
 87+ $username, $knownwiki );
8988 }
9089
9190 return $user;
@@ -100,7 +99,7 @@
101100 LogEventsList::showLogExtract( $output, 'gblrights', $pageTitle->getPrefixedText() );
102101 }
103102
104 - static function addLogEntry( $user, $oldGroups, $newGroups, $reason ) {
 103+ function addLogEntry( $user, $oldGroups, $newGroups, $reason ) {
105104 global $wgRequest;
106105
107106 $log = new LogPage( 'gblrights' );
@@ -109,8 +108,8 @@
110109 $user->getUserPage(),
111110 $reason,
112111 array(
113 - self::makeGroupNameList( $oldGroups ),
114 - self::makeGroupNameList( $newGroups )
 112+ $this->makeGroupNameList( $oldGroups ),
 113+ $this->makeGroupNameList( $newGroups )
115114 )
116115 );
117116 }
Index: trunk/extensions/CentralAuth/CentralAuth.php
@@ -166,7 +166,6 @@
167167 $wgHooks['UserLoadDefaults'][] = 'CentralAuthHooks::onUserLoadDefaults';
168168 $wgHooks['getUserPermissionsErrorsExpensive'][] = 'CentralAuthHooks::onGetUserPermissionsErrorsExpensive';
169169 $wgHooks['MakeGlobalVariablesScript'][] = 'CentralAuthHooks::onMakeGlobalVariablesScript';
170 -$wgHooks['UserRightsLogEntry'][] = 'CentralAuthHooks::onUserRightsLogEntry';
171170
172171 // For interaction with the Special:Renameuser extension
173172 $wgHooks['RenameUserWarning'][] = 'CentralAuthHooks::onRenameUserWarning';
Index: trunk/extensions/CentralAuth/CentralAuthHooks.php
@@ -532,15 +532,4 @@
533533 }
534534 return true;
535535 }
536 -
537 - static function onUserRightsLogEntry( $user, $oldGroups, $newGroups, $reason ) {
538 - // Ugly hack for detecting whether we were called by core
539 - // userrights or ours
540 - if( $user instanceof CentralAuthGroupMembershipProxy ) {
541 - SpecialGlobalGroupMembership::addLogEntry( $user,
542 - $oldGroups, $newGroups, $reason );
543 - return false;
544 - }
545 - return true;
546 - }
547536 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49013Remove ugly userrights-CentralAuth hack introduced in r48970 and friends:...catrope16:39, 29 March 2009

Status & tagging log