]> git.mxchange.org Git - friendica.git/blobdiff - mod/lostpass.php
Merge commit 'mike/master'
[friendica.git] / mod / lostpass.php
index fb219072ef2258694c32124315d35f14dd7347ba..30bdc059c3f8925aa8c5c6b607cd4652daa5038d 100644 (file)
@@ -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;