f401e1db247b3e884ed1c5559421af7384d54ce0
[ga4php.git] / gaas / lib / gaasClientMessages.php
1 <?php
2
3 // thie file defines the messages sent too and from the gaas client.
4 function gaasStatus_clientsend($params)
5 {
6         return $params[0];
7 }
8
9 function gaasStatus_clientrecv($params)
10 {
11         print_r($params);
12         echo "Server status is $params\n";
13 }
14
15
16 // INIT server message
17 // params are:
18 // AD: "AD", "user", "pass", "domain", "client def", "admin def"
19 // IN: "IN", "user", "pass"
20 function gaasInitServer_clientsend($params)
21 {
22         $msg["backend"] = $params[0];
23         $msg["user"] = $params[1];
24         $msg["pass"] = $params[2];
25         if($msg["backend"] == "AD") {
26                 $msg["domain"] = $params[3];
27                 $msg["clientdef"] = $params[4];
28                 $msg["admindef"] = $params[4];
29         } else if($msg["backend"] == "IN") {
30                 // we dont do anything
31         } else {
32                 // invalid backend type
33                 return false;
34         }
35         
36         return $msg;
37 }
38
39 // pretty simple, it either works or doesnt, we just pass on the result
40 function gaasInitServer_clientrecv($params)
41 {
42         return $params;
43 }
44 ?>