if (filter_var($_POST['account'], FILTER_VALIDATE_EMAIL) && EmailExists($_POST['account'])) { $reset_password_success = Reset_Password($_POST['password'], $_POST['account']); if ($reset_password_success == true) { $_SESSION['current_status'] = "passwordresetsuccessfully"; } else { $_SESSION['current_status'] = "couldnotresetpassword"; } } else { $_SESSION['current_status'] = "passwordresetinvalid"; } } else { $_SESSION['current_status'] = "newpasswordblank"; } header('Location: ./'); } elseif (isset($_GET['accountsettings'])) { if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) && ($_POST['email'] == Get_User_Email($current_user) || !EmailExists($_POST['email']))) { $public_name = isset($_POST['publicname']) && $_POST['publicname'] != "" ? $_POST['publicname'] : "Someone"; if (query("UPDATE `users` SET `email`='" . $_POST['email'] . "', `public_name`='" . htmlspecialchars($public_name, ENT_QUOTES) . "', `allow_email`=" . ($_POST['allowemails'] != "on" ? 0 : 1) . " WHERE `id`=" . $current_user . ";")) { $_SESSION['current_status'] = "accountsettingsupdated"; } else { $_SESSION['current_status'] = "couldnotupdatesettings"; } } else { $_SESSION['current_status'] = "accountsettingsinvalid"; } header('Location: ./'); } elseif (isset($_GET['loggedout']) && $current_user <= 0) { $notificationMessage = "You have been successfully logged out.<br>You will only be able to use the dictionary saved to your browser."; } elseif ($current_user > 0) { if ($notificationMessage != "") { $notificationMessage = "Welcome back, " . Get_Public_Name_By_Id($current_user) . "!<br>" . $notificationMessage;
<?php // require_once("../required.php"); require_once 'config.php'; require_once SITE_LOCATION . '/php/functions.php'; $email = htmlspecialchars($_GET['email']); if (EmailExists($email)) { echo "email exists"; } else { echo "bad email"; }