diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
commit | 6dc1997577fab2c366781fd7048144935afa0012 (patch) | |
tree | 8918d28c7ab4342f0738985e37af1dfc42d0e93a /includes/api/ApiCreateAccount.php | |
parent | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff) | |
parent | fa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff) |
Merge commit 'fa89acd'
# Conflicts:
# .gitignore
# extensions/ArchInterWiki.sql
Diffstat (limited to 'includes/api/ApiCreateAccount.php')
-rw-r--r-- | includes/api/ApiCreateAccount.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/includes/api/ApiCreateAccount.php b/includes/api/ApiCreateAccount.php index 455540b4..5443faca 100644 --- a/includes/api/ApiCreateAccount.php +++ b/includes/api/ApiCreateAccount.php @@ -21,6 +21,7 @@ * * @file */ +use MediaWiki\Logger\LoggerFactory; /** * Unit to authenticate account registration attempts to the current wiki. @@ -48,7 +49,12 @@ class ApiCreateAccount extends ApiBase { ); } if ( $this->getUser()->isBlockedFromCreateAccount() ) { - $this->dieUsage( 'You cannot create a new account because you are blocked', 'blocked' ); + $this->dieUsage( + 'You cannot create a new account because you are blocked', + 'blocked', + 0, + array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $this->getUser()->getBlock() ) ) + ); } $params = $this->extractRequestParams(); @@ -90,6 +96,10 @@ class ApiCreateAccount extends ApiBase { $loginForm->load(); $status = $loginForm->addNewaccountInternal(); + LoggerFactory::getInstance( 'authmanager' )->info( 'Account creation attempt via API', array( + 'event' => 'accountcreation', + 'status' => $status, + ) ); $result = array(); if ( $status->isGood() ) { // Success! @@ -186,7 +196,9 @@ class ApiCreateAccount extends ApiBase { ApiBase::PARAM_TYPE => 'user', ApiBase::PARAM_REQUIRED => true ), - 'password' => null, + 'password' => array( + ApiBase::PARAM_TYPE => 'password', + ), 'domain' => null, 'token' => null, 'email' => array( |