password reminder not working after cms upgrade

By 4cdg - September 8, 2011

I had password reminder page setup and working at this link www.stoddardmls.com/pw_remind.php I copied the code directly from user-password-request.php in membership module.

I had to upgrade my cms to 2.12 and now when I submit password reminder it gives me this error message.

Notice: Undefined variable: errors in /usr/local/www/stoddardmls.com/pw_remind.php on line 51 Mail Error:

Re: [4cdg] password reminder not working after cms upgrade

By robin - September 8, 2011

Hey,

Does it still send the reminder even with the error? Could you post the part of the code that is generating the error and we'll take a look?

Thanks,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] password reminder not working after cms upgrade

By 4cdg - September 8, 2011

i does still send the email.

I am not sure what part of code is causing error, it says line 51 in error message, I haven't changed anything from the example that comes with the plugin. I attached the document to the last message, here is what lines 38 to 52 look like

$emailTemplate = "emails/user-password-request.php";
$emailHeaders = emailTemplate_load(array(
'template' => websiteLogin_pluginDir() . "/$emailTemplate",
'subject' => '', // set in template
'from' => '', // set in template
'to' => $user['email'],
'placeholders' => array(
'username' => $user['username'],
'loginUrl' => "http://" . $_SERVER['HTTP_HOST'] . $GLOBALS['WEBSITE_LOGIN_LOGIN_FORM_URL'],
'resetUrl' => "http://" . $_SERVER['HTTP_HOST'] . $GLOBALS['WEBSITE_LOGIN_RESET_URL'] . $resetQuery,
),
));
$mailErrors = sendMessage($emailHeaders);
if ($mailErrors) { die("Mail Error: $errors"); }

Re: [4cdg] password reminder not working after cms upgrade

By Jason - September 9, 2011

Hi,

It looks like the wrong variable is being used on that last line, try changing this:

if ($mailErrors) { die("Mail Error: $errors"); }

to this
if ($mailErrors) { die("Mail Error: $mailErrors"); }

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] password reminder not working after cms upgrade

By 4cdg - September 9, 2011

made that change, now i get this error when i submit the request

Mail Error: Undefined index: disabled

Re: [robin] password reminder not working after cms upgrade

By 4cdg - September 9, 2011

that fixed it.

thanks guys

Re: [4cdg] password reminder not working after cms upgrade

By nmsinc - September 28, 2011

Had the same issue and your suggestion fixed it!

Thanks
nmsinc