From: paulr Date: Fri, 11 Feb 2011 16:09:05 +0000 (+1100) Subject: added some more messages to the client/server comms X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=71ffa4aa2e826dea91c533616a97ac49f3d158fd;p=ga4php.git added some more messages to the client/server comms --- diff --git a/example/adsearchtest/usersearch.php b/example/adsearchtest/usersearch.php index a433d01..617830a 100644 --- a/example/adsearchtest/usersearch.php +++ b/example/adsearchtest/usersearch.php @@ -18,6 +18,7 @@ echo count($servers)." AD servers returned, using ".$servers[0]["target"]."\n"; // we should check all servers, but lets just go with 0 for now $cnt = ldap_connect($servers[0]["target"], $servers[0]["port"]); +ldap_set_option($cnt, LDAP_OPT_PROTOCOL_VERSION, 3); echo "Connected\n"; $bind = ldap_bind($cnt, "$adlogin", "$adpass"); if($bind) { diff --git a/gaas/lib/gaasClientMessages.php b/gaas/lib/gaasClientMessages.php index d66bf08..d110ba2 100644 --- a/gaas/lib/gaasClientMessages.php +++ b/gaas/lib/gaasClientMessages.php @@ -69,6 +69,7 @@ function gaasSetAdminGroup_clientsend($params) function gaasProvisionUser_clientsend($params) { + $msg["username"] = $params[0]; return $msg; } diff --git a/gaas/lib/gaasdClient.php b/gaas/lib/gaasdClient.php index c8eb7ba..b39c544 100644 --- a/gaas/lib/gaasdClient.php +++ b/gaas/lib/gaasdClient.php @@ -87,7 +87,7 @@ class GAASClient { //echo "real function is $function_send, $function_recv\n"; if(function_exists($function_send)) { - $fromsend = $this->sendReceive($st_defined, $function_send($params))); + $fromsend = $this->sendReceive($st_defined, $function_send($params)); if(function_exists($function_recv)) { return $function_recv($fromsend); } else return $fromsend; diff --git a/gaas/lib/gaasdMessages.php b/gaas/lib/gaasdMessages.php index a9c6460..8c6e2da 100644 --- a/gaas/lib/gaasdMessages.php +++ b/gaas/lib/gaasdMessages.php @@ -11,8 +11,21 @@ function gaasStatus_server($messages) $return = "init"; if($initState != false && $backEnd != "") { $return = "running"; + $be = confGetVal("backend"); + if($be == "AD") { + $dom = confGetVal("ad.domain"); + $user = confGetVal("ad.user"); + $client = confGetVal("ad.clientdef"); + $admin = confGetVal("ad.admindef"); + $return .= " - AD integrated to $dom, GAASD Username: $user, Clients Group: $client, Admins Group: $admin"; + } else { + $return .= " - internal database"; + } + } + + return $return; } @@ -151,4 +164,14 @@ function gaasSetClientGroup_server($msg) return true; } +function gaasProvisionUser_server($msg) +{ + + // function userInGroup($user, $domain, $adlogin, $adpass, $group) + userInGroup($msg["username"], confGetVal("ad.domain"), confGetVal("ad.user", $adlogin), confGetVal("ad.pass"), confGetVal("ad.clientdef")); + + + return true; +} + ?> \ No newline at end of file diff --git a/gaas/lib/globalLib.php b/gaas/lib/globalLib.php index b628956..184be7f 100644 --- a/gaas/lib/globalLib.php +++ b/gaas/lib/globalLib.php @@ -5,7 +5,7 @@ $BASE_DIR = realpath(dirname(__FILE__)."/../../"); global $BASE_DIR; // the tcp port number we use for comms -$TCP_PORT_NUMBER = 21335; +$TCP_PORT_NUMBER = 21336; global $TCP_PORT_NUMBER;