$post = ""; $response = ""; if (isset($_GET["action"])) { $action = $_GET["action"]; } $get = json_encode($_GET); $post = json_encode($_POST); $message = array(); if (isset($_GET["action"]) && $_GET["action"] == "login" && isset($_POST["username"]) && isset($_POST["password"])) { $message = checkLogin($conn, $_POST["username"], $_POST["password"], $passwordSalt); } else { if (isset($_GET["action"]) && $_GET["action"] == "register" && isset($_POST["username"]) && isset($_POST["password"]) && isset($_POST["firstname"]) && isset($_POST["lastname"]) && isset($_POST["email"]) && isset($_POST["terms"])) { $message = registerNewUser($conn, $_POST["username"], $_POST["password"], $_POST["firstname"], $_POST["lastname"], $_POST["email"], $_POST["terms"], $passwordSalt); } else { if (isset($_GET["action"]) && isset($_POST["code"]) && $_GET["action"] == "verification") { $message["message"] = verifyCode($conn, $_POST["code"], $verificationValid); if (stripos($message["message"], "success") !== false) { $message["status"] = "OK"; } else { $message["status"] = "Fail"; } } else { if (isset($_GET["token"]) && isset($_GET["action"])) { $userID = getUserFromToken($conn, $_GET["token"]); if ($userID != null) { $message["status"] = "OK"; switch ($_GET["action"]) { case "insert": $word = isset($_POST["word"]) ? $_POST["word"] : ""; $wordBase = isset($_POST["wordbase"]) ? $_POST["wordbase"] : ""; $translation = isset($_POST["translation"]) ? $_POST["translation"] : "";
<?php date_default_timezone_set('Europe/Helsinki'); require_once 'connect.php'; require_once 'credentials.php'; require_once 'helper/verificationhelper.php'; $message = ""; if (isset($_GET["code"])) { $message = verifyCode($conn, $_GET["code"], $verificationValid); } else { $message = "wrong arguments"; } mysqli_close($conn); ?> <!DOCTYPE html> <html> <head> <!-- Standard Meta --> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <!-- Site Properities --> <title>Registeration Verification</title> <link rel="stylesheet" type="text/css" href="dist/semantic.css"> <script src="assets/library/jquery.min.js"></script> <script src="dist/components/form.js"></script> <script src="dist/components/transition.js"></script> <style type="text/css">
//avoid spam $code = $_GET['code']; function verifyCode() { global $code; $db = new PDO('sqlite:database.db'); $stmt = $db->prepare('SELECT * FROM recovery WHERE code=?'); $stmt->execute(array($code)); $result = $stmt->fetchAll(); if (count($result) == 0) { header("main.php"); } else { return $result[0]['user_id']; } } $id = verifyCode(); if ($id == 0) { echo "<script type='text/javascript'>alert('Code is not valid. Returning to main page.');window.location.href = 'main.php';</script>"; } ?> <!DOCTYPE HTML> <html> <head> <title>Recover Password</title> <meta charset="utf-8"> <link rel="stylesheet" href="css/myStyle.css"> <?php meta_includes(); ?>
function uniqueCode($numcharacters, $withrepeated, $table, $field) { $code = getCode($numcharacters, $withrepeated); while (verifyCode($code, $table, $field)) { $code = getCode(11, 1); } return $code; }
$errmsg = sprintf(_("Registry module not defined for %s domain extension"), $v); } } catch (Exception $e) { $errmsg = $e->getMessage(); } if ($Registry) { $allow = (int) $Registry->GetManifest()->GetSectionConfig()->domain->transfer->allow_bulk_transfer; } if ($allow) { array_push($display["transferTLDs"], $v); } } $display["num_TLDs"] = count($display["transferTLDs"]); } elseif ($stepno == 2) { } elseif ($stepno == 3) { $_SESSION["JS_SESSIONID"] = $display["JS_SESSIONID"] = verifyCode(); require_once SRC_PATH . "/LibWebta/library/Data/JSON/JSON.php"; $json = new Services_JSON(); $tld = $_SESSION["BT_TLD"]; $domains = array(); foreach ($domain_names as $domainname) { $domains[] = "{$domainname}.{$tld}"; } $display['domains'] = $json->encode($domains); } elseif ($stepno == 4) { $display["res_ok"] = $res_ok; $display["res_fail"] = $res_fail; $display["BT_TLD"] = $_SESSION["BT_TLD"]; } $display["stepno"] = $stepno; $template_name = "client/bulk_transfer_step{$stepno}";