X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Flostpass.php;h=30bdc059c3f8925aa8c5c6b607cd4652daa5038d;hb=4198efe03570606b35f3aba6cdf7f80de20384f4;hp=fb219072ef2258694c32124315d35f14dd7347ba;hpb=83ee7909cddaed3d25c4b52f197ac470e8150ee0;p=friendica.git diff --git a/mod/lostpass.php b/mod/lostpass.php index fb219072ef..30bdc059c3 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -7,7 +7,8 @@ function lostpass_post(&$a) { 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)) @@ -25,7 +26,7 @@ function lostpass_post(&$a) { 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(), @@ -34,9 +35,8 @@ function lostpass_post(&$a) { '$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()); } @@ -69,7 +69,7 @@ function lostpass_content(&$a) { 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() @@ -78,7 +78,7 @@ function lostpass_content(&$a) { - $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(), @@ -94,7 +94,7 @@ function lostpass_content(&$a) { } else { - $tpl = file_get_contents('view/lostpass.tpl'); + $tpl = load_view_file('view/lostpass.tpl'); $o .= $tpl;