Skip to content

Commit

Permalink
support for ldap whoami() operation
Browse files Browse the repository at this point in the history
  • Loading branch information
Root committed Oct 5, 2010
1 parent 7dad23b commit e50daab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ldapconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@ def modrdn(l, dn, newrdn):
def passwd(l, dn, oldpw, newpw):
ldebug("Changing password for %s" % dn)
l.passwd_s(dn, oldpw, newpw)

@with_ldap_connection
def whoami(l):
return l.whoami_s()
4 changes: 4 additions & 0 deletions ldapobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def tuple_to_dn(t):
ldap.dn.escape_dn_chars(val))
for (attr,val) in t)

def whoami():
return lc.whoami()


class LDAPClass(type):
'''Classes which are mapped to LDAP. LDAPClass is used as a metaclass for
LDAP-mapped classes. So, a class User might subclass LDAPObject and would
Expand Down

0 comments on commit e50daab

Please sign in to comment.