Last modified: 2013-04-22 16:15:36 UTC
From <https://www.mediawiki.org/w/api.php>: --- * action=createaccount * Create a new user account. This module requires write rights This module only accepts POST requests Parameters: name - User Name This parameter is required password - Password (ignored if mailpassword is set) domain - Domain (optional) token - Account creation token obtained in first request email - Email address of user realname - Real Name of user mailpassword - Whether to generate and mail a random password to the user reason - Optional reason for creating the account (used when mailpassword is set) language - Language code to set for the user. Examples: api.php?action=createaccount&name=testuser&password=test123 api.php?action=createaccount&name=testmailuser&mailpassword=true&reason=MyReason Help page: https://www.mediawiki.org/wiki/API:Account creation --- * It should be "User name" or "Username"; may help to have a pointer here to what constitutes a valid user name (length limit, character restrictions, prefix restrictions, etc.)... * It's completely unclear what the "Domain" parameter is (it's equally unclear in the GUI as well...); I think most people would assume this would the wiki's domain name (e.g., "en.wikipedia.org") * "E-mail" is hyphenated in the MediaWiki interface, I believe * "Real name", not "Real Name" * Real name field isn't marked optional (or disabled... not even sure it works on Wikimedia wikis due a configuration variable) * It's unclear how you set mailpassword (&mailpassword=true perhaps or &mailpassword=1) * It's unclear whether the reason field is used when mailpassword is _not_ set * Not sure how the language parameter got in here... this isn't available via index.php, is it? * Help page URL is missing an underscore I'm not totally thrilled all of this got through code review and ended up in production, to be honest.
Yes, that does seem to need cleanup. (In reply to comment #0) > * It should be "User name" or "Username"; may help to have a pointer here to > what constitutes a valid user name (length limit, character restrictions, > prefix restrictions, etc.)... A pointer to that information is unlikely, since this much of this is different on different wikis. In general, we assume an API user knows how to look up what makes a valid user name, page title, and so on if they don't already know. > * It's unclear how you set mailpassword (&mailpassword=true perhaps or > &mailpassword=1) It's a general API thing: any boolean parameter is set if it is present at all. Even &mailpassword=0, &mailpassword=false, and &mailpassword= count as "set". Just like HTML form checkboxes.
(In reply to comment #0) > * It's completely unclear what the "Domain" parameter is (it's equally > unclear > in the GUI as well...); I think most people would assume this would the > wiki's > domain name (e.g., "en.wikipedia.org") TBH, to this day I also have absolutely no idea what the domain parameter is. It's some sort of parameter added in for external authentication modules. > I'm not totally thrilled all of this got through code review and ended up in > production, to be honest. That's a bit harsh. All of these are quite minor documentation problems that can be fixed easily.
https://gerrit.wikimedia.org/r/48966
(In reply to comment #2) > (In reply to comment #0) >> I'm not totally thrilled all of this got through code review and ended up in >> production, to be honest. > > That's a bit harsh. All of these are quite minor documentation problems that > can be fixed easily. A bit. Sorry. By the time I did a full read of the module's help section and I saw that the URL was broken, I was a little annoyed. (In reply to comment #3) > https://gerrit.wikimedia.org/r/48966 Thanks for this. :-) I left a few minor comments on the changeset.
Merged.