f6ff83cabef7ddb98b3b0dcebbf17a9f484377c7
[ga4php.git] / authserver / usercmd.php
1 <?php
2 /*
3  * 
4  * 
5  * This file is designed as a "script" extension to freeradius (or some such tool) for radius authentication.
6  * Also provided is a simple web interface for managing users in freeradius.
7  * 
8  * The simple web interface should also provide a mechanism for configuring freeradius itself
9  * 
10  */
11
12 require_once("lib/authClient.php");
13
14 $myAC = new GAAuthClient();
15
16 if(!isset($argv[1])) {
17         echo "Usage: ".$argv[0]." add|auth username passcode\n";
18         return 0;       
19 }
20
21 switch($argv[1]) {
22         case "auth":
23                 if($myAC->authUser($argv[2], $argv[3])==1) {
24                         echo "Pass!";
25                 } else {
26                         echo "Fail!";
27                 }
28                 break;
29         case "add":
30                 $myAC->addUser($argv[2]);
31                 break;
32 }
33 ?>