X-Git-Url: http://git.pjr.cc/?a=blobdiff_plain;f=gaas%2Flib%2FgaasClientMessages.php;h=332295adaa1db859360cb6bcdc2a2bf06099c1eb;hb=6ae20292cc7aa6a712b492de306613192733e756;hp=9b138a491820f4273890174803e619c5f24c9e1c;hpb=2acdbc5f052f24af5de2ab013a4fae5eeb1c3305;p=ga4php.git diff --git a/gaas/lib/gaasClientMessages.php b/gaas/lib/gaasClientMessages.php index 9b138a4..332295a 100644 --- a/gaas/lib/gaasClientMessages.php +++ b/gaas/lib/gaasClientMessages.php @@ -3,7 +3,7 @@ // thie file defines the messages sent too and from the gaas client. function gaasStatus_clientsend($params) { - return $params[0]; + return $params; } function gaasStatus_clientrecv($params) @@ -18,9 +18,6 @@ function gaasStatus_clientrecv($params) // IN: "IN", "user", "pass" function gaasInitServer_clientsend($params) { - echo "backend:\n"; - print_r($params); - echo "\n"; $msg["backend"] = $params[0]; $msg["user"] = $params[1]; $msg["pass"] = $params[2]; @@ -40,21 +37,62 @@ function gaasInitServer_clientsend($params) } // pretty simple, it either works or doesnt, we just pass on the result +// im leaving this function here as an example of how you deal +// with data coming back from the server but prior to returning +// to the client. if it just returns the data back to the client +// you doing have to define a recving function function gaasInitServer_clientrecv($params) { - echo "in recv, params\n"; - print_r($params); - echo "\n"; return $params; } function gaasSetADLogin_clientsend($params) { + $msg["domain"] = $params[2]; + $msg["user"] = $params[0]; + $msg["pass"] = $params[1]; + return $msg; +} + +function gaasSetClientGroup_clientsend($params) +{ + $msg["clientgroup"] = $params[0]; + return $msg; +} + +function gaasSetAdminGroup_clientsend($params) +{ + $msg["admingroup"] = $params[0]; + return $msg; } -function gaasSetADLogin_clientrecv($params) +function gaasProvisionUser_clientsend($params) { + $msg["username"] = $params[0]; + return $msg; +} + +function gaasGetUsers_clientsend($params) +{ + $msg["havetokens"] = false; + $msg["userpattern"] = ""; + $msg["group"] = "client"; + if(isset($params[0])) { + if($params[0] == "admin") { + $msg["group"] = "admin"; + } + } + if(isset($params[1])) { + $msg["userpattern"] = $params[1]; + } + if(isset($params[2])) { + if($params[2] == "yes") { + $msg["havetokens"] = true; + } + } + return $msg; } + ?> \ No newline at end of file