summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Vagelpohl <jens@netz.ooo>2001-06-21 17:25:04 +0000
committerJens Vagelpohl <jens@netz.ooo>2001-06-21 17:25:04 +0000
commitbef3055b3faabf5ba044b85f84e7cc02b0d7183e (patch)
tree77924651ecceb4b00567724108e6df6dae665ddc
parente3f617d0123f6ca24efa6bf9553ca8a6dd15def4 (diff)
downloadLDAPUserManager-bef3055b3faabf5ba044b85f84e7cc02b0d7183e.zip
LDAPUserManager-bef3055b3faabf5ba044b85f84e7cc02b0d7183e.tar.gz
added an argument "async" to manage_setUserProperties which, if set, will make the actual
LDAP call asynchronously, thereby hopefully speeding up the whole process.
-rw-r--r--LDAPUserManager.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/LDAPUserManager.py b/LDAPUserManager.py
index 240e28e..ce6304f 100644
--- a/LDAPUserManager.py
+++ b/LDAPUserManager.py
@@ -343,7 +343,12 @@ class LDAPUserManager( SimpleItem, LDAPShared ):
security.declareProtected('Manage users', 'manage_setUserProperty')
- def manage_setUserProperty(self, user_dn, prop_name, prop_value):
+ def manage_setUserProperty( self
+ , user_dn
+ , prop_name
+ , prop_value
+ , async=0
+ ):
""" Set a new attribute on the user record """
if type(prop_value) == type(''):
prop_value = map(string.strip, string.split(prop_value, ','))
@@ -360,7 +365,10 @@ class LDAPUserManager( SimpleItem, LDAPShared ):
connection = self._connect()
try:
- connection.modify_s(user_dn, mod_list)
+ if async:
+ connection.modify(user_dn, mod_list)
+ else:
+ connection.modify_s(user_dn, mod_list)
except:
self._disconnect(connection)
raise