livehelperchat
livehelperchat copied to clipboard
forget password not working
Hey,
Password reminder don't work on SMTP ,
i have tested the test mail function and it's working
but when i try to reset password mail was not sent
i have built a work around and created new function that made this working
i just want to check if there is a bug with it
Are you sure to not have more operators with the same email address?
yea , i am sure i have only 2 operators and they have different emails
i have modified the forget password function into this and added sendResetMail function in erLhcoreClassChatMail class
after this the reset password work perfectly using SMTP in my domain
if (($userID = erLhcoreClassModelUser::fetchUserByEmail($form->Email)) !== false) {
$host = erLhcoreClassSystem::getHost();
$adminEmail = erConfigClassLhConfig::getInstance()->getSetting( 'site', 'site_admin_email' );
$UserData = erLhcoreClassUser::getSession()->load( 'erLhcoreClassModelUser', $userID );
$hash = erLhcoreClassModelForgotPassword::randomPassword(40);
erLhcoreClassModelForgotPassword::setRemindHash($UserData->id,$hash);
$Subject = erTranslationClassLhTranslation::getInstance()->getTranslation('user/forgotpassword','Password remind');
// HTML body
$body = erTranslationClassLhTranslation::getInstance()->getTranslation('user/forgotpassword','Click this link and You will be able to change a password').' </br><a href="' . $host . erLhcoreClassDesign::baseurl('user/remindpassword').'/'.$hash.'">Restore password</a>';
// Plain text body
$text_body = erTranslationClassLhTranslation::getInstance()->getTranslation('user/forgotpassword','Click this link and You will be able to change a password').' - ' . $host . erLhcoreClassDesign::baseurl('user/remindpassword').'/'.$hash;
erLhcoreClassChatMail::sendResetMail($UserData,$text_body,$Subject);
$tpl = erLhcoreClassTemplate::getInstance( 'lhuser/forgotpasswordsent.tpl.php');
} else {
$tpl = erLhcoreClassTemplate::getInstance( 'lhuser/forgotpasswordsent.tpl.php');
}