You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by "1one.w01f" <de...@gmail.com> on 2015/10/30 16:05:00 UTC

user registration, batch account creation and deletion

Dear developers,

Thank you all for creating such a great system. Kudos.

However, I have some questions regarding user registration and batch 
account creation/deletion. I hope the dev mailing list is the right 
place to ask.

1) In our environment, we would like to have a mechanism such that all 
new user registration needs to be approved before it becomes effective. 
Currently we have "auth.allow_user_registration" set to false in 
development.ini. With this, we are effectively preventing arbitrary user 
registrations from the Web frontend but is there a way, say for example 
in the admin interface, for the administrator to add new user manually?

2) The second question is somewhat related to my previous one. Is there 
a way to batch create or delete a list of user accounts, say with a 
script on the server?

Thank you very much and wish you all a good day.

-1one.wo1f

Re: user registration, batch account creation and deletion

Posted by heith seewald <he...@gmail.com>.
Great to hear you like the project!

1) There is not currently an option for that.  You could add that
functionality by editing:

LocalAuthenticationProvider.register_user and adding:

if asbool(config.get('auth.users_disabled_by_default', False)):

    u.disabled = True

Then admins would need to enable each account manually.  A more elegant
solution would be to extend the *LocalAuthenticationProvider* so you can
display custom messages to newly registered users explaining that their
account needs to be approved before they can login.

I'd be interested to hear what kind of environment you're running.  Maybe
this is a common need for other users too?

2) This is easy to do in python:

from allura import model as M

user = M.User.register(dict(username=username, display_name=display_name))

user.set_password(password)


On Fri, Oct 30, 2015 at 11:05 AM, 1one.w01f <de...@gmail.com> wrote:

> Dear developers,
>
> Thank you all for creating such a great system. Kudos.
>
> However, I have some questions regarding user registration and batch
> account creation/deletion. I hope the dev mailing list is the right place
> to ask.
>
> 1) In our environment, we would like to have a mechanism such that all new
> user registration needs to be approved before it becomes effective.
> Currently we have "auth.allow_user_registration" set to false in
> development.ini. With this, we are effectively preventing arbitrary user
> registrations from the Web frontend but is there a way, say for example in
> the admin interface, for the administrator to add new user manually?
>
> 2) The second question is somewhat related to my previous one. Is there a
> way to batch create or delete a list of user accounts, say with a script on
> the server?
>
> Thank you very much and wish you all a good day.
>
> -1one.wo1f
>