Browse Source

мелкие изменения, тестирую.

master
Mikhail Grebenkin 6 years ago
parent
commit
c5c7f24c4a
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      UserAd_class.py

+ 4
- 3
UserAd_class.py View File

@ -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


Loading…
Cancel
Save

Powered by TurnKey Linux.