$apiResult->addValue( null, 'createaccount', $result );
}
- public function getDescription() {
- return 'Create a new user account.';
- }
-
public function mustBePosted() {
return true;
}
);
}
- public function getParamDescription() {
- $p = $this->getModulePrefix();
-
- return array(
- 'name' => 'Username',
- 'password' => "Password (ignored if {$p}mailpassword is set)",
- 'domain' => 'Domain for external authentication (optional)',
- 'token' => 'Account creation token obtained in first request',
- 'email' => 'Email address of user (optional)',
- 'realname' => 'Real name of user (optional)',
- 'mailpassword' => 'If set to any value, a random password will be emailed to the user',
- 'reason' => 'Optional reason for creating the account to be put in the logs',
- 'language'
- => 'Language code to set as default for the user (optional, defaults to content language)'
- );
- }
-
- public function getExamples() {
+ protected function getExamplesMessages() {
return array(
- 'api.php?action=createaccount&name=testuser&password=test123',
- 'api.php?action=createaccount&name=testmailuser&mailpassword=true&reason=MyReason',
+ 'action=createaccount&name=testuser&password=test123'
+ => 'apihelp-createaccount-example-pass',
+ 'action=createaccount&name=testmailuser&mailpassword=true&reason=MyReason'
+ => 'apihelp-createaccount-example-mail',
);
}