close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

enter multiple email for email lost password

Thread began 2/11/2010 9:27 am by bryan107833 | Last modified 2/17/2010 12:23 pm by Jason Byrnes | 3037 views | 14 replies |

bryan107833

enter multiple email for email lost password

I have created a page within my admin area with a button to email credentials to a new user once an account is set up. I want to add a check box to send a copy of the email to a specified second email address(an admin email as we are having some issues). I have tried many different ways in which to add this second email address to the Security assist email password behavior source code but can not get it to send to a second email. It continues to send to the main email but that is it. Can you tell me how to update the code to include a second email. Thank you. Bryan

Sign in to reply to this post

Jason ByrnesWebAssist

you would probably want the admin BCC'd. In the mail_PHP.php file, find the following:

php:
if (strpos($mailBCC, "@")) {
    $mailHeader .= "Bcc: ".$mailBCC."\r\n";
  }





and change it to:

php:
if (strpos($mailBCC, "@")) {
    $mailHeader .= "Bcc: ".$mailBCC."\r\n";
  }
$mailHeader .= "Bcc: youremail@host.com\r\n";





substitute "youremail@host.com" with a valid email address.

Sign in to reply to this post

bryan107833

This does not use mail.php

I have universal email but when using the "Security assist email password behavior " it does not use mail.php and that is why I think I am having an issue. Can you explain how to change the below code. thank you.

<?php require_once('../Connections/acadia_mh.php');?>
<?php require_once("../WA_SecurityAssist/WA_SHA1Encryption.php"); ?>
<?php require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
require_once("../WA_SecurityAssist/WA_RandomPassword.php");
?>
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php");
?>
<?php
if (!WA_Auth_RulePasses("Administrator")){
WA_Auth_RestrictAccess("../access_denied.php");
}
?>
<?php
if (!session_id()) session_start();
if(isset($_POST["Send_x"])) {
$_SESSION["NewPW"] = "".WA_RandomPassword(8, true, true, true, "") ."";
}?>
<?php
// WA Application Builder Update
if (isset($_POST["Send_x"])) // Trigger
{
$WA_connection = $acadia_mh;
$WA_table = "visitors";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "UserEmail";
$WA_fieldNamesStr = "UserPassword";
$WA_fieldValuesStr = "".WA_SHA1Encryption($_SESSION['NewPW']) ."";
$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_acadia_mh;
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.acadia-auctions.com ","587","webmaster@acadia-auctions.com","","","");
$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" => $acadia_mh,
"database" => $database_acadia_mh,
"tableName" => "visitors",
"filterColumn" => "UserEmail",
"columnValue" => "".((isset($_POST["emailAddress"]))?$_POST["emailAddress"]:"") ."",
"columnType" => "text",
"usernameColumn" => "UserUserName",
"passwordColumn" => "UserPassword",
"selectColumns" => array("UserFirstName","UserLastName"),
"sessionVariables" => array("NewPW"),
"successRedirect" => "credentials_sent.php",
"failRedirect" => "error.php",
"keepQueryString" => TRUE,
"toAddress" => "UserEmail",
"toAddress" => "bryan@squeakywheeladventures.org",
"fromAddress" => "info@acadia-auctions.com",
"fromAddressDisplay" => "Acadia Auto Auctions",
"subject" => "Your Acadia Auto Auction Website Account Information",
"mailBody" => "Dear [UserFirstName] [UserLastName],\n<BR>\n<BR>\nXXXXXXX",
"emailFunction" => "WA_SecurityAssist_Email_1_SendMail"
);

WA_Auth_ForgotPassword($WA_Auth_Parameter);
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

the mail functions for the SecurityAssist Email Password server behavior are defined in the WA_SecurityAssist/Mail_PHP.php file.

look in the WA_SecurityAssist/Helper_PHP.php. the second line is:
<?php require_once( "Mail_PHP.php" ); ?>

please make the change to the WA_SecurityAssist/Mail_PHP.php file I suggested in my previous response.

Sign in to reply to this post

bryan107833

Sorry, couple more things..The code you mentioned does not exactly match in my version (?) I guess of Security Assist. My code is:

if (strpos($mailBCC, "@")) {
$mailHeader .= preg_replace("/[\r\n]/", "", "Bcc: ".$mailBCC).$lineEnd;
}

Does this make a difference in what you sent?

Also, this is for trouble shooting as we are having a intermittent problem with users being send credentials and then them not working (I emailed with you last week about this and we did not find an answer). As you can see on the attached page, I have included a radio button to check if the administrator wants a copy emailed to them. Thus making it so that it is not always sent. Can we have this work instead of hard coding into the mail.php file? If not, does the above code I sent change your response at all. Thanks, Bryan

Attached Files
dealer_detail_082009_info.zip
Sign in to reply to this post

Jason ByrnesWebAssist

I think you are looking at the WA_UniversalEmail/Mail_PHP.php file.


Please make the change in the WA_SecurityAssist/Mail_PHP.php file.

Sign in to reply to this post

bryan107833

Yes, I am looking at the WA_SecurityAssist/Mail_PHP.php file and that is where I copied the code from. Bryan

Sign in to reply to this post

Jason ByrnesWebAssist

its really just a matter of adding
$mailHeader .= "Bcc: youremail@host.com\r\n";


after the if statement.

Sign in to reply to this post

bryan107833

So just ignore the "preg_replace"?

What about doing this on the page though so that I can bind the radio button? It does not seem as though I can bind this on the mail.php page? It is unfortunate that this does not work like universal email (even though I have universal email as well), since that would be much easier to work with. I tried adding another ""toAddressColumn" => "UserEmail"," but it just ignores it... Bryan

Sign in to reply to this post

bryan107833

Is it not possible to add a second email address to "toAddressColumn" => "UserEmail"? Or to add a Bcc: field on the main page? Bryan

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...