Browse Source

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

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

+ 1
- 1
UserAd_class.py View File

@ -40,7 +40,7 @@ class UserAd:
expression = "(&(objectCategory=person)(objectClass=user)(sAMAccountName=%s))" % self.usrName
res = self.sam.search(base=base, expression=expression, attrs=['memberOf'])
groups = []
if len(res) == 0:
if len(res[0]) == 0:
return groups
for k in res[0]['memberOf']:
groups.append(str(k).split(',')[0].split('=')[1])


Loading…
Cancel
Save

Powered by TurnKey Linux.