are you sure it's that?

I tried but got a very weird behavior. Instead, I started having too
authenticate to access everything and I had a lot of Errors with
GQLDB. Could you recheck If that is supposed to do what I want?

Thank you

On 2 Maio, 10:24, Fran <[email protected]> wrote:
> On May 2, 10:06 am, blackthorne <[email protected]> wrote:
>
> > I wanted to be able to have an user in the same application that could
> > log in directly to the admin application with the database
> > administration, the web IDE and all that nice stuff you know. My
> > intention is not to require a SSH tunnel for this.
> > Just log in with a user (in the same place where all users
> > authenticate) and join the administration area granted by default by
> > web2py for localhost.
>
> I do this.
> Just change the top of the application's copy of appadmin.py.
> For me, I do this:
>
> #http_host = request.env.http_host.split(':')[0]
> #remote_addr = request.env.remote_addr
> #try: hosts=(http_host, socket.gethostbyname(remote_addr))
> #except: hosts=(http_host,)
> #if remote_addr not in hosts:
> #    raise HTTP(400)
> #if not gluon.fileutils.check_credentials(request):
> #    redirect('/admin')
>
> try:
>     if 'Administrator' in session.s3.roles:
>         pass
>     else:
>         session.error=T('Not Authorised!')
>         redirect(URL(r=request,c='default',f='user',args='login'))
> except:
>     session.error=T('Not Authorised!')
>     redirect(URL(r=request,c='default',f='user',args='login'))
>
> F
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to