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);
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":
$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;
}