delete("onetimekeys", ["expires[<]" => date("Y-m-d H:i:s")]); // cleanup if ($database->has("onetimekeys", ["key" => $VARS['code'], "expires[>]" => date("Y-m-d H:i:s")])) { $user = $database->get("onetimekeys", ["[>]accounts" => ["uid" => "uid"]], ["username", "realname", "accounts.uid"], ["key" => $VARS['code']]); exitWithJson(["status" => "OK", "user" => $user]); } else { sendJsonResp($Strings->get("no such code or code expired", false), "ERROR"); }