just trying to figure out how to create the db properly
authorpaulr <me@pjr.cc>
Sat, 4 Dec 2010 18:46:32 +0000 (05:46 +1100)
committerpaulr <me@pjr.cc>
Sat, 4 Dec 2010 18:46:32 +0000 (05:46 +1100)
authserver/authd/authd.php
authserver/create1000users.php [new file with mode: 0644]
authserver/lib/authClient.php
authserver/lib/lib.php

index e6a21b7..f4b366d 100644 (file)
@@ -215,7 +215,7 @@ if($pid == -1) {
                                        }
                                        $i++; 
                                }
-                               msg_send($cl_queue, GET_USERS, $users);
+                               msg_send($cl_queue, MSG_GET_USERS, $users);
                                
                                // TODO now set token 
                                break;
@@ -224,4 +224,4 @@ if($pid == -1) {
        }       
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/authserver/create1000users.php b/authserver/create1000users.php
new file mode 100644 (file)
index 0000000..0be09b9
--- /dev/null
@@ -0,0 +1,35 @@
+<?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();
+
+/*
+define("MSG_AUTH_USER_TOKEN", 1);
+define("MSG_ADD_USER_TOKEN", 2);
+define("MSG_DELETE_USER", 3);
+define("MSG_AUTH_USER_PASSWORD", 4);
+define("MSG_SET_USER_PASSWORD", 5);
+define("MSG_SET_USER_REALNAME", 6);
+define("MSG_SET_USER_TOKEN", 7);
+define("MSG_SET_USER_TOKEN_TYPE", 8);
+
+ */
+$prep = "created";
+if(isset($argv[1])) $prep = $argv[1];
+echo "Creating 10000 users using ".$argv[1]."\n";
+for($i=0; $i<10000; $i++) {
+       if(($i%100)==0) echo "up to, $i\n";
+       $username = "$prep$i";
+       $myAC->addUser($username);
+}
+?>
index a9e8da4..22a08b3 100644 (file)
@@ -163,7 +163,7 @@ class GAAuthClient {
                msg_send($sr_queue, MSG_GET_USERS, "", true, true, $msg_err);
                echo "message sent\n";
                
-               msg_receive($cl_queue, 0, $msg_type, 16384, $msg);
+               msg_receive($cl_queue, 0, $msg_type, 524288, $msg);
                echo "message received?\n";
                print_r($msg);
                
@@ -265,4 +265,4 @@ class GAAuthClient {
        }
 }
 
-?>
\ No newline at end of file
+?>
index 4ec2389..ef63d76 100644 (file)
@@ -118,4 +118,4 @@ class gaasGA extends GoogleAuthenticator {
        }       
 }
 
-?>
\ No newline at end of file
+?>