Re: [web2py] Re: login_bare not working

2018-12-12 Thread Anthony
On Tuesday, December 11, 2018 at 1:58:11 PM UTC-5, Ben Duncan wrote:
>
> Your right: should be:
> Controller:
> def user_bare():
> username, password = request.post_vars['username'], 
> request.post_vars['password']
> if not auth.user:
>form = auth.login_bare(username, password)
>

.login_bare does not generate a form -- it is form programmatically logging 
in without the Auth login form. If you need the login form, use 
auth.login() (or just use the standard user() action).

Anthony

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: login_bare not working

2018-12-11 Thread Ben Duncan
Your right: should be:
Controller:
def user_bare():
username, password = request.post_vars['username'],
request.post_vars['password']
if not auth.user:
   form = auth.login_bare(username, password)

return dict(form=form)

View:
{{extend 'layout.html'}}



 
 
  
 
 
  
 
 
   Submit
 
 

But now am getting:
web2py™ Version 2.17.2-stable+timestamp.2018.10.06.18.54.02
Python Python 2.7.13: /usr/bin/python (prefix: /opt/rh/python27/root/usr)
Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.

Traceback (most recent call last):
  File "/data/web2py/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
  File "/data/web2py/web2py/applications/Mec/controllers/default.py"
,
line 119, in 
  File "/data/web2py/web2py/gluon/globals.py", line 421, in 
self._caller = lambda f: f()
  File "/data/web2py/web2py/applications/Mec/controllers/default.py"
,
line 21, in user_bare
form = auth.login_bare(username, password)
  File "/data/web2py/web2py/gluon/tools.py", line 2283, in login_bare
self.login_user(user)
  File "/data/web2py/web2py/gluon/authapi.py", line 739, in login_user
self.update_groups()
  File "/data/web2py/web2py/gluon/authapi.py", line 503, in update_groups
table_membership.user_id == self.user.id).select()
  File 
"/opt/rh/python27/root/usr/lib/python2.7/site-packages/pyDAL-17.11-py2.7.egg/pydal/objects.py",
line 109, in __getattr__
raise AttributeError
AttributeError

Error snapshot [image: help]

With session.auth showing the correct user record.

But should NOT login_bare bypass all the checking of auth_membership,
groups , etc ?

ie:
Frames

   -

   *File /data/web2py/web2py/gluon/restricted.py in restricted at line 219*
   code arguments variables
   -

   *File /data/web2py/web2py/applications/Mec/controllers/default.py in
at line 119* code arguments variables
   -

   *File /data/web2py/web2py/gluon/globals.py in  at line 421* code
   arguments variables
   -

   *File /data/web2py/web2py/applications/Mec/controllers/default.py in
   user_bare at line 21* code arguments variables
   -

   *File /data/web2py/web2py/gluon/tools.py in login_bare at line 2283* code
   arguments variables
   -

   *File /data/web2py/web2py/gluon/authapi.py in login_user at line 739*
   code arguments variables
   -

   *File /data/web2py/web2py/gluon/authapi.py in update_groups at line 503*
   code arguments variables
   -

   *File
   
/opt/rh/python27/root/usr/lib/python2.7/site-packages/pyDAL-17.11-py2.7.egg/pydal/objects.py
   in __getattr__ at line 109* code arguments variables
   Function argument list

   (self=, k='id')
   Code listing

   104.
   105.
   106.
   107.
   108.
   109.
   110.
   111.
   112.
   113.


   def __getattr__(self, k):
   try:
   return self.__getitem__(k)
   except KeyError:
   raise AttributeError

   def __copy__(self):
   return Row(self)


Thanks ...


*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Tue, Dec 11, 2018 at 11:19 AM Yoel Benitez Fonseca 
wrote:

> probably abastardi wants:
>
> username, password = request.post_vars['username'], 
> request.post_vars['password']
> if not auth.user:
>  auth.login_bare(username, password)
>
>
> What is that's for ... i can only guest...
>
>
> On Dec 11 2018, at 11:58 am, Anthony  wrote:
>
>
> What is the point of calling login_bare a second time after it has failed
> the first time?
>
>
> What I click to fire off the "bare login" all I get is an empty web page
>
> that says "None"
>
>
> Presumably your controller is returning None, but hard to say what's
> happening without the code.
>
> Anthony
>
> --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> [image: Open Tracking]
>
> --
> 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 web2py+unsubscr...@googlegroups.com.
> For 

Re: [web2py] Re: login_bare not working

2018-12-11 Thread Yoel Benitez Fonseca
probably abastardi wants:

username, password = request.post_vars['username'], 
request.post_vars['password']
if not auth.user:
auth.login_bare(username, password)
What is that's for ... i can only guest...

On Dec 11 2018, at 11:58 am, Anthony  wrote:
> >
> >
> >
>
>
> What is the point of calling login_bare a second time after it has failed the 
> first time?
>
> >
> > What I click to fire off the "bare login" all I get is an empty web page
> >
> > that says "None"
> >
> >
>
>
> Presumably your controller is returning None, but hard to say what's 
> happening without the code.
>
> Anthony
> --
> 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 web2py+unsubscr...@googlegroups.com 
> (mailto:web2py+unsubscr...@googlegroups.com).
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: login_bare not working

2018-12-11 Thread Anthony

>
> username, password = request.post_vars['username'], 
> request.post_vars['password']if not auth.login_bare(username, password):
>  auth.login_bare(username, password)
>
>
What is the point of calling login_bare a second time after it has failed 
the first time?
 

> What I click to fire off the "bare login" all I get is an empty web page
>
> that says "None"
>
>
Presumably your controller is returning None, but hard to say what's 
happening without the code.

Anthony

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.