X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiCreateAccount.php;h=2ce532b920c958af0f3283cd6fadf56900bd46f2;hb=64d5264dc58fbede0e971fd813b8ba90887d9ddb;hp=35bba174c37da75e55897b5db501534bdedae803;hpb=a6d6c125b020f58dc7ecf7eddb4ff60c96bbd5b3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiCreateAccount.php b/includes/api/ApiCreateAccount.php index 35bba174c3..2ce532b920 100644 --- a/includes/api/ApiCreateAccount.php +++ b/includes/api/ApiCreateAccount.php @@ -221,84 +221,6 @@ class ApiCreateAccount extends ApiBase { ); } - public function getResultProperties() { - return array( - 'createaccount' => array( - 'result' => array( - ApiBase::PROP_TYPE => array( - 'Success', - 'Warning', - 'NeedToken' - ) - ), - 'username' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ), - 'userid' => array( - ApiBase::PROP_TYPE => 'int', - ApiBase::PROP_NULLABLE => true - ), - 'token' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ), - ) - ); - } - - public function getPossibleErrors() { - // Note the following errors aren't possible and don't need to be listed: - // sessionfailure, nocookiesfornew, badretype - $localErrors = array( - 'wrongpassword', // Actually caused by wrong domain field. Riddle me that... - 'sorbs_create_account_reason', - 'noname', - 'userexists', - 'password-name-match', // from User::getPasswordValidity - 'password-login-forbidden', // from User::getPasswordValidity - 'noemailtitle', - 'invalidemailaddress', - 'externaldberror', - 'acct_creation_throttle_hit', - ); - - $errors = parent::getPossibleErrors(); - // All local errors are from LoginForm, which means they're actually message keys. - foreach ( $localErrors as $error ) { - $errors[] = array( - 'code' => $error, - 'info' => wfMessage( $error )->inLanguage( 'en' )->useDatabase( false )->parse() - ); - } - - $errors[] = array( - 'code' => 'permdenied-createaccount', - 'info' => 'You do not have the right to create a new account' - ); - $errors[] = array( - 'code' => 'blocked', - 'info' => 'You cannot create a new account because you are blocked' - ); - $errors[] = array( - 'code' => 'aborted', - 'info' => 'Account creation aborted by hook (info may vary)' - ); - $errors[] = array( - 'code' => 'langinvalid', - 'info' => 'Invalid language parameter' - ); - - // 'passwordtooshort' has parameters. :( - $errors[] = array( - 'code' => 'passwordtooshort', - 'info' => wfMessage( 'passwordtooshort', $this->getConfig()->get( 'MinimalPasswordLength' ) ) - ->inLanguage( 'en' )->useDatabase( false )->parse() - ); - - return $errors; - } - public function getExamples() { return array( 'api.php?action=createaccount&name=testuser&password=test123',