Please see the release notes and apply update scripts if necessary.");
// check provided data
$valid_entry = FALSE;
$forgot_passcode = FALSE;
if ((isset($_POST["response_submit"])) && ($_POST["response_submit"] == "subject_id_passcode")) {
$last_initial = $_POST['last_initial'];
$first_initial = $_POST['first_initial'];
$dob_day = $_POST['dob_day'];
$dob = $_POST['dob_yr']."-".$_POST['dob_mo']."-".$_POST['dob_day'];
$passcode = $_POST['passcode'];
$post_error_msg = "";
$current_yr = date('Y');
$current_mo = date("n");
$current_day = date("j");
// was a first name provided?
if($error_fn = check_post($first_initial, "First Initial", "non-numeric", FALSE)) {
$post_error_msg = $post_error_msg . sprintf("
%s: %s
",LANGUAGE_TEXT_QUOTE_ERROR_MESSAGE,LANGUAGE_TEXT_ERROR_SUBID_FIRST_INITIAL);
}
else {
//if formatting was correct, use this to verify identity for security quesitons (e.g. form_security_questions_verify.php)
$_SESSION['security_first_initial'] = $first_initial;
}
// was a last name provided?
if($error_ln = check_post($last_initial, "Last Initial", "non-numeric", FALSE)) {
$post_error_msg = $post_error_msg . sprintf("%s: %s
",LANGUAGE_TEXT_QUOTE_ERROR_MESSAGE,LANGUAGE_TEXT_ERROR_SUBID_LAST_INITIAL);
}
else {
//if formatting was correct, use this to verify identity for security quesitons (e.g. form_security_questions_verify.php)
$_SESSION['security_last_initial'] = $last_initial;
}
//was dob provided?
if($error_dob = check_post($_POST['dob_yr'], "Birth Year", "int16", FALSE,(intval(date("Y"))-125),intval(date("Y")))) {
$post_error_msg = $post_error_msg . sprintf("%s: %s
",LANGUAGE_TEXT_QUOTE_ERROR_MESSAGE,LANGUAGE_TEXT_ERROR_SUBID_DOB);
}
else {
//if formatting was correct, use this to verify identity for security quesitons (e.g. form_security_questions_verify.php)
$_SESSION['security_dob'] = $dob;
}
//is it past this person's 17th birthday (for NYTD)? If not, do not allow login and post a message
if(!$error_dob) {
$error_age = ( (($current_yr - $_POST['dob_yr']) < 17) ||
((($current_yr - $_POST['dob_yr']) == 17) && ($current_mo < $_POST['dob_mo'])) ||
((($current_yr - $_POST['dob_yr']) == 17) && ($current_mo == $_POST['dob_mo']) && ($current_day < $_POST['dob_day'])) );
if($error_age)
$post_error_msg = $post_error_msg . sprintf("%s
",LANGUAGE_TEXT_ERROR_AGE_LT_17);
}
// was a passcode provided?
if($error_pc = check_post($passcode, "Passcode", "text", FALSE)) {
$post_error_msg = $post_error_msg . sprintf("%s: %s
%s
",LANGUAGE_TEXT_QUOTE_ERROR_MESSAGE,LANGUAGE_TEXT_ERROR_MISSING_PASSCODE,
LANGUAGE_TEXT_CHECK_BOX_IF_MISSING_PASSCODE);
}
if($error_fn || $error_ln || $error_dob || ($error_pc && !isset($_POST['forgot_passcode'])) ) {
print $post_error_msg;
printf("%s
",LANGUAGE_TEXT_ERROR_PLEASE_TRY_AGAIN);
$valid_entry = FALSE;
}
elseif($error_age) {
print $post_error_msg;
$valid_entry = FALSE;
}
else {
$valid_entry = TRUE;
}
if(isset($_POST['forgot_passcode'])) {
$forgot_passcode = TRUE;
}
}
?>