Merge "StringUtils: Add a utility for checking if a string is a valid regex"
[lhc/web/wiklou.git] / includes / api / ApiResetPassword.php
index e88a66a..6b1c217 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 use MediaWiki\Auth\AuthManager;
+use MediaWiki\MediaWikiServices;
 
 /**
  * Reset password, with AuthManager
@@ -43,11 +44,11 @@ class ApiResetPassword extends ApiBase {
                return $this->hasAnyRoutes;
        }
 
-       protected function getDescriptionMessage() {
+       protected function getExtendedDescription() {
                if ( !$this->hasAnyRoutes() ) {
-                       return 'apihelp-resetpassword-description-noroutes';
+                       return 'apihelp-resetpassword-extended-description-noroutes';
                }
-               return parent::getDescriptionMessage();
+               return parent::getExtendedDescription();
        }
 
        public function execute() {
@@ -63,7 +64,11 @@ class ApiResetPassword extends ApiBase {
 
                $this->requireOnlyOneParameter( $params, 'user', 'email' );
 
-               $passwordReset = new PasswordReset( $this->getConfig(), AuthManager::singleton() );
+               $passwordReset = new PasswordReset(
+                       $this->getConfig(),
+                       AuthManager::singleton(),
+                       MediaWikiServices::getInstance()->getPermissionManager()
+               );
 
                $status = $passwordReset->isAllowed( $this->getUser() );
                if ( !$status->isOK() ) {