1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 17:34:21 +01:00

fix adding multiple time to same group + logs

This commit is contained in:
kakwa 2015-06-21 23:41:24 +02:00
parent 71576f0aea
commit 622e730017

View File

@ -27,6 +27,7 @@ from cherrypy.lib.httputil import parse_query_string
#mako template engines imports #mako template engines imports
from mako.template import Template from mako.template import Template
from mako import lookup from mako import lookup
from sets import Set
SESSION_KEY = '_cp_username' SESSION_KEY = '_cp_username'
@ -428,7 +429,17 @@ class LdapCherry(object):
roles.append(r) roles.append(r)
groups = self.roles.get_groups(roles) groups = self.roles.get_groups(roles)
for b in groups: for b in groups:
self.backends[b].add_to_groups(username, groups[b]) self.backends[b].add_to_groups(username, Set(groups[b]))
cherrypy.log.error(
msg = "User '" + username + "' made member of " + str(roles)+ " by '" + admin + "'",
severity = logging.INFO
)
cherrypy.log.error(
msg = "User '" + username + "' groups: " + str(groups),
severity = logging.DEBUG
)
def _modify(self, params): def _modify(self, params):
pass pass