}
$i++;
}
- msg_send($cl_queue, GET_USERS, $users);
+ msg_send($cl_queue, MSG_GET_USERS, $users);
// TODO now set token
break;
}
}
-?>
\ No newline at end of file
+?>
--- /dev/null
+<?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);
+}
+?>
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);
}
}
-?>
\ No newline at end of file
+?>