Skip to content
Snippets Groups Projects
Commit b02c75c6 authored by Imran Hussain's avatar Imran Hussain
Browse files

Update sucs iss ldap info for signup system

parent 43ea7d60
No related branches found
No related tags found
2 merge requests!70Tidy up branches (2/3),!69Tidy up branches (1/3)
Pipeline #
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
// lookup real names from sid's using campus ldap // lookup real names from sid's using campus ldap
function lookupSID($sid) function lookupSID($sid)
{ {
$ds = ldap_connect("ccs-suld1.swan.ac.uk"); $ds = ldap_connect("192.168.10.16");
$ldappw = file_get_contents("/etc/unildap.secret"); ldap_bind($ds);
$ldappw = trim($ldappw); $sr = ldap_search($ds, "ou=Active,ou=Resources,o=Swansea", "uid=" . $sid);
ldap_bind($ds, "cn=SUCS-BIND,ou=ServiceAccount,o=SWANUNI", $ldappw);
$sr = ldap_search($ds, "ou=students,ou=Swansea,o=swanuni", "uid=" . $sid);
$info = ldap_get_entries($ds, $sr); $info = ldap_get_entries($ds, $sr);
ldap_unbind($ds); ldap_unbind($ds);
return ucwords(strtolower($info[0]['givenname'][0] . " " . $info[0]['sn'][0])); return ucwords(strtolower($info[0]['givenName'][0] . " " . $info[0]['sn'][0]));
} }
// lookup addresses from postcodes using the university's website // lookup addresses from postcodes using the university's website
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment