Ok,
after some days i have found better solution to this problem:
1. change register() in default.py of T3 app in web2py admin interface
to:
def register():
if not is_admin and len(settings.administrator_emails)>0 and
settings.registration_disabled==True: t2.redirect('index',flash=T
('Registration is disabled'))
return dict(form=t2.register
(verification=settings.email_verification,sender=settings.email_sender))
2. register first user and set is as admin in manage/settings of T3
and add one new line:
settings.administrator_emails=['[email protected]']
settings.registration_disabled=True
>From now you can turn on/off registration by changing
settings.registration_disabled=True/False
regards
On 5 Lut, 11:48, ANDROSoft <[email protected]> wrote:
> Hello, again
>
> I'm just do it in 3 steps for now:
>
> 1. deployT3app
> 2. register first user and set is as admin in manage/settings ofT3:
> settings.administrator_emails=['[email protected]']
>
> 3. change register() in default.py ofT3app in web2py admin interface
> to:
>
> def register():
> if not is_admin: t2.redirect('index',flash=T('You must be admin to
> register new users'))
> return dict(form=t2.register
> (verification=settings.email_verification,sender=settings.email_sender))
>
> ---
> I think this is simplest and right way to do this...
>
> This was not straitforward before because myT3app is deployed on GAE
> and changed to run as Welcome app and for this time i don't know how
> to use web2py admin interface on GAE. I'm just edit my application
> local and redeploy it to GAE after changes.
>
> I can say only one word about web2py with T2 &T3: AWESOME
> i'm waiting for something like this all my life :D
> thx mdipierro
>
> On Feb 5, 11:07 am, achipa <[email protected]> wrote:
>
> > Maybe thread hijacking, but what's the recommended way of disabling
> > registration with the new web2py-core levelAuth? I know I can just
> > return if the user function argument is register, I'm just not sure
> > that is the best way (or how tied should the login with the
> > registration be).
>
> > On Feb 5, 6:17 am, mdipierro <[email protected]> wrote:
>
> > >T3is a web2py app so you edit it via admin. You can comment the
> > > register controller or replace it with something else.
>
> > > Via the wiki you can mark some pages as public and they will not
> > > require login.
>
> > > Massimo
>
> > > On Feb 4, 9:01 pm, ANDROSoft <[email protected]> wrote:
>
> > > > Hello,
>
> > > > I want disable registration onT3, how to do that ??
>
> > > > Exactly what i want is:
> > > > registration disabled, authorization required for most pages, but some
> > > > pages must be public, like Home or About Us...
>
> > > > regards
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---