diff --git a/lib/validationData.php b/lib/validationData.php index 6221e08ae971a160fddb081f83dfeee50de3188c..97f5efddc2f2c4606e6632e65de761c354bf8f94 100644 --- a/lib/validationData.php +++ b/lib/validationData.php @@ -1,12 +1,16 @@ <? // lookup real names from sid's useing campus ldap function lookupSID($sid) { - $ds=ldap_connect("nds-stud.swan.ac.uk"); - $sr=ldap_search($ds, "ou=Students,o=uws", "cn=".$sid); - $info = ldap_get_entries($ds, $sr); - ldap_unbind($ds); - return ucwords(strtolower($info[0]['givenname'][0]." ".$info[0]['sn'][0])); + $ds=ldap_connect("ccs-suld1.swan.ac.uk"); + $ldappw = file_get_contents("/etc/unildap.secret"); + $ldappw = trim($ldappw); + 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); + ldap_unbind($ds); + return ucwords(strtolower($info[0]['givenname'][0]." ".$info[0]['sn'][0])); } + // lookup addresses from postcodes useing the univeritys website function lookup_postcode($postcode = "") {