X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=authserver%2Fwww%2Fadmin_actions.php;h=e5ddb115ba385ee830b0568c45f69d3781796578;hp=bddbc55ddf6adc0392a7428ccde751ec8126ac38;hb=d4590a3f34021216c9da29786922fddaf804d113;hpb=1438f7f5c47f3f5c55bc8e13aa566530840e0310 diff --git a/authserver/www/admin_actions.php b/authserver/www/admin_actions.php index bddbc55..e5ddb11 100644 --- a/authserver/www/admin_actions.php +++ b/authserver/www/admin_actions.php @@ -10,6 +10,34 @@ else $loggedin = false; if(isset($_REQUEST["action"])) { switch($_REQUEST["action"]) { + case "recreatehotptoken": + $username = $_REQUEST["username"]; + $myAC->addUser($username, "HOTP"); + header("Location: ?message=".urlencode("seemed to work?")); + break; + case "recreatetotptoken": + $username = $_REQUEST["username"]; + $myAC->addUser($username, "TOTP"); + header("Location: ?message=".urlencode("seemed to work?")); + break; + case "deletetoken": + $username = $_REQUEST["username"]; + $myAC->deleteUserToken($username); + header("Location: ?message=".urlencode("seemed to work?")); + break; + case "edituser": + $username = $_REQUEST["username"]; + if($_REQUEST["original_real"] != $_REQUEST["realname"]) { + $myAC->setUserRealName($username, $_REQUEST["realname"]); + } + if($_REQUEST["password"] != "") { + if($_REQUEST["password"]!=$_REQUEST["password_conf"]) { + header("Location: ?message=confirmfalse"); + } else { + $myAC->setUserPass($username, $_REQUEST["password"]); + } + } + break; case "login": $username = $_REQUEST["username"]; $password = $_REQUEST["password"]; @@ -19,7 +47,7 @@ if(isset($_REQUEST["action"])) { $_SESSION["username"] = $username; header("Location: admin.php"); } else { - header("Location: admin.php?message=loginfail"); + header("Location: admin.php?error=".urlencode("Login Failed")); } exit(0);