dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
API: i18n for warnings and errors
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiChangeAuthenticationData.php
diff --git
a/includes/api/ApiChangeAuthenticationData.php
b/includes/api/ApiChangeAuthenticationData.php
index
54547ef
..
c25920e
100644
(file)
--- a/
includes/api/ApiChangeAuthenticationData.php
+++ b/
includes/api/ApiChangeAuthenticationData.php
@@
-35,7
+35,7
@@
class ApiChangeAuthenticationData extends ApiBase {
public function execute() {
if ( !$this->getUser()->isLoggedIn() ) {
public function execute() {
if ( !$this->getUser()->isLoggedIn() ) {
- $this->die
Usage( 'Must be logged in to change authentication
data', 'notloggedin' );
+ $this->die
WithError( 'apierror-mustbeloggedin-changeauthentication
data', 'notloggedin' );
}
$helper = new ApiAuthManagerHelper( $this );
}
$helper = new ApiAuthManagerHelper( $this );
@@
-50,12
+50,13
@@
class ApiChangeAuthenticationData extends ApiBase {
$this->getConfig()->get( 'ChangeCredentialsBlacklist' )
);
if ( count( $reqs ) !== 1 ) {
$this->getConfig()->get( 'ChangeCredentialsBlacklist' )
);
if ( count( $reqs ) !== 1 ) {
- $this->die
Usage( 'Failed to create change
request', 'badrequest' );
+ $this->die
WithError( 'apierror-changeauth-no
request', 'badrequest' );
}
$req = reset( $reqs );
// Make the change
$status = $manager->allowsAuthenticationDataChange( $req, true );
}
$req = reset( $reqs );
// Make the change
$status = $manager->allowsAuthenticationDataChange( $req, true );
+ Hooks::run( 'ChangeAuthenticationDataAudit', [ $req, $status ] );
if ( !$status->isGood() ) {
$this->dieStatus( $status );
}
if ( !$status->isGood() ) {
$this->dieStatus( $status );
}