3 // this part of the example is the part that processes user inputs from forms
4 function processInput() {
7 if(isset($_REQUEST["action"])) {
8 switch($_REQUEST["action"]) {
10 // "users_id" INTEGER PRIMARY KEY AUTOINCREMENT,"users_username" TEXT,"users_fullname" TEXT,"users_tokendata" TEXT
11 $username = $_REQUEST["username"];
12 $fullname = $_REQUEST["fullname"];
13 $password = sha1($_REQUEST["password"]);
14 $sql = "insert into users values (NULL, '$username', '$fullname', '$password','0')";
19 header("Location: index.php?success=created");
22 $username = $_REQUEST["user"];
23 $tokentype = $_REQUEST["tokentype"];
24 $myga->setUser($username, $tokentype);
26 header("Location: index.php?success=Provisioned");
29 $username = $_REQUEST["user"];
30 $tokencode = $_REQUEST["tokencode"];
32 if($myga->authenticateUser($username, $tokencode)) {
33 header("Location: index.php?success=Passed");
35 header("Location: index.php?failure=wrongcode");