Email Password - add fields besides email?
My "Email Password" page is now working great - except that I have a problem with multiple registered users who use the same email address (families with a shared email address, for example). They get the first user ID / password in the database with that email address instead of the specific one that actually applies to the particular individual.
Unfortunately, changing the membership rules to require unique email addresses is out of the question so I have to change my password request form to include both last name and first name in addition to email address.
I've added the new fields to the form (see code below) and should be able to add the info to the email body text but can anyone please tell me how to add the extra fields to SecurityAssist's search/filter code? Is the code adaptable to this additional requirement?
Below is the relevant code (with generic replacements for site-specific identifiers). The site is hosted on bluehost.com (Linux, MySQL 5.0, PHP 5.2).
Thank you,
J.
<?php require_once('../Connections/connSAMPLE1.php');?>
<?php require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
function WA_SecurityAssist_Email_1_SendMail($WA_Auth_Parame ter){
$WA_MailObject = WA_SecurityAssist_Definition("mail.testcase.org"," 25","SAMPLE@testcase.org@ymail.testcase.org","","" ,"");
$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" => $connSAMPLE1,
"database" => $database_connSAMPLE1,
"tableName" => "Equipment",
"filterColumn" => "Email_Address",
"columnValue" => "".((isset($_POST["emailAddress"]))?$_POST["emailAddress"]:"") ."",
"columnType" => "text",
"usernameColumn" => "Member_ID",
"passwordColumn" => "userP",
"selectColumns" => array(""),
"sessionVariables" => array(""),
"successRedirect" => "SAMPLE_LogIn.php",
"failRedirect" => "SAMPLE_EmailPW.php",
"keepQueryString" => TRUE,
"toAddressColumn" => "Email_Address",
"fromAddress" => "SAMPLE@testcase.org",
"fromAddressDisplay" => "SAMPLE Association ",
"subject" => "SAMPLE Password Request",
"mailBody" => "User name: [Member_ID]\nPassword: [userP]",
"emailFunction" => "WA_SecurityAssist_Email_1_SendMail"
);
WA_Auth_ForgotPassword($WA_Auth_Parameter);
}
?>
AND HERE IS THE REVISED EMAIL PASSWORD REQUEST FORM:
<div id="ForgotPWContainer" class="WAATK">
<form action="SAMPLE_EmailPW.php" method="post" name="WAATKForgotPWForm" id="WAATKForgotPWForm">
<h1> </h1>
<table class="WAATKDataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th>Email:</th>
<td><input type="text" name="emailAddress" /></td>
</tr>
<tr>
<th>First Name:</th>
<td><input type="text" name="First_Name" id="First_Name" /></td>
</tr>
<tr>
<th height="32">Last Name:</th>
<td><input type="text" name="Last_Name" id="Last_Name" /></td>
</tr>
</table>
<div class="WAATKButtonRow">
<p>
<input type="image" hspace="0" vspace="0" border="0" name="Send" id="Send" value="Send" alt="Send" src="../WA_SecurityAssist/images/Slate/Refined_send.gif" />