if ($myAC->authUserToken($argv[2], $argv[3]) == 1) { echo "Pass!\n"; } else { echo "Fail!\n"; } break; case "add": $return = $myAC->addUser($argv[2]); if ($return) { echo "Created user, " . $argv[2] . "\n"; } else { echo "Failed to create user, " . $argv[2] . "\n"; } break; case "delete": $res = $myAC->deleteUser($argv[2]); if ($res) { echo "Deleted\n"; } else { echo "Failure?\n"; } break; case "authpass": $ret = $myAC->authUserPass($argv[2], $argv[3]); if ($ret) { echo "Authenticated\n"; } else { echo "Failed\n"; } break; case "setpass":
break; case "update": error_log("would update"); $err = print_r($_REQUEST, true); error_log("req: {$err}\n"); $username = $_REQUEST["username"]; if ($_REQUEST["realname"] != "") { $myAC->setUserRealName($username, $_REQUEST["realname"]); } if ($_REQUEST["password"] != "") { $myAC->setUserPass($username, $_REQUEST["password"]); } break; case "delete": $username = $_REQUEST["username"]; $myAC->deleteUser($username); break; case "deletepass": $username = $_REQUEST["username"]; $myAC->setUserPass($username, ""); break; case "getotkimg": $otk = $_REQUEST["otk"]; $username = $_REQUEST["username"]; error_log("requesting otk, {$otk}"); $otk_img = $myAC->getOtkPng($username, $otk); header("Content-type: image/png"); echo $otk_img; exit(0); break; }