]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Adding possibility to give a separate LDAP connection
authorFrank Brehm <frank@brehm-online.com>
Fri, 30 Sep 2022 14:47:37 +0000 (16:47 +0200)
committerFrank Brehm <frank@brehm-online.com>
Fri, 30 Sep 2022 14:47:37 +0000 (16:47 +0200)
lib/pp_admintools/app/ldap.py

index d57d9220635edc2ddf148ba9460ac045f3920c91..e31317528c47a2ff16151d8abaf44f96e2fa938e 100644 (file)
@@ -50,7 +50,7 @@ from ..config.ldap import LdapConnectionInfo, LdapConfiguration
 # rom ..config.ldap import DEFAULT_PORT_LDAP, DEFAULT_PORT_LDAPS
 from ..config.ldap import DEFAULT_TIMEOUT
 
-__version__ = '0.7.3'
+__version__ = '0.7.4'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
@@ -991,10 +991,11 @@ class BaseLdapApplication(BaseDPXApplication):
         return attribs
 
     # -------------------------------------------------------------------------
-    def modify_entry(self, inst, dn, changes):
+    def modify_entry(self, inst, dn, changes, ldap=None):
 
         connect_info = self.cfg.ldap_connection[inst]
-        ldap = self.ldap_connection[inst]
+        if not ldap:
+            ldap = self.ldap_connection[inst]
 
         # connect_info = self.cfg.ldap_connection[inst]
         if self.verbose > 1:
@@ -1035,10 +1036,11 @@ class BaseLdapApplication(BaseDPXApplication):
         return True
 
     # -------------------------------------------------------------------------
-    def delete_entry(self, inst, dn):
+    def delete_entry(self, inst, dn, ldap=None):
 
         connect_info = self.cfg.ldap_connection[inst]
-        ldap = self.ldap_connection[inst]
+        if not ldap:
+            ldap = self.ldap_connection[inst]
 
         msg = _("Deleting LDAP entry {dn!r} on {uri} ...").format(
             uri=connect_info.url, dn=dn)