trying to figure out how to store data in AD
[ga4php.git] / gaas / gaasd / gaasclient.php
1 <?php
2
3 require_once("../lib/gaasdClient.php");
4
5 $myga = new GAASClient();
6
7 global $argv;
8
9 function usage()
10 {
11         global $argv;
12         echo "Usage: ".$argv[0]." command [options]\n";
13         echo "\nCommands:\n\tinit AD user password domain clientgroup admingroup\n";
14         echo "\tinit IN user password\n";
15         echo "\n";
16         exit(0);
17 }
18
19 if($argc < 1) {
20         usage();
21 }
22
23 switch($argv[1]) {
24         case "init":
25                 if($argv[2] == "AD") {
26                         if($argc < 7) usage();
27                 }
28                 $ret = $myga->MSG_INIT_SERVER("AD", $argv[3], $argv[4], $argv[5], $argv[6], $argv[7]);
29                 if($ret) {
30                         echo "initialising server succeeded\n";
31                 } else {
32                         echo "initialising server failed\n";
33                 }
34                 break;
35         default:
36                 echo "No such command, ".$argv[1]."\n";
37                 usage();
38                 
39 }
40
41 ?>