renamed files
[ga4php.git] / authserver / www / admin_actions.php
similarity index 81%
rename from authserver/www/actions.php
rename to authserver/www/admin_actions.php
index 2d2ca9c..d6a224c 100644 (file)
@@ -17,9 +17,9 @@ if(isset($_REQUEST["action"])) {
                        if($myAC->authUserPass($username, $password)) {
                                $_SESSION["loggedin"] = true;
                                $_SESSION["username"] = $username;
-                               header("Location: index.php");
+                               header("Location: admin.php");
                        } else {
-                               header("Location: index.php?message=loginfail");
+                               header("Location: admin.php?message=loginfail");
                        }
                        
                        exit(0);
@@ -27,13 +27,13 @@ if(isset($_REQUEST["action"])) {
                case "logout":
                        $_SESSION["loggedin"] = false;
                        $_SESSION["username"] = "";
-                       header("Location: index.php");
+                       header("Location: admin.php");
                        exit(0);
                        break;
                case "createuser":
                        $username = $_REQUEST["username"];
                        $myAC->addUser($username);
-                       header("Location: index.php");
+                       header("Location: admin.php");
                        exit(0);
                        break;
                case "update":
@@ -56,11 +56,13 @@ if(isset($_REQUEST["action"])) {
                        $username = $_REQUEST["username"];
                        $myAC->setUserPass($username, "");
                        break;
-               case "getotk":
-                       $username = $_REQUEST["username"];
-                       $otk = $myAC->getOtkPng($username);
+               case "getotkimg":
+                       
+                       $otk = $_REQUEST["otk"];
+                       error_log("requesting otk, $otk");
+                       $otk_img = $myAC->getOtkPng($otk);
                        header("Content-type: image/png");
-                       echo $otk;
+                       echo $otk_img;
                        exit(0);
                        break;
        }