From c4ad8271df834f0d5f39cb58e8658195b59f30bd Mon Sep 17 00:00:00 2001 From: paulr Date: Thu, 10 Feb 2011 14:00:16 +1100 Subject: [PATCH] added new ad test --- gaas/lib/gaasdMessages.php | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) 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 -- 1.7.0.4