Index: trunk/extensions/CentralAuth/SpecialGlobalGroupMembership.php |
— | — | @@ -73,18 +73,17 @@ |
74 | 74 | } |
75 | 75 | |
76 | 76 | function fetchUser( $username ) { |
77 | | - global $wgOut, $wgUser, $wgRequest; |
| 77 | + global $wgUser, $wgRequest; |
78 | 78 | |
79 | 79 | $knownwiki = $wgRequest->getVal('wpKnownWiki'); |
80 | 80 | |
81 | 81 | $user = CentralAuthGroupMembershipProxy::newFromName( $username ); |
82 | 82 | |
83 | 83 | if( !$user ) { |
84 | | - $wgOut->addWikiMsg( 'nosuchusershort', $username ); |
85 | | - return null; |
| 84 | + return new WikiErrorMsg( 'nosuchusershort', $username ); |
86 | 85 | } 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 ); |
89 | 88 | } |
90 | 89 | |
91 | 90 | return $user; |
— | — | @@ -100,7 +99,7 @@ |
101 | 100 | LogEventsList::showLogExtract( $output, 'gblrights', $pageTitle->getPrefixedText() ); |
102 | 101 | } |
103 | 102 | |
104 | | - static function addLogEntry( $user, $oldGroups, $newGroups, $reason ) { |
| 103 | + function addLogEntry( $user, $oldGroups, $newGroups, $reason ) { |
105 | 104 | global $wgRequest; |
106 | 105 | |
107 | 106 | $log = new LogPage( 'gblrights' ); |
— | — | @@ -109,8 +108,8 @@ |
110 | 109 | $user->getUserPage(), |
111 | 110 | $reason, |
112 | 111 | array( |
113 | | - self::makeGroupNameList( $oldGroups ), |
114 | | - self::makeGroupNameList( $newGroups ) |
| 112 | + $this->makeGroupNameList( $oldGroups ), |
| 113 | + $this->makeGroupNameList( $newGroups ) |
115 | 114 | ) |
116 | 115 | ); |
117 | 116 | } |
Index: trunk/extensions/CentralAuth/CentralAuth.php |
— | — | @@ -166,7 +166,6 @@ |
167 | 167 | $wgHooks['UserLoadDefaults'][] = 'CentralAuthHooks::onUserLoadDefaults'; |
168 | 168 | $wgHooks['getUserPermissionsErrorsExpensive'][] = 'CentralAuthHooks::onGetUserPermissionsErrorsExpensive'; |
169 | 169 | $wgHooks['MakeGlobalVariablesScript'][] = 'CentralAuthHooks::onMakeGlobalVariablesScript'; |
170 | | -$wgHooks['UserRightsLogEntry'][] = 'CentralAuthHooks::onUserRightsLogEntry'; |
171 | 170 | |
172 | 171 | // For interaction with the Special:Renameuser extension |
173 | 172 | $wgHooks['RenameUserWarning'][] = 'CentralAuthHooks::onRenameUserWarning'; |
Index: trunk/extensions/CentralAuth/CentralAuthHooks.php |
— | — | @@ -532,15 +532,4 @@ |
533 | 533 | } |
534 | 534 | return true; |
535 | 535 | } |
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 | | - } |
547 | 536 | } |