close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Email PW not sending and I'm not a newbie

Thread began 3/01/2009 4:59 pm by ejhart7196405 | Last modified 6/03/2009 4:06 pm by karen.marley367377 | 3464 views | 10 replies |

ejhart7196405

Email PW not sending and I'm not a newbie

I've been using Security Assist for a couple of years now but, this is the first time I've had a problem where I just can't figure out why it won't send.

I follow the solution recipe each time so that I know I'm doing it correctly. It redirects as if it was successful but, I never get an email. I was searching the forums last night for anything new I might be missing but, of course their gone now.

So can someone go down a list of reasons why this may be happening?

Ok, now it's sending but, the random generated password sent isn't working

Sign in to reply to this post

ejhart7196405

Now it sends but, password doesn't work

Ok, now it's sending but, the random generated password sent isn't working.

Sign in to reply to this post

Ray BorduinWebAssist

It could be a problem with the position of the code on the page. It is difficult to say without looking at it, but the random password is generated with two essential chunks of code... an include file that contains the function that actually generates the password, and a line of code on the page that calls that function and usually stores it as a session variable to be used later.

If it isn't working, one of those two things is out of place or referenced improperly. If you continue to have problems, post a support incident... this will give you an opportunity to share your files and webassist can debug them directly to determine the precise problem.

Sign in to reply to this post

ejhart7196405

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);
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

There are no longer limits on support tickets, so you have unlimited available for all of your products.

It doesn't really matter which goes first, as long as the first one does not specify a redirect page.... so the order you have should work since the update is before the email and has a blank redirect setting.

It really appears this page should work. What is the result you are having? The email gets sent but the password is not updated?

Is it updated in the email and not in the database? or is it updated in the database and not in the email?

Sign in to reply to this post

ejhart7196405

Well, I get sent a new password by email. So that is working.

When I use the password, it does not work. Neither does the old one though. So I'm thinking it is being updated in the database.

I looked at an old support ticket from when I first started using SA and I saw where I had made the characters in the db table for encrypted passwords too short (varchar(8) changed to varchar(50) per support instructions).

So I checked that and, just as I thought, I copy those db table specifications from website to website so that I don't come across that issue again.

So if it's being updated in the database and sent to me by email, could the issue be with the login page? I didn't have a problem with that until I started testing the EmailPW page.

Sign in to reply to this post

Ray BorduinWebAssist

Sounds like a problem on the login page. Maybe you aren't encrypting the entered password before comparing it to the database entry.

Sign in to reply to this post

ejhart7196405

Cool, now I have somewhere else I can check for the problem when I get home. Before, I had run out of the usual suspects. Thanks for reasoning that out for me. If possible, I do like to kind of figure it out on my own so that I can learn. So this little brainstorming session did help out a great deal. I'll try to make sure I come back and let everyone know what the deal was so it will help someone else later on.

Thanks

Sign in to reply to this post

ejhart7196405

Solution

Ok, I found that it wasn't the login page.

This line:
$WA_fieldValuesStr = "".WA_SHA1Encryption(WA_RandomPassword(8, false, true, true, "")) ."";

Should be this:
$WA_fieldValuesStr = "".WA_SHA1Encryption($_SESSION['newpw']) ."";

Although I don't remember doing it, I must have been clicking on 'Random Password' instead of the actual session for the random password.

Sign in to reply to this post

Ray BorduinWebAssist

That makes sense... so you were updating the database with one random password and sending an email with another. I didn't think about that possibility but it makes sense now considering the results you were experiencing.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...