Commit 9d9f783d authored by Lorenz Steinert's avatar Lorenz Steinert

now asking for displayName from the ldap

parent cee51228
......@@ -50,8 +50,8 @@ class fetch():
attributes=['memberUid']):
for i in conn.entries[0]['memberUid']:
if conn.search('ou=people,' + self.base,
'(uid='+i+')', attributes=['gecos']):
fsr_ += [self.clean_string(str(conn.entries[0]['gecos']))]
'(uid='+i+')', attributes=['displayName']):
fsr_ += [self.clean_string(str(conn.entries[0]['displayName']))]
fsr_.sort()
fsr_ = [" ".join(i.split(', ')[::-1]) for i in fsr_]
return fsr_
......@@ -72,8 +72,8 @@ class fetch():
attributes=['memberUid']):
for i in conn.entries[0]['memberUid']:
if conn.search('ou=people,' + self.base,
'(uid='+i+')', attributes=['gecos']):
fsr_extern_ += [self.clean_string(str(conn.entries[0]['gecos']))]
'(uid='+i+')', attributes=['displayName']):
fsr_extern_ += [self.clean_string(str(conn.entries[0]['displayName']))]
fsr_extern_.sort()
fsr_extern_ = [" ".join(i.split(', ')[::-1]) for i in fsr_extern_]
return fsr_extern_
......
......@@ -108,8 +108,8 @@ class Protokollskript:
conn = ldap.Connection(self.server)
conn.bind()
fil = "(uid="+current_user()+")"
if conn.search('ou=people,'+self.base, fil, attributes=['gecos']):
return self.clean_string(" ".join(str(conn.entries[0]['gecos']).split(", ")[::-1]))
if conn.search('ou=people,'+self.base, fil, attributes=['displayName']):
return self.clean_string(" ".join(str(conn.entries[0]['displayName']).split(", ")[::-1]))
return protokollant
except ldap.core.exceptions.LDAPException as error_message:
if self.opt['-d']:
......@@ -131,8 +131,8 @@ class Protokollskript:
attributes=['memberUid']):
for i in conn.entries[0]['memberUid']:
if conn.search('ou=people,' + self.base,
'(uid='+i+')', attributes=['gecos']):
fsr_ += [self.clean_string(str(conn.entries[0]['gecos']))]
'(uid='+i+')', attributes=['displayName']):
fsr_ += [self.clean_string(str(conn.entries[0]['displayName']))]
fsr_.sort()
fsr_ = [" ".join(i.split(', ')[::-1]) for i in fsr_]
return fsr_
......@@ -156,8 +156,8 @@ class Protokollskript:
attributes=['memberUid']):
for i in conn.entries[0]['memberUid']:
if conn.search('ou=people,' + self.base,
'(uid='+i+')', attributes=['gecos']):
fsr_extern_ += [self.clean_string(str(conn.entries[0]['gecos']))]
'(uid='+i+')', attributes=['displayName']):
fsr_extern_ += [self.clean_string(str(conn.entries[0]['displayName']))]
fsr_extern_.sort()
fsr_extern_ = [" ".join(i.split(', ')[::-1]) for i in fsr_extern_]
return fsr_extern_
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment