FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forgot Password Errors
#1
Information 
The Forgot Password page through the Submission Accounts module was erroring out when my users were trying to retrieve their login passwords. It could not figure out undefined variables for the $success and $messages fields that are generated based on if the email is sent or not. I went into the following page submission_accounts/global/code/users.php and modified the last few lines of code on or around line 296. Seems to work fine now.

Changed from:
Code:
if (!@mail("$email", $email_subject, $email_content))
  {
    $success = false;
    $message = $LANG["notify_email_not_sent"];
    return array($success, $message);
  }

  return array($success, $message);
}

Replace With:

Code:
// some systems fail without it]
  if (!@mail("$email", $email_subject, $email_content))
  {
    $success = false;
    $message = $LANG["notify_email_not_sent"];
    return array($success, $message);
  }
  else if (
      @mail("$email", $email_subject, $email_content))
  {
    $success = true;
    $message = $LANG["notify_email_sent"];
    return array($success, $message);
  }


This is a patch that seems to work on my system. I cannot guarantee it will resolve all issues with the Forgot Password page, so remember to backup your files before attempting to use this solution.

Matt
Reply
#2
Hey Matt,

Thanks for the heads up! I've posted this as a bug here:
http://bugs.formtools.org/index.php?cmd=view&id=148

I'll fix it in the next release of the module. Thanks for posting your code!

- Ben
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)