Ok, Anthony will do. My question is should i put my new functions in "modules" or under "controllers" ?
Thanks *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division On Fri, Dec 14, 2018 at 5:56 PM Anthony <abasta...@gmail.com> wrote: > This should not be necessary. If you need to customize Auth tables, you > must do so in a manner that does not break existing Auth functionality. > Note, the problem you are having would not be limited to login_bare, but to > the standard .login() method as well. We do not want to complicate the Auth > code with lots of extra parameters and conditional logic to cover all the > ways in which someone might customize the Auth tables in a breaking manner. > Simply keep the default fields and add extra fields if needed. If you need > a completely different type of table to operate outside of the Auth system, > then don't customize an Auth table for such purposes but simply create an > independent table. > > Anthony > > On Friday, December 14, 2018 at 9:29:37 AM UTC-5, Ben Duncan wrote: >> >> 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. > -- 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.