r45119 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45118‎ | r45119 | r45120 >
Date:11:50, 28 December 2008
Author:aaron
Status:ok
Tags:
Comment:
(bug 16721) Reset auth token to stop auto-login. Auto-login defeats the user rename/touch change to break the login since the user can just get logged in again under the old name without noticing, which results in edits under the old name.
Modified paths:
  • /trunk/extensions/Renameuser/SpecialRenameuser_body.php (modified) (history)
  • /trunk/phase3/includes/AuthPlugin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/AuthPlugin.php
@@ -258,4 +258,9 @@
259259 # Override this!
260260 return false;
261261 }
 262+
 263+ public function resetAuthToken() {
 264+ # Override this!
 265+ return true;
 266+ }
262267 }
Index: trunk/extensions/Renameuser/SpecialRenameuser_body.php
@@ -419,6 +419,11 @@
420420 if( !$dbw->affectedRows() ) {
421421 return false;
422422 }
 423+ // Reset token to break login with central auth systems.
 424+ // Again, avoids user being logged in with old name.
 425+ $user = User::newFromId( $this->uid );
 426+ $authUser = $wgAuth->getUserInstance( $user );
 427+ $authUser->resetAuthToken();
423428
424429 // Delete from memcached.
425430 global $wgMemc;

Status & tagging log