Exemple #1
0
     if ($ret) {
         echo "Authenticated\n";
     } else {
         echo "Failed\n";
     }
     break;
 case "setpass":
     $res = $myAC->setUserPass($argv[2], $argv[3]);
     if ($res) {
         echo "Password Set\n";
     } else {
         echo "Failure?\n";
     }
     break;
 case "setname":
     $ret = $myAC->setUserRealName($argv[2], $argv[3]);
     if ($ret) {
         echo "Real Name Set\n";
     } else {
         echo "Failure?\n";
     }
     break;
 case "settoken":
     $ret = $myAC->setUserToken($argv[2], $argv[3]);
     if ($ret) {
         echo "Token Set\n";
     } else {
         echo "Failure?\n";
     }
     break;
 case "settype":
Exemple #2
0
     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"];
     if ($myAC->authUserPass($username, $password)) {
         $_SESSION["loggedin"] = true;
         $_SESSION["username"] = $username;