Why complicate?

Read the book :)

# disable register login (models/db.py) #
auth.settings.actions_disabled.append('register')



quarta-feira, 2 de Junho de 2010 às 16:59:15 UTC, hamdy.a.farag escreveu:
>
> sure !! 
> you'll have to make a small modification in controller default/user 
>
> def user(): 
>     form = auth() 
>     if request.args(0) == 'register': 
>         session.flash = 'Registration disabled' 
>         redirect(URL(r=request, c='default', f='index')) 
>     return dict(form=form) 
>
> On Jun 2, 7:03 pm, Jason Brower <[email protected]> wrote: 
> > Actually... Could you just do a redirect if they are not logged in? 
> > Br 
> > jason 
> > 
> > 
> > 
> > ----- Original message ----- 
> > 
> > > Don't forget to disable registration altogether, otherwise a user can 
> > > use /default/user/register link to add himself and thus may have 
> > > access to things you don't want him to 
> > 
> > > add the line: 
> > > auth.settings.actions_disabled.append('register') 
> > > in your model

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to