summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/ipaldap.py
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2007-08-17 10:41:45 -0400
committerSimo Sorce <ssorce@redhat.com>2007-08-17 10:41:45 -0400
commit9238e3cb4af0b5ac490bb4b2f15d4d1b553e079c (patch)
tree31c881505d97c2eb01b5117287b1665b08bb4845 /ipa-server/ipaserver/ipaldap.py
parentd41db21a09b80968f22c2211bf6472fe95b34b3f (diff)
parent0ddf0699a5dd47c575a7e757f38819c8c74340f9 (diff)
downloadfreeipa.git-9238e3cb4af0b5ac490bb4b2f15d4d1b553e079c.tar.gz
freeipa.git-9238e3cb4af0b5ac490bb4b2f15d4d1b553e079c.tar.xz
freeipa.git-9238e3cb4af0b5ac490bb4b2f15d4d1b553e079c.zip
Merge with upstream
Diffstat (limited to 'ipa-server/ipaserver/ipaldap.py')
-rw-r--r--ipa-server/ipaserver/ipaldap.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/ipa-server/ipaserver/ipaldap.py b/ipa-server/ipaserver/ipaldap.py
index 08113b4c..936dd662 100644
--- a/ipa-server/ipaserver/ipaldap.py
+++ b/ipa-server/ipaserver/ipaldap.py
@@ -321,8 +321,28 @@ class IPAdmin(SimpleLDAPObject):
try:
self.set_option(ldap.OPT_SERVER_CONTROLS, sctrl)
self.modify_s(dn, modlist)
- except ldap.ALREADY_EXISTS:
- raise ldap.ALREADY_EXISTS
+ except ldap.LDAPError, e:
+ raise e
+ return "Success"
+
+ def inactivateEntry(self,dn,has_key):
+ """Rather than deleting entries we mark them as inactive.
+ has_key defines whether the entry already has nsAccountlock
+ set so we can determine which type of mod operation to run."""
+
+ sctrl = self.__get_server_controls__()
+ modlist=[]
+
+ if has_key == True:
+ operation = ldap.MOD_REPLACE
+ else:
+ operation = ldap.MOD_ADD
+
+ modlist.append((operation, "nsAccountlock", "true"))
+
+ try:
+ self.set_option(ldap.OPT_SERVER_CONTROLS, sctrl)
+ self.modify_s(dn, modlist)
except ldap.LDAPError, e:
raise e
return "Success"