Can someone review and possible add this to a merge if accepted:
Issue

Custom auth tables break login_bare:

    def login_bare(self, username, password, ident = None):
        """
        Logins user as specified by username (or email) and password

        If you use a custom auth user table and you do not have the
        field name 'id' defined, pass the ident paramater to add the id
        and value from ident field to avoid any errors from default
        assumptions that 'id' exsists
        """
        settings = self._get_login_settings()
        user = settings.table_user(**{settings.userfield: username})
        if user and ident:
           user['id'] = user[ident]

        if user and user.get(settings.passfield, False):
            password = settings.table_user[
                settings.passfield].validate(password)[0]
            if ((user.registration_key is None or
                 not user.registration_key.strip()) and
                    password == user[settings.passfield]):
                self.login_user(user)
                return user
        else:
            # user not in database try other login methods
            for login_method in self.settings.login_methods:
                if login_method != self and login_method(username,
password):
                    self.user = user
                    return user
        return False


Thanks ..

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

-- 
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.

Reply via email to