if(! $email)
goaway($a->get_baseurl());
- $r = q("SELECT * FROM `user` WHERE `email` = '%s' LIMIT 1",
+ $r = q("SELECT * FROM `user` WHERE ( `email` = '%s' OR `nickname` = '%s' ) LIMIT 1",
+ dbesc($email),
dbesc($email)
);
if(! count($r))
if($r)
notice("Password reset request issued. Check your email.");
- $email_tpl = file_get_contents("view/lostpass_eml.tpl");
+ $email_tpl = load_view_file("view/lostpass_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
'$reset_link' => $a->get_baseurl() . '/lostpass?verify=' . $new_password
));
- $res = mail($email,"Password reset requested at {$a->config['sitename']}",$email_tpl,"From: Administrator@{$_SERVER[SERVER_NAME]}");
-
-
+ $res = mail($email, t('Password reset requested at ') . $a->config['sitename'],
+ $email_tpl, 'From: ' . t('Administrator') . '@' . $_SERVER[SERVER_NAME]);
goaway($a->get_baseurl());
}
intval($uid)
);
if($r) {
- $tpl = file_get_contents('view/pwdreset.tpl');
+ $tpl = load_view_file('view/pwdreset.tpl');
$o .= replace_macros($tpl,array(
'$newpass' => $new_password,
'$baseurl' => $a->get_baseurl()
- $email_tpl = file_get_contents("view/passchanged_eml.tpl");
+ $email_tpl = load_view_file("view/passchanged_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
}
else {
- $tpl = file_get_contents('view/lostpass.tpl');
+ $tpl = load_view_file('view/lostpass.tpl');
$o .= $tpl;