lots of little auth changes... going from proof of concept to real deal
[ga4php.git] / authserver / usercmd.php
diff --git a/authserver/usercmd.php b/authserver/usercmd.php
new file mode 100644 (file)
index 0000000..f6ff83c
--- /dev/null
@@ -0,0 +1,33 @@
+<?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.
+ * 
+ * The simple web interface should also provide a mechanism for configuring freeradius itself
+ * 
+ */
+
+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