diff options
author | Marcin Kuzminski <marcin@python-works.com> | 2010-11-25 22:58:28 +0100 |
---|---|---|
committer | Marcin Kuzminski <marcin@python-works.com> | 2010-11-25 22:58:28 +0100 |
commit | a150dee95112072ade412b5d9b2042ccf64ff712 (patch) | |
tree | 032e3bed749aab6746511bb1df5e46e4e726f4b3 /rhodecode/model/forms.py | |
parent | 23e2cbf990c2bebe33c475cbcf6975275373c53b (diff) |
ldap auth rewrite, moved split authfunc into two functions,
made ldap case insensitive for uids
added some extra debug messages for ldap, and auth function
added some docs for utils
--HG--
branch : beta
Diffstat (limited to 'rhodecode/model/forms.py')
-rw-r--r-- | rhodecode/model/forms.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py index f8f4b51c..0e20c63a 100644 --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -19,24 +19,27 @@ list=[1,2,3,4,5] for SELECT use formencode.All(OneOf(list), Int()) """ +import os +import re +import logging + +import formencode from formencode import All from formencode.validators import UnicodeString, OneOf, Int, Number, Regex, \ Email, Bool, StringBoolean -from pylons import session + from pylons.i18n.translation import _ -from rhodecode.lib.auth import authfunc, get_crypt_password + +import rhodecode.lib.helpers as h +from rhodecode.lib.auth import authenticate, get_crypt_password from rhodecode.lib.exceptions import LdapImportError from rhodecode.model import meta from rhodecode.model.user import UserModel from rhodecode.model.repo import RepoModel from rhodecode.model.db import User -from webhelpers.pylonslib.secure_form import authentication_token from rhodecode import BACKENDS -import formencode -import logging -import os -import re -import rhodecode.lib.helpers as h + +from webhelpers.pylonslib.secure_form import authentication_token log = logging.getLogger(__name__) @@ -142,7 +145,7 @@ class ValidAuth(formencode.validators.FancyValidator): username = value['username'] user = UserModel().get_by_username(username) - if authfunc(None, username, password): + if authenticate(username, password): return value else: if user and user.active is False: |