mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-23 01:44:22 +01:00
implementing deletion of a user
This commit is contained in:
parent
e367b38be3
commit
1b5c737cd5
@ -447,6 +447,14 @@ class LdapCherry(object):
|
|||||||
def _deleteuser(self, username):
|
def _deleteuser(self, username):
|
||||||
for b in self.backends:
|
for b in self.backends:
|
||||||
self.backends[b].del_user(username)
|
self.backends[b].del_user(username)
|
||||||
|
cherrypy.log.error(
|
||||||
|
msg = "User '" + username + "' deleted from backend '" + b + "'",
|
||||||
|
severity = logging.DEBUG
|
||||||
|
)
|
||||||
|
cherrypy.log.error(
|
||||||
|
msg = "User '" + username + "' deleted",
|
||||||
|
severity = logging.INFO
|
||||||
|
)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def signin(self):
|
def signin(self):
|
||||||
@ -565,11 +573,13 @@ class LdapCherry(object):
|
|||||||
return self.temp_adduser.render(form=form, roles=roles, is_admin=is_admin, notification=notification)
|
return self.temp_adduser.render(form=form, roles=roles, is_admin=is_admin, notification=notification)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def delete(self, **params):
|
def delete(self, user):
|
||||||
""" remove user page """
|
""" remove user page """
|
||||||
self._check_auth(must_admin=True)
|
self._check_auth(must_admin=True)
|
||||||
is_admin = self._check_admin()
|
is_admin = self._check_admin()
|
||||||
pass
|
referer = cherrypy.request.headers['Referer']
|
||||||
|
self._deleteuser(user)
|
||||||
|
raise cherrypy.HTTPRedirect(referer)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def modify(self, user=None, **params):
|
def modify(self, user=None, **params):
|
||||||
|
Loading…
Reference in New Issue
Block a user