Morph
|
| Posted: 08/24/2002, 8:08 AM |
|
I have been looking at the forgotten password coding (elswhere on this forum) and am somewhat stumped at the db calls.
Is the assumption that on ehas to make a new db (passemails) to hold all calls for forgotten passwords - if do where is the call to verify the existing pass taken into account as I cant find that part in the module coding!
So far i have no joy and was hoping to implement this neat trcik into a sitr.
Code Charge Studio 1.07
PHP - MySql
|
|
|
 |
Nicole
|
| Posted: 08/27/2002, 2:31 AM |
|
Morph,
I suggest you to create the forgotten password form similar to gotocode one. You can download it from. From your posting I see that it should suits you. http://www.codecharge.com/download/files/examples/gotocodev2.zip
I advice you to locate the code from CC Validation and Before Insert events in CCS form Before Insert event. You can also add send mail action for Befire Insert in order to let CCS generate send mail code. Then you can modify it the way you need.
And here is CCS code:
$db = new cslDBconnection_name();
global $form_name;
global $REMOTE_ADDR;
$db->query("SELECT * FROM users WHERE user_login=\"" . $form_name->ds->user_entry->Value . "\" OR user_email=\"" . $form_name->ds->user_entry->Value . "\"");
$db->next_record();
if ( $db->f("user_id") == "")
$form_name->Errors->AddError("\n". "Sorry. We could not find this Login or Email in our records.");
$to = $db->f("user_email");
$subject = "Re: Forgotten GotoCode.com Password";
$message = "Per your request, we are emailing you your GotoCode.com login information.\n".
"Your Username/Login is: " .$db->f("user_login") ."\n".
"Your Password is: " .$db->f("user_pass") . "\n" .
"\n".
"Thank you for visiting http://www.gotocode.com";
$from =”mail system”;
$additional_headers = "From: $from\nReply-To: $from";
mail ($to, $subject, $message, $additional_headers);
$form_name->date_sent->SetValue(date("Y-m-d H:i:s"));
$form_name->user_ip->SetValue($REMOTE_ADDR);
|
|
|
 |
|