Merge "Add CollationFa"
[lhc/web/wiklou.git] / includes / api / ApiResetPassword.php
index 042ad69..b5fa8ed 100644 (file)
@@ -52,7 +52,7 @@ class ApiResetPassword extends ApiBase {
 
        public function execute() {
                if ( !$this->hasAnyRoutes() ) {
-                       $this->dieUsage( 'No password reset routes are available.', 'moduledisabled' );
+                       $this->dieWithError( 'apihelp-resetpassword-description-noroutes', 'moduledisabled' );
                }
 
                $params = $this->extractRequestParams() + [
@@ -65,13 +65,13 @@ class ApiResetPassword extends ApiBase {
 
                $passwordReset = new PasswordReset( $this->getConfig(), AuthManager::singleton() );
 
-               $status = $passwordReset->isAllowed( $this->getUser(), $params['capture'] );
+               $status = $passwordReset->isAllowed( $this->getUser() );
                if ( !$status->isOK() ) {
                        $this->dieStatus( Status::wrap( $status ) );
                }
 
                $status = $passwordReset->execute(
-                       $this->getUser(), $params['user'], $params['email'], $params['capture']
+                       $this->getUser(), $params['user'], $params['email']
                );
                if ( !$status->isOK() ) {
                        $status->value = null;
@@ -80,12 +80,6 @@ class ApiResetPassword extends ApiBase {
 
                $result = $this->getResult();
                $result->addValue( [ 'resetpassword' ], 'status', 'success' );
-               if ( $params['capture'] ) {
-                       $passwords = $status->getValue() ?: [];
-                       ApiResult::setArrayType( $passwords, 'kvp', 'user' );
-                       ApiResult::setIndexedTagName( $passwords, 'p' );
-                       $result->addValue( [ 'resetpassword' ], 'passwords', $passwords );
-               }
        }
 
        public function isWriteMode() {
@@ -111,7 +105,6 @@ class ApiResetPassword extends ApiBase {
                        'email' => [
                                ApiBase::PARAM_TYPE => 'string',
                        ],
-                       'capture' => false,
                ];
 
                $resetRoutes = $this->getConfig()->get( 'PasswordResetRoutes' );