You can just do this:

def register_new_user():
    form=SQLFORM(db.auth_user)
    if form_accepts(request.vars, session):
        auth.add_group('user_%s' ^ form.vars.id) ## a group for this
user, you can add others.
        session.flash="new user registered"
        redirect('index')
    return dict(form=form)

Massimo

On Mar 22, 3:10 pm, ctalley <ctal...@caci.com> wrote:
> Registration (http://..../[app]/default/user/register) behaves
> differently depending on whether a user is logged in or not logged in.
>
> If logged in: a prepopulated form with first name, last name, and e-
> mail of the logged-in user.
>
> If not logged in: an empty form with first name, last name, e-mail,
> and two password fields.
>
> I've designed my application with an "Administration" page.  One of
> the links on the Administration page is "Register New User".  Also,
> access to the Administration page is protected with
> @auth.requires_login() and @auth.requires_membership('Admin').  So,
> when I click Register New User on the Administration page, I get a
> prepopulated form with my name and e-mail information and,
> accordingly, no way to register a new user.  I have to log out of the
> application and access the registration page from outside of the
> application (because access within the application is protected). Any
> way this behavior can be changed so a logged-in user with admin
> privileges can register new users?  That is, accessing the
> registration page results in the "not logged in" behavior, as
> described above, whether you're logged in or not.  Then again, it was
> probably implemented as it is for a reason and maybe I'm missing
> something.
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to