<% local msg = {} if _SESSION["logined"] ~= nil then if _POST["username"] ~= nil then admin = c_GetAdmin(_POST["username"]) if admin == nil then rawset(msg, "code", -2) rawset(msg, "error", "Admin does not exist") else if (_SESSION["admin_readonly"] ~= nil and _SESSION["admin_readonly"] == 1) or (_SESSION["admin_domainadmin"] ~= nil and _SESSION["admin_domainadmin"] == 1) then admin.password = "" admin.two_factor_code = "" end rawset(msg, "code", 0) rawset(msg, "data", admin) end else rawset(msg, "code", -2) rawset(msg, "error", "Admin does not exist") end else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") end print(json.encode(msg)) %>