Topic on Project:Support desk

Is there a way to preemptively create a user account?

5
108.217.170.176 (talkcontribs)

I have a group of people who will be accessing my wiki in the near future. They currently do not have accounts. I would like to have them be in a particular user group, before they login for the first time. This way they will have the permissions they need without having to login and then ask to be added to a user group. Is there some way to pre-populate the user's accounts? I'm looking at the user table and it looks like I could populate new rows there and in user_groups to make this happen. Does anyone have any suggestions or ideas? Thanks!

120.144.141.81 (talkcontribs)

Just go to the normal create account form while logged in and you can create additional accounts for people there.

88.130.85.32 (talkcontribs)

I understand the question that 108.217... wants to have accounts created (in which way ever), but these accounts should then automatically be put into a certain usergroup.

MediaWiki does have the maintenance script createAndPromote.php. So if you create the accounts from the shell, then you can add groups. However, this script only allows to add the groups sysop, bureaucrat or bot to the user account. Other groups are not possible. Anyway, based on that script, you maybe can write an own script, which basically does exactly the same, but also allows to add other groups.

I am even asking myself, why only these few selected groups should be possible. It is absolutely ok to have other groups with different names as well and it surely does make sense to be able to put users into these other groups as well. An according feature request might be an idea!

Florianschmidtwelzow (talkcontribs)

I'm wondering, if it isn't possible to use the "normal" user promotion mechanism. If a new user is created he is automatically in the group "Users", so why not adjust the rights of this group like you want and create a new additional group, which has the required permissions to do other things?

88.130.85.32 (talkcontribs)

I understood that not all new users should get these special permissions, but only some of them. Like you have a whitelist and if the new username is "Klaus", then the user should be put in the special group.

I thought this might be possible with a hook, but I only found auditing hooks, which are called after a new user has been added.

Reply to "Is there a way to preemptively create a user account?"