|
|
@ -66,7 +66,8 @@ class UserAd: |
|
|
|
def set_passwd(self): |
|
|
|
self.sam.transaction_start() |
|
|
|
try: |
|
|
|
self.sam.setpassword("&(objectClass=user)(samAccountName=%s)" % ldb.binary_encode(self.usrName), self.usrPass, False) |
|
|
|
self.sam.setpassword("(&(objectClass=user)(samAccountName=%s))" % ldb.binary_encode(self.usrName), |
|
|
|
self.usrPass, False) |
|
|
|
except Exception as exc: |
|
|
|
self.sam.transaction_cancel() |
|
|
|
return exc |
|
|
@ -119,7 +120,7 @@ class UserAd: |
|
|
|
def disable(self): |
|
|
|
self.sam.transaction_start() |
|
|
|
try: |
|
|
|
self.sam.disable_account("&(objectClass=user)(samAccountName=%s)" % ldb.binary_encode(self.usrName)) |
|
|
|
self.sam.disable_account("(&(objectClass=user)(samAccountName=%s))" % ldb.binary_encode(self.usrName)) |
|
|
|
except Exception as exc: |
|
|
|
self.sam.transaction_cancel() |
|
|
|
return exc |
|
|
@ -129,7 +130,7 @@ class UserAd: |
|
|
|
def enable(self): |
|
|
|
self.sam.transaction_start() |
|
|
|
try: |
|
|
|
self.sam.enable_account("&(objectClass=user)(samAccountName=%s)" % ldb.binary_encode(self.usrName)) |
|
|
|
self.sam.enable_account("(&(objectClass=user)(samAccountName=%s))" % ldb.binary_encode(self.usrName)) |
|
|
|
except Exception as exc: |
|
|
|
self.sam.transaction_cancel() |
|
|
|
return exc |
|
|
|