Univention Bugzilla – Attachment 10806 Details for
Bug 53674
Renaming a user calls hook_ldap_pre_modify only after the action
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch (git:fbest/53674-udm-rename-hook)
53674.patch (text/plain), 2.36 KB, created by
Florian Best
on 2021-08-19 13:14:25 CEST
(
hide
)
Description:
patch (git:fbest/53674-udm-rename-hook)
Filename:
MIME Type:
Creator:
Florian Best
Created:
2021-08-19 13:14:25 CEST
Size:
2.36 KB
patch
obsolete
>commit 8b240f70fa7fe43fab684c783b92642118c54960 >Author: Florian Best <best@univention.de> >Date: Thu Aug 19 13:13:46 2021 +0200 > > Bug #53674: add UDM hook _ldap_{pre,post}_rename > >diff --git management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py >index 6adf6ebfc2..a42e9627f2 100644 >--- management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py >+++ management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py >@@ -1351,9 +1351,11 @@ class simpleLdap(object): > try: > self.dn = self.lo.modify(self.dn, ml, ignore_license=ignore_license, serverctrls=serverctrls, response=response, rename_callback=wouldRename.on_rename) > except wouldRename as exc: >+ self.call_udm_property_hook('hook_ldap_pre_rename', self) > self._ldap_pre_rename(exc.args[1]) > self.dn = self.lo.modify(self.dn, ml, ignore_license=ignore_license, serverctrls=serverctrls, response=response) > self._ldap_post_rename(exc.args[1]) >+ self.call_udm_property_hook('hook_ldap_post_rename', self) > if ml: > self._write_admin_diary_modify() > >diff --git management/univention-directory-manager-modules/modules/univention/admin/hook.py management/univention-directory-manager-modules/modules/univention/admin/hook.py >index 764b5a176c..b9c17bb64d 100644 >--- management/univention-directory-manager-modules/modules/univention/admin/hook.py >+++ management/univention-directory-manager-modules/modules/univention/admin/hook.py >@@ -172,6 +172,24 @@ class simpleHook(object): > """ > ud.debug(ud.ADMIN, ud.INFO, 'admin.syntax.hook.simpleHook: _ldap_post_remove called') > >+ def hook_ldap_pre_rename(self, obj): >+ # type: (univention.admin.handlers.simpleLdap) -> None >+ """ >+ This method is called before an |UDM| object is renamed. >+ >+ :param obj: The |UDM| object instance. >+ """ >+ ud.debug(ud.ADMIN, ud.INFO, 'admin.syntax.hook.simpleHook: _ldap_pre_rename called') >+ >+ def hook_ldap_post_rename(self, obj): >+ # type: (univention.admin.handlers.simpleLdap) -> None >+ """ >+ This method is called after the object was renamed from |LDAP|. >+ >+ :param obj: The |UDM| object instance. >+ """ >+ ud.debug(ud.ADMIN, ud.INFO, 'admin.syntax.hook.simpleHook: _ldap_post_rename called') >+ > > class AttributeHook(simpleHook): > """
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 53674
: 10806