Esempio n. 1
0
                displayPasswordForm("tech_diff");
            }
        } else {
            displayPasswordForm("fail");
        }
    } elseif (!empty($_POST["fname"]) && !empty($_POST["lname"]) && !empty($_POST["duedate"]) && !empty($_POST["status"]) && !empty($_POST["address"]) && !empty($_POST["city"]) && !empty($_POST["state"]) && !empty($_POST["zip"]) && !empty($_POST["phone"]) && !empty($_POST["email"]) && !empty($_POST["emergency_fname"]) && !empty($_POST["emergency_lname"]) && !empty($_POST["emergency_phone"]) && !empty($_POST["emergency_relationship"]) && $_POST["automatedPasswordReset"] == TRUE) {
        $accountInfoStatus = FALSE;
        if (verifyEmail(trim($_POST["email"]))) {
            if (submitAccountInformation($_POST["fname"], $_POST["lname"], $_POST["duedate"], $_POST["status"], $_POST["address"], $_POST["city"], $_POST["state"], $_POST["zip"], preg_replace("/[^0-9]/", "", $_POST["phone"]), $_POST["email"], $_POST["notes"], $_POST["adminnotes"], $_POST["buttonMemberID"]) && submitEmergencyContactInformation($_POST["emergency_fname"], $_POST["emergency_lname"], preg_replace("/[^0-9]/", "", $_POST["emergency_phone"]), $_POST["emergency_relationship"], $_POST["buttonMemberID"])) {
                displayAccountForm("success", $us_state_abbrevs, $relationships);
                $accountInfoStatus = TRUE;
            } else {
                displayAccountForm("tech_diff", $us_state_abbrevs, $relationships);
            }
            if ($accountInfoStatus) {
                if (automatedPasswordReset()) {
                    displayPasswordForm("success_automated");
                } else {
                    displayPasswordForm("tech_diff_automated");
                }
            } else {
                displayPasswordForm("verify_account_info");
            }
        } else {
            displayAccountForm("fail", $us_state_abbrevs, $relationships);
        }
    }
}
// Create dropdown of states with user's state pre-selected
function createStateAbbrevOptions($us_state_abbrevs, $memberState)
{
include "../databaseInfo.php";
if (empty($_POST["submit"]) && empty($_POST["g-recaptcha-response"]) && empty($_POST["username"])) {
    displayForm("");
}
if (!empty($_POST["submit"]) && (empty($_POST["g-recaptcha-response"]) || empty($_POST["username"]))) {
    displayForm("incomplete");
} elseif (!empty($_POST["submit"]) && !empty($_POST["g-recaptcha-response"]) && !empty($_POST["username"])) {
    if (isValid($_POST["g-recaptcha-response"])) {
        if (checkExistence(trim($_POST["username"])) == admin) {
            if (automatedPasswordReset(trim($_POST["username"]), "admin")) {
                displayForm("success");
            } else {
                displayForm("tech_diff");
            }
        } elseif (checkExistence(trim($_POST["username"])) == member) {
            if (automatedPasswordReset(trim($_POST["username"]), "member")) {
                displayForm("success");
            } else {
                displayForm("tech_diff");
            }
        } else {
            displayForm("nonexistant");
        }
    } else {
        displayForm("verfication_prob");
    }
}
function isValid($captcha)
{
    $secret = "6LfnWRgTAAAAAOjb5kqADRu_BPY-Ez7KLZwlF7mH";
    $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $secret . '&response=' . $captcha);