X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Flostpass.php;h=b71398fa4b5b79e7c13619750ec3a6d66e984117;hb=30b7c689292b3a5d06fb9c52a369b53ecb05e57f;hp=530619bc4f7fa484c29be5a5a6166fb57a5d9789;hpb=0c51305c72acd244dc92bb18c393fdf8fba4889b;p=friendica.git diff --git a/mod/lostpass.php b/mod/lostpass.php index 530619bc4f..b71398fa4b 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -5,14 +5,18 @@ function lostpass_post(&$a) { $email = notags(trim($_POST['login-name'])); if(! $email) - goaway($a->get_baseurl()); + goaway(z_root()); - $r = q("SELECT * FROM `user` WHERE ( `email` = '%s' OR `nickname` = '%s' ) LIMIT 1", + $r = q("SELECT * FROM `user` WHERE ( `email` = '%s' OR `nickname` = '%s' ) AND `verified` = 1 AND `blocked` = 0 LIMIT 1", dbesc($email), dbesc($email) ); - if(! count($r)) - goaway($a->get_baseurl()); + + if(! count($r)) { + notice( t('No valid account found.') . EOL); + goaway(z_root()); + } + $uid = $r[0]['uid']; $username = $r[0]['username']; @@ -24,7 +28,7 @@ function lostpass_post(&$a) { intval($uid) ); if($r) - notice( t('Password reset request issued. Check your email.') . EOL); + info( t('Password reset request issued. Check your email.') . EOL); $email_tpl = get_intltext_template("lostpass_eml.tpl"); $email_tpl = replace_macros($email_tpl, array( @@ -42,7 +46,7 @@ function lostpass_post(&$a) { . 'Content-transfer-encoding: 8bit' ); - goaway($a->get_baseurl()); + goaway(z_root()); } @@ -58,7 +62,7 @@ function lostpass_content(&$a) { ); if(! count($r)) { notice( t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed.") . EOL); - goaway($a->get_baseurl()); + goaway(z_root()); return; } $uid = $r[0]['uid']; @@ -85,7 +89,7 @@ function lostpass_content(&$a) { '$baseurl' => $a->get_baseurl() )); - notice("Your password has been reset." . EOL); + info("Your password has been reset." . EOL); @@ -120,4 +124,4 @@ function lostpass_content(&$a) { return $o; } -} \ No newline at end of file +}