From: paulr Date: Thu, 10 Feb 2011 03:00:16 +0000 (+1100) Subject: added new ad test X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=commitdiff_plain;h=c4ad8271df834f0d5f39cb58e8658195b59f30bd added new ad test --- diff --git a/gaas/lib/gaasdMessages.php b/gaas/lib/gaasdMessages.php index a74df01..c7b4f88 100644 --- a/gaas/lib/gaasdMessages.php +++ b/gaas/lib/gaasdMessages.php @@ -44,7 +44,18 @@ function gaasInitServer_server($msg) $adpass = $msg["pass"]; $adclientdef = $msg["clientdef"]; $adadmindef = $msg["admindef"]; + // now wee test our logins... + // first look up the domain name stuff + $servers = dns_get_record("_gc._tcp.$addom"); + if(count($servers)<1) { + echo "AD servers cant be found, fail!\n"; + } + + // we should check all servers, but lets just go with 0 for now + $cnt = ldap_connect($servers[0]["target"], $servers[0]["port"]); + ldap_bind($cnt, "$adlogin", "$adpass"); + // then