self.auth=Auth()
gid=authinfo.get_gid_object()
+ self.ldapdictlist = ['type',
+ 'pkey',
+ 'uid',
+ 'serial',
+ 'authority',
+ 'peer_authority',
+ 'pointer' ,
+ 'hrn']
def ldapFind(self, record_filter = None, columns=None):
rindex=self.ldapserv.search("ou=people,dc=senslab,dc=info",ldap.SCOPE_SUBTREE,ldapfilter, ['mail','givenName', 'sn', 'uid','sshPublicKey'])
ldapresponse=self.ldapserv.result(rindex,1)
for ldapentry in ldapresponse[1]:
- hrn=self.authname+"."+ldapentry[1]['uid'][0]
- uuid=create_uuid()
+ #print>>sys.stderr, " \r\n \t LDAP : ! mail ldapentry[1]['mail'][0] %s " %(ldapentry[1]['mail'][0])
+
+ tmpname = ldapentry[1]['uid'][0]
+
+ if ldapentry[1]['uid'][0] == "savakian":
+ tmpname = 'avakian'
+
+ hrn=self.authname+"."+ tmpname
+
+ tmpemail = ldapentry[1]['mail'][0]
+ if ldapentry[1]['mail'][0] == "unknown":
+ tmpemail = None
+# uuid=create_uuid()
- RSA_KEY_STRING=ldapentry[1]['sshPublicKey'][0]
+# RSA_KEY_STRING=ldapentry[1]['sshPublicKey'][0]
- pkey=convert_public_key(RSA_KEY_STRING)
+# pkey=convert_public_key(RSA_KEY_STRING)
- gid=self.senslabauth.create_gid("urn:publicid:IDN+"+self.authname+"+user+"+ldapentry[1]['uid'][0], uuid, pkey, CA=False)
+# gid=self.senslabauth.create_gid("urn:publicid:IDN+"+self.authname+"+user+"+ldapentry[1]['uid'][0], uuid, pkey, CA=False)
parent_hrn = get_authority(hrn)
parent_auth_info = self.senslabauth.get_auth_info(parent_hrn)
results.append( {
'type': 'user',
-# 'email': ldapentry[1]['mail'][0],
-# 'first_name': ldapentry[1]['givenName'][0],
-# 'last_name': ldapentry[1]['sn'][0],
+ 'pkey': ldapentry[1]['sshPublicKey'][0],
+ #'uid': ldapentry[1]['uid'][0],
+ 'uid': tmpname ,
+ 'email':tmpemail,
+ #'email': ldapentry[1]['mail'][0],
+ 'first_name': ldapentry[1]['givenName'][0],
+ 'last_name': ldapentry[1]['sn'][0],
# 'phone': 'none',
- 'gid': gid.save_to_string(),
'serial': 'none',
'authority': self.authname,
'peer_authority': '',
- 'pointer' : '',
+ 'pointer' : -1,
'hrn': hrn,
- 'date_created' : 'none',
- 'last_updated': 'none'
} )
return results