jenkins-bot has submitted this change and it was merged.
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
(cherry picked from commit 43f4a05ec331bee0daf577de11bf56d0c1678bc8)
---
M includes/api/ApiQueryUsers.php
1 file changed, 5 insertions(+), 2 deletions(-)
Approvals:
Chad: Looks good to me, approved
jenkins-bot: Verified
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/293868
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idef441b311b94ff0cb6c4deaed1ac93959ee7ee8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_27
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits