##// END OF EJS Templates
added session remove in forms, and added name and lastname to auth user
marcink -
r355:5bbcc0ca default
parent child Browse files
Show More
@@ -77,6 +77,8 b' class AuthUser(object):'
77 """
77 """
78 def __init__(self):
78 def __init__(self):
79 self.username = 'None'
79 self.username = 'None'
80 self.name = ''
81 self.lastname = ''
80 self.user_id = None
82 self.user_id = None
81 self.is_authenticated = False
83 self.is_authenticated = False
82 self.is_admin = False
84 self.is_admin = False
@@ -97,6 +97,8 b' class ValidAuth(formencode.validators.Fa'
97 auth_user.is_authenticated = True
97 auth_user.is_authenticated = True
98 auth_user.is_admin = user.admin
98 auth_user.is_admin = user.admin
99 auth_user.user_id = user.user_id
99 auth_user.user_id = user.user_id
100 auth_user.name = user.name
101 auth_user.lastname = user.lastname
100 session['hg_app_user'] = auth_user
102 session['hg_app_user'] = auth_user
101 session.save()
103 session.save()
102 log.info('user %s is now authenticated', username)
104 log.info('user %s is now authenticated', username)
@@ -122,7 +124,7 b' class ValidAuth(formencode.validators.Fa'
122 value, state,
124 value, state,
123 error_dict=self.e_dict_disable)
125 error_dict=self.e_dict_disable)
124
126
125
127 meta.Session.remove()
126 class ValidRepoUser(formencode.validators.FancyValidator):
128 class ValidRepoUser(formencode.validators.FancyValidator):
127
129
128 def to_python(self, value, state):
130 def to_python(self, value, state):
General Comments 0
You need to be logged in to leave comments. Login now