mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-11-24 00:05:24 +00:00
Make disableOATHAuthForUser.php log out the affected user
Bug: T189537 Change-Id: Ib8141aedd674ebbc7b103e1f2e8ba6bf99945b61
This commit is contained in:
parent
e0c47addf6
commit
30ed1852b2
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Session\SessionManager;
|
||||
|
||||
if ( getenv( 'MW_INSTALL_PATH' ) ) {
|
||||
$IP = getenv( 'MW_INSTALL_PATH' );
|
||||
} else {
|
||||
|
@ -32,6 +34,11 @@ class DisableOATHAuthForUser extends Maintenance {
|
|||
}
|
||||
|
||||
$repo->remove( $oathUser, 'Maintenance script' );
|
||||
// Kill all existing sessions. If this disable was social-engineered by an attacker,
|
||||
// the legitimate user will hopefully login again and notice that the second factor
|
||||
// is missing or different, and alert the operators.
|
||||
SessionManager::singleton()->invalidateSessionsForUser( $user );
|
||||
|
||||
$this->output( "OATHAuth disabled for $username.\n" );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue