1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-26 03:04:30 +01:00

change where form parsing is executed

this change creates a cleaner api for core functions
This commit is contained in:
kakwa 2015-06-28 23:10:58 +02:00
parent f1153137bc
commit 31907f726b

View File

@ -485,7 +485,6 @@ class LdapCherry(object):
msg = "add user form attributes: " + str(params), msg = "add user form attributes: " + str(params),
severity = logging.DEBUG severity = logging.DEBUG
) )
params = self._parse_params(params)
badd = {} badd = {}
for attr in self.attributes.get_attributes(): for attr in self.attributes.get_attributes():
@ -562,7 +561,6 @@ class LdapCherry(object):
msg = "modify user form attributes: " + str(params), msg = "modify user form attributes: " + str(params),
severity = logging.DEBUG severity = logging.DEBUG
) )
params = self._parse_params(params)
sess = cherrypy.session sess = cherrypy.session
username = str(sess.get(SESSION_KEY, None)) username = str(sess.get(SESSION_KEY, None))
badd = self._modify_attrs(params, self.attributes.get_selfattributes(), username) badd = self._modify_attrs(params, self.attributes.get_selfattributes(), username)
@ -580,7 +578,6 @@ class LdapCherry(object):
msg = "modify user form attributes: " + str(params), msg = "modify user form attributes: " + str(params),
severity = logging.DEBUG severity = logging.DEBUG
) )
params = self._parse_params(params)
key = self.attributes.get_key() key = self.attributes.get_key()
username = params['attrs'][key] username = params['attrs'][key]
@ -777,6 +774,7 @@ class LdapCherry(object):
if cherrypy.request.method.upper() == 'POST': if cherrypy.request.method.upper() == 'POST':
notification = "<script type=\"text/javascript\">$.notify('User Added')</script>" notification = "<script type=\"text/javascript\">$.notify('User Added')</script>"
params = self._parse_params(params)
self._adduser(params) self._adduser(params)
else: else:
notification = '' notification = ''
@ -812,6 +810,7 @@ class LdapCherry(object):
if cherrypy.request.method.upper() == 'POST': if cherrypy.request.method.upper() == 'POST':
notification = "<script type=\"text/javascript\">$.notify('User Modify')</script>" notification = "<script type=\"text/javascript\">$.notify('User Modify')</script>"
params = self._parse_params(params)
self._modify(params) self._modify(params)
referer = cherrypy.request.headers['Referer'] referer = cherrypy.request.headers['Referer']
raise cherrypy.HTTPRedirect(referer) raise cherrypy.HTTPRedirect(referer)
@ -847,6 +846,7 @@ class LdapCherry(object):
if self.auth_mode == 'none': if self.auth_mode == 'none':
return "not available without authentication disabled" return "not available without authentication disabled"
if cherrypy.request.method.upper() == 'POST': if cherrypy.request.method.upper() == 'POST':
params = self._parse_params(params)
self._selfmodify(params) self._selfmodify(params)
user_attrs = self._get_user(user) user_attrs = self._get_user(user)
form = self.temp_form.render(attributes=self.attributes.get_selfattributes(), values=user_attrs, modify=True) form = self.temp_form.render(attributes=self.attributes.get_selfattributes(), values=user_attrs, modify=True)