Well, is there a standard way like what comes first or second?
I read on the old forums that either Update Record server behavior or Send Email server behavior comes first. I can't remember which one but, I did rearrange it and nothing changed.
It no longer lists in my account history but, I think at this stage, I have no more support tickets available for Security Assist.
Here's my code below
<?php require_once('Connections/nysxreg.php');?>
<?php require_once("WA_SecurityAssist/WA_RandomPassword.php"); ?>
<?php require_once("WA_SecurityAssist/WA_SHA1Encryption.php"); ?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" );?>
<?php
if (!session_id()) session_start();
if (isset($_POST["Send_x"])) {
$_SESSION["newpw"] = "".WA_RandomPassword(8, false, true, true, "") ."";
}
?>
<?php
// WA Application Builder Update
if (isset($_POST["Send_x"])) // Trigger
{
$WA_connection = $nysxreg;
$WA_table = "organizations";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "OrgEmail";
$WA_fieldNamesStr = "OrgPassword";
$WA_fieldValuesStr = "".WA_SHA1Encryption(WA_RandomPassword(8, false, true, true, "")) ."";
$WA_columnTypesStr = "',none,''";
$WA_comparisonStr = "=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_where_fieldValuesStr = "".((isset($_POST["emailAddress"]))?$_POST["emailAddress"]:"") ."";
$WA_where_columnTypesStr = "',none,''";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode("|", $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);
$WA_connectionDB = $database_nysxreg;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons );
$WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
<?php
function WA_SecurityAssist_Email_1_SendMail($WA_Auth_Parameter){
$WA_MailObject = WA_SecurityAssist_Definition("mail.mydomain.net","25","myname@mydomain.com","New York Shock Exchange","","");
$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
?>
<?php
if(isset($_POST["Send_x"])){
//WA SecurityAssist Email object="Mail for Linux"
$WA_Auth_Parameter = array(
"connection" => $nysxreg,
"database" => $database_nysxreg,
"tableName" => "organizations",
"filterColumn" => "OrgEmail",
"columnValue" => "".((isset($_POST["emailAddress"]))?$_POST["emailAddress"]:"") ."",
"columnType" => "text",
"usernameColumn" => "OrgAAUCode",
"passwordColumn" => "OrgPassword",
"selectColumns" => array("OrgName"),
"sessionVariables" => array("newpw"),
"successRedirect" => "login.php",
"failRedirect" => "emailpw.php",
"keepQueryString" => TRUE,
"toAddressColumn" => "OrgEmail",
"fromAddress" => "myname@mydomain.com",
"fromAddressDisplay" => "NYSX Online Registration",
"subject" => "Online Registration Info",
"mailBody" => "Hello [OrgName],\r\nYou're receiving this e-mail because you requested a password reset for your user account.\r\nYour new password is:\r\nPassword: [Session.newpw]\r\nPlease login using your AAU Code and new password.\r\nThanks for using our site!",
"emailFunction" => "WA_SecurityAssist_Email_1_SendMail"
);
WA_Auth_ForgotPassword($WA_Auth_Parameter);
}
?>