Rename autonym for 'no' from 'norsk bokmål' to 'norsk'
[lhc/web/wiklou.git] / includes / api / ApiRemoveAuthenticationData.php
index 30e40fb..359d045 100644 (file)
@@ -45,7 +45,7 @@ class ApiRemoveAuthenticationData extends ApiBase {
 
        public function execute() {
                if ( !$this->getUser()->isLoggedIn() ) {
-                       $this->dieUsage( 'Must be logged in to remove authentication data', 'notloggedin' );
+                       $this->dieWithError( 'apierror-mustbeloggedin-removeauth', 'notloggedin' );
                }
 
                $params = $this->extractRequestParams();
@@ -67,12 +67,13 @@ class ApiRemoveAuthenticationData extends ApiBase {
                        }
                );
                if ( count( $reqs ) !== 1 ) {
-                       $this->dieUsage( 'Failed to create change request', 'badrequest' );
+                       $this->dieWithError( 'apierror-changeauth-norequest', 'badrequest' );
                }
                $req = reset( $reqs );
 
                // Perform the removal
                $status = $manager->allowsAuthenticationDataChange( $req, true );
+               Hooks::run( 'ChangeAuthenticationDataAudit', [ $req, $status ] );
                if ( !$status->isGood() ) {
                        $this->dieStatus( $status );
                }