X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiAuthManagerHelper.php;h=5327d7a99bca425c97bd517acfcf45a2e196cc0e;hb=92214baada6e6c5ae061a1034bce51b4342fd021;hp=1a42ccce9e02eb3882f0a47d27823879b92ac10a;hpb=fd5127b4f0278299760c823eb0c68523ad1cf3cc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiAuthManagerHelper.php b/includes/api/ApiAuthManagerHelper.php index 1a42ccce9e..5327d7a99b 100644 --- a/includes/api/ApiAuthManagerHelper.php +++ b/includes/api/ApiAuthManagerHelper.php @@ -93,7 +93,7 @@ class ApiAuthManagerHelper { /** * Call $manager->securitySensitiveOperationStatus() * @param string $operation Operation being checked. - * @throws UsageException + * @throws ApiUsageException */ public function securitySensitiveOperation( $operation ) { $status = AuthManager::singleton()->securitySensitiveOperationStatus( $operation ); @@ -102,14 +102,10 @@ class ApiAuthManagerHelper { return; case AuthManager::SEC_REAUTH: - $this->module->dieUsage( - 'You have not authenticated recently in this session, please reauthenticate.', 'reauthenticate' - ); + $this->module->dieWithError( 'apierror-reauthenticate' ); case AuthManager::SEC_FAIL: - $this->module->dieUsage( - 'This action is not available as your identify cannot be verified.', 'cannotreauthenticate' - ); + $this->module->dieWithError( 'apierror-cannotreauthenticate' ); default: throw new UnexpectedValueException( "Unknown status \"$status\"" ); @@ -173,13 +169,7 @@ class ApiAuthManagerHelper { $this->module->getMain()->markParamsUsed( array_keys( $data ) ); if ( $sensitive ) { - try { - $this->module->requirePostedParameters( array_keys( $sensitive ), 'noprefix' ); - } catch ( UsageException $ex ) { - // Make this a warning for now, upgrade to an error in 1.29. - $this->module->setWarning( $ex->getMessage() ); - $this->module->logFeatureUsage( $this->module->getModuleName() . '-params-in-query-string' ); - } + $this->module->requirePostedParameters( array_keys( $sensitive ), 'noprefix' ); } return AuthenticationRequest::loadRequestsFromSubmission( $reqs, $data );