<?php

require_once '../../Connections/bikes_db.php';
require_once "../../webassist/form_validations/wavt_scripts_php.php";
require_once "../../webassist/form_validations/wavt_validatedform_php.php";
require_once "../../webassist/security_assist/helper_php.php";
if (isset($_POST["ForgotPassword_submit"])) {
    $WAFV_Redirect = "" . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES) . "?invalid=true";
    $_SESSION['WAVT_forgotpassword_Errors'] = "";
    if ($WAFV_Redirect == "") {
        $WAFV_Redirect = $_SERVER["PHP_SELF"];
    }
    $WAFV_Errors = "";
    $WAFV_Errors .= WAValidateLE(strtolower(isset($_POST["Security_Code"]) ? $_POST["Security_Code"] : "") . "", (isset($_SESSION["captcha_Security_Code"]) ? strtolower($_SESSION["captcha_Security_Code"]) : "") . "", true, 1);
    $WAFV_Errors .= WAValidateLE(strtolower(isset($_POST["Security_Answer"]) ? $_POST["Security_Answer"] : "") . "", (isset($_SESSION["random_answer"]) ? strtolower($_SESSION["random_answer"]) : "") . "", true, 2);
    $WAFV_Errors .= WAValidateRX((isset($_POST["Hidden_Field"]) ? $_POST["Hidden_Field"] : "") . "", "/.* /", false, 3);
    if ($WAFV_Errors != "") {
        PostResult($WAFV_Redirect, $WAFV_Errors, "forgotpassword");
    }
}
function WA_SecurityAssist_Email_1_SendMail($WA_Auth_Parameter)
{
    $WA_MailObject = WA_SecurityAssist_Definition("", "", "", "", "", "");
    $WA_MailObject = WA_SecurityAssist_SendMail($WA_MailObject, "", "", "", $WA_Auth_Parameter["toAddress"], "", $WA_Auth_Parameter["fromAddress"], $WA_Auth_Parameter["subject"], $WA_Auth_Parameter["mailBody"]);
    $WA_MailObject = null;
}
// WA_SecurityAssist_Email_1_SendMail
if (isset($_POST["ForgotPassword_submit"])) {
    //WA SecurityAssist Email object="mail"
    $WA_Auth_Parameter = array("connection" => $bikes_db, "database" => $database_bikes_db, "tableName" => "pcms2_users", "filterColumn" => "UserEmail", "filterEncryption" => "", "columnValue" => "" . (isset($_POST["Forgot_Password_group_Email"]) ? $_POST["Forgot_Password_group_Email"] : "") . "", "columnType" => "text", "usernameColumn" => "UserFirstName", "usernameEncryption" => "", "passwordColumn" => "UserPassword", "passwordEncryption" => "", "selectColumns" => array("UserFirstName", "UserPassword", "UserEmail"), "sessionVariables" => array(""), "successRedirect" => "login.php?emailedPassword=1", "failRedirect" => "forgotpassword.php", "keepQueryString" => TRUE, "toAddressColumn" => "UserEmail", "toAddressEncryption" => "", "fromAddress" => "*****@*****.**", "fromAddressDisplay" => "Your Name", "subject" => "Forgotten Password", "mailBody" => "../../webassist/security_assist/email/forgotpassword_email.php", "emailFunction" => "WA_SecurityAssist_Email_1_SendMail");
    WA_Auth_ForgotPassword($WA_Auth_Parameter);
예제 #2
0
require_once "../../webassist/form_validations/wavt_scripts_php.php";
require_once "../../webassist/form_validations/wavt_validatedform_php.php";
require_once "../../webassist/security_assist/helper_php.php";
require_once "../../webassist/database_management/wa_appbuilder_php.php";
if (isset($_POST["UserUpdate_submit"])) {
    $WAFV_Redirect = "" . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES) . "?invalid=true";
    $_SESSION['WAVT_userupdate_Errors'] = "";
    if ($WAFV_Redirect == "") {
        $WAFV_Redirect = $_SERVER["PHP_SELF"];
    }
    $WAFV_Errors = "";
    $WAFV_Errors .= WAValidateRQ((isset($_POST["User_Update_group_Email"]) ? $_POST["User_Update_group_Email"] : "") . "", true, 1);
    $WAFV_Errors .= WAValidateUnique("bikes_db", $bikes_db, $database_bikes_db, "pcms2_users", "UserID", "none,none,NULL", "" . (isset($_SESSION["SecurityAssist_UserID"]) ? $_SESSION["SecurityAssist_UserID"] : "0") . "", "UserEmail", "',none,''", "" . (isset($_POST["User_Update_group_Email"]) ? $_POST["User_Update_group_Email"] : "") . "", true, 2);
    $WAFV_Errors .= WAValidateRQ((isset($_POST["User_Update_group_Password"]) ? $_POST["User_Update_group_Password"] : "") . "", true, 3);
    $WAFV_Errors .= WAValidateEL((isset($_POST["User_Update_group_Password"]) ? $_POST["User_Update_group_Password"] : "") . "", 6, 500, true, 4);
    $WAFV_Errors .= WAValidateLE((isset($_POST["User_Update_group_Confirm"]) ? $_POST["User_Update_group_Confirm"] : "") . "", (isset($_POST["User_Update_group_Confirm"]) ? $_POST["User_Update_group_Confirm"] : "") . "", true, 5);
    $WAFV_Errors .= WAValidateRQ((isset($_POST["User_Update_group_Username"]) ? $_POST["User_Update_group_Username"] : "") . "", true, 6);
    $WAFV_Errors .= WAValidateRQ((isset($_POST["User_Update_group_Last_Name"]) ? $_POST["User_Update_group_Last_Name"] : "") . "", true, 7);
    $WAFV_Errors .= WAValidateRQ((isset($_POST["User_Update_group_Address"]) ? $_POST["User_Update_group_Address"] : "") . "", true, 8);
    $WAFV_Errors .= WAValidateRQ((isset($_POST["User_Update_group_Address_2"]) ? $_POST["User_Update_group_Address_2"] : "") . "", true, 9);
    $WAFV_Errors .= WAValidateRQ((isset($_POST["User_Update_group_City"]) ? $_POST["User_Update_group_City"] : "") . "", true, 10);
    $WAFV_Errors .= WAValidateRQ((isset($_POST["User_Update_group_State"]) ? $_POST["User_Update_group_State"] : "") . "", true, 11);
    $WAFV_Errors .= WAValidateRQ((isset($_POST["User_Update_group_10_Postcode"]) ? $_POST["User_Update_group_10_Postcode"] : "") . "", true, 12);
    $WAFV_Errors .= WAValidateRQ((isset($_POST["User_Update_group_1_Fax"]) ? $_POST["User_Update_group_1_Fax"] : "") . "", true, 13);
    if ($WAFV_Errors != "") {
        PostResult($WAFV_Redirect, $WAFV_Errors, "userupdate");
    }
}
if (isset($_POST["UserUpdate_submit"]) && isset($_COOKIE["RememberMePWD"]) && isset($_POST["User_Update_group_Password"]) && $_POST["User_Update_group_Password"] != "") {
    setcookie("RememberMePWD", "" . (isset($_POST["User_Update_group_Password"]) ? $_POST["User_Update_group_Password"] : "") . "", time() + 60 * 60 * 24 * 30, "/", "", 0);
}