Gergő Tisza has uploaded a new change for review.
https://gerrit.wikimedia.org/r/291777
Change subject: Return error message in users API cancreate field
......................................................................
Return error message in users API cancreate field
That API field exposes AuthManager::canCreateAccount, where the error
message is important.
Change-Id: Idef441b311b94ff0cb6c4deaed1ac93959ee7ee8
---
M includes/api/ApiQueryUsers.php
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/77/291777/1
diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php
index 68ec38d..5afb66f 100644
--- a/includes/api/ApiQueryUsers.php
+++ b/includes/api/ApiQueryUsers.php
@@ -262,8 +262,11 @@
} else {
$data[$u]['missing'] = true;
if ( isset( $this->prop['cancreate'] )
&& !$this->getConfig()->get( 'DisableAuthManager' ) ) {
- $data[$u]['cancreate'] =
MediaWiki\Auth\AuthManager::singleton()->canCreateAccount( $u )
- ->isGood();
+ $status =
MediaWiki\Auth\AuthManager::singleton()->canCreateAccount( $u );
+ $data[$u]['cancreate'] =
$status->isGood();
+ if ( !$status->isGood() ) {
+
$data[$u]['cancreateerror'] = $this->getErrorFormatter()->arrayFromStatus(
$status );
+ }
}
}
} else {
--
To view, visit https://gerrit.wikimedia.org/r/291777
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idef441b311b94ff0cb6c4deaed1ac93959ee7ee8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits