diff --git a/extension.json b/extension.json index a8ad8087..3f02c140 100644 --- a/extension.json +++ b/extension.json @@ -140,6 +140,9 @@ ] } }, + "ReauthenticateTime": { + "oathauth-enable": 60 + }, "load_composer_autoloader": true, "LogTypes": [ "oath" ], "LogNames": { diff --git a/src/Special/OATHManage.php b/src/Special/OATHManage.php index e7231d71..29ba9dd7 100644 --- a/src/Special/OATHManage.php +++ b/src/Special/OATHManage.php @@ -84,12 +84,12 @@ class OATHManage extends SpecialPage { * @return void */ public function execute( $subPage ) { - parent::execute( $subPage ); - $this->getOutput()->enableOOUI(); $this->setAction(); $this->setModule(); + parent::execute( $subPage ); + if ( $this->requestedModule instanceof IModule ) { // Performing an action on a requested module $this->clearPage(); @@ -127,6 +127,11 @@ class OATHManage extends SpecialPage { // No enabled module and cannot enable - nothing to do $this->displayRestrictionError(); } + + if ( $this->action === static::ACTION_ENABLE ) { + // Trying to change the 2FA method (one is already enabled) + $this->checkLoginSecurityLevel( 'oathauth-enable' ); + } } private function setAction() {