lots of work on the authserver... tho mostly proof of concept
[ga4php.git] / authserver / authuser.php
index bf6ca8c..f6ff83c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
- * radverify.php
+ * 
  * 
  * This file is designed as a "script" extension to freeradius (or some such tool) for radius authentication.
  * Also provided is a simple web interface for managing users in freeradius.
@@ -9,4 +9,25 @@
  * 
  */
 
+require_once("lib/authClient.php");
+
+$myAC = new GAAuthClient();
+
+if(!isset($argv[1])) {
+       echo "Usage: ".$argv[0]." add|auth username passcode\n";
+       return 0;       
+}
+
+switch($argv[1]) {
+       case "auth":
+               if($myAC->authUser($argv[2], $argv[3])==1) {
+                       echo "Pass!";
+               } else {
+                       echo "Fail!";
+               }
+               break;
+       case "add":
+               $myAC->addUser($argv[2]);
+               break;
+}
 ?>
\ No newline at end of file