|
32 |
|
32 |
|
33 |
import ldap |
33 |
import ldap |
34 |
import ldap.schema |
34 |
import ldap.schema |
|
|
35 |
import ldap.dn |
35 |
import univention.debug |
36 |
import univention.debug |
36 |
from univention.config_registry import ConfigRegistry |
37 |
from univention.config_registry import ConfigRegistry |
37 |
from ldapurl import LDAPUrl |
38 |
from ldapurl import LDAPUrl |
Lines 43-64
def _extend_uniq(list1, list2):
|
Link Here
|
---|
|
43 |
list1.append(item) |
44 |
list1.append(item) |
44 |
|
45 |
|
45 |
def parentDn(dn, base=''): |
46 |
def parentDn(dn, base=''): |
46 |
_d=univention.debug.function('uldap.parentDn dn=%s base=%s' % (dn, base)) |
47 |
univention.debug.function('uldap.parentDn dn=%s base=%s' % (dn, base)) |
47 |
if dn == base: |
48 |
if dn == base: |
48 |
return None |
49 |
return |
49 |
pos=dn.find(',')+1 |
50 |
dn = ldap.dn.str2dn(dn) |
50 |
if pos == 0: |
51 |
return ldap.dn.dn2str(dn[1:]) |
51 |
return None |
|
|
52 |
return dn[pos:] |
53 |
|
52 |
|
54 |
def explodeDn(dn, notypes=0): |
53 |
def explodeDn(dn, notypes=0): |
55 |
if not dn: |
54 |
return ldap.dn.explode_dn(dn, notypes) |
56 |
return [] |
|
|
57 |
|
58 |
exploded_dn=dn.split(',') |
59 |
if notypes: |
60 |
return map(lambda(x): x[x.find('=')+1:], exploded_dn) |
61 |
return exploded_dn |
62 |
|
55 |
|
63 |
def getAdminConnection(start_tls=2, decode_ignorelist=[], reconnect=True): |
56 |
def getAdminConnection(start_tls=2, decode_ignorelist=[], reconnect=True): |
64 |
ucr = ConfigRegistry() |
57 |
ucr = ConfigRegistry() |