Re: [web2py] Re: Web2py auth and Qooxdoo

2012-01-25 Thread Phyo Arkar
Thank you very very very much Bruno! that works!

web2py have the best online community!

On Sun, Jan 22, 2012 at 11:23 AM, Bruno Rocha rochacbr...@gmail.com wrote:


 Thats what I have in http://movu.ca

 def loginbare(self):
 username = self.request.vars.email
 password = self.request.vars.password
 user = auth.login_bare(username, password)
 if user:
 redirect(URL('person', 'show'))
 else:
 redirect(URL('home', 'index', args=[username, 'loginerror']))

 So I have a form that posts username and password to /loginbare action (it
 can be done in ajax)



 --

 Bruno Rocha
 [http://rochacbruno.com.br]




Re: [web2py] Re: Web2py auth and Qooxdoo

2012-01-25 Thread Phyo Arkar
And Bruno please keep Movca Rolling ! this have potential to become a
Killer Web2py and Python APP.

On Wed, Jan 25, 2012 at 10:51 PM, Phyo Arkar phyo.arkarl...@gmail.comwrote:

 Thank you very very very much Bruno! that works!

 web2py have the best online community!


 On Sun, Jan 22, 2012 at 11:23 AM, Bruno Rocha rochacbr...@gmail.comwrote:


 Thats what I have in http://movu.ca

 def loginbare(self):
 username = self.request.vars.email
 password = self.request.vars.password
 user = auth.login_bare(username, password)
 if user:
 redirect(URL('person', 'show'))
 else:
 redirect(URL('home', 'index', args=[username, 'loginerror']))

 So I have a form that posts username and password to /loginbare action
 (it can be done in ajax)



 --

 Bruno Rocha
 [http://rochacbruno.com.br]





Re: [web2py] Re: Web2py auth and Qooxdoo

2012-01-21 Thread Bruno Rocha
session.auth.user = auth.login_bare(someusername, somepassword)

On Sat, Jan 21, 2012 at 1:38 PM, Anthony abasta...@gmail.com wrote:

 I haven't tried it, but maybe something along these lines:

 def login():
 form = auth.login(next=URL('default', 'login'))
 if not request.post_vars:
 return form.formkey

 On the client side, you would make an initial Ajax request to login() when
 setting up your login form/widget -- in that case, login() will return a
 formkey as a string (which it will also store in the session). Upon login,
 send an Ajax post request to login() with the formkey value in a '_formkey'
 field. Once the login is processed, it should redirect back to login(),
 which will then return a new formkey value.

 Anthony


 On Friday, January 20, 2012 8:45:39 AM UTC-5, Phyo Arkar wrote:

 To keep it simple.

 How can i login (without using form) to web2py Auth  via AJAX?

 Thanks

 Phyo.


 On Fri, Jan 20, 2012 at 7:45 PM, Phyo Arkar phyo.ar...@gmail.com wrote:

 hello web2py.

 I am trying to get auth working with qooxdoo , can i know how should i
 login using ajax and (ofcoz use session) of webpy?

 Thanks

 Phyo.





-- 

Bruno Rocha
[http://rochacbruno.com.br]


Re: [web2py] Re: Web2py auth and Qooxdoo

2012-01-21 Thread Anthony
Thanks, Bruno -- completely forgot about login_bare.

On Saturday, January 21, 2012 7:21:53 PM UTC-5, rochacbruno wrote:

 session.auth.user = auth.login_bare(someusername, somepassword)

 On Sat, Jan 21, 2012 at 1:38 PM, Anthony abas...@gmail.com wrote:

 I haven't tried it, but maybe something along these lines:

 def login():
 form = auth.login(next=URL('default', 'login'))
 if not request.post_vars:
 return form.formkey

 On the client side, you would make an initial Ajax request to login() 
 when setting up your login form/widget -- in that case, login() will return 
 a formkey as a string (which it will also store in the session). Upon 
 login, send an Ajax post request to login() with the formkey value in a 
 '_formkey' field. Once the login is processed, it should redirect back to 
 login(), which will then return a new formkey value.

 Anthony


 On Friday, January 20, 2012 8:45:39 AM UTC-5, Phyo Arkar wrote:

 To keep it simple.

 How can i login (without using form) to web2py Auth  via AJAX?

 Thanks

 Phyo.


 On Fri, Jan 20, 2012 at 7:45 PM, Phyo Arkar phyo@gmail.com wrote:

 hello web2py.

 I am trying to get auth working with qooxdoo , can i know how should i 
 login using ajax and (ofcoz use session) of webpy?

 Thanks

 Phyo.





 -- 

 Bruno Rocha
 [http://rochacbruno.com.br]



Re: [web2py] Re: Web2py auth and Qooxdoo

2012-01-21 Thread Bruno Rocha
Thats what I have in http://movu.ca

def loginbare(self):
username = self.request.vars.email
password = self.request.vars.password
user = auth.login_bare(username, password)
if user:
redirect(URL('person', 'show'))
else:
redirect(URL('home', 'index', args=[username, 'loginerror']))

So I have a form that posts username and password to /loginbare action (it
can be done in ajax)


-- 

Bruno Rocha
[http://rochacbruno.com.br]