X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Flostpass.php;h=37ef3e2f82f6a461bc78d7a38381309a35d67486;hb=dd0a1cf586fc37fe9a3d84af277c7504136a3bf9;hp=0c4bb1a8335ffc38a9cce9a08a86df5bcc99b799;hpb=0c764684bb32a9432fd161e62db907efb78af1a5;p=friendica.git diff --git a/mod/lostpass.php b/mod/lostpass.php index 0c4bb1a833..37ef3e2f82 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -1,11 +1,12 @@ config['sitename']; - $siteurl = $a->get_baseurl(); - $resetlink = $a->get_baseurl() . '/lostpass?verify=' . $new_password; + $resetlink = App::get_baseurl() . '/lostpass?verify=' . $new_password; $preamble = deindent(t(' Dear %1$s, @@ -65,7 +65,7 @@ function lostpass_post(&$a) { Login Name: %3$s')); $preamble = sprintf($preamble, $username, $sitename); - $body = sprintf($body, $resetlink, $siteurl, $email); + $body = sprintf($body, $resetlink, App::get_baseurl(), $email); notification(array( 'type' => "SYSTEM_EMAIL", @@ -75,11 +75,11 @@ function lostpass_post(&$a) { 'body' => $body)); goaway(z_root()); + } -} -if(! function_exists('lostpass_content')) { -function lostpass_content(&$a) { + +function lostpass_content(App $a) { if(x($_GET,'verify')) { @@ -89,7 +89,7 @@ function lostpass_content(&$a) { $r = q("SELECT * FROM `user` WHERE `pwdreset` = '%s' LIMIT 1", dbesc($hash) ); - if(! count($r)) { + if (! dbm::is_result($r)) { $o = t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."); return $o; } @@ -104,24 +104,25 @@ function lostpass_content(&$a) { dbesc($new_password_encoded), intval($uid) ); - if($r) { + + /// @TODO Is dbm::is_result() okay here? + if ($r) { $tpl = get_markup_template('pwdreset.tpl'); $o .= replace_macros($tpl,array( '$lbl1' => t('Password Reset'), '$lbl2' => t('Your password has been reset as requested.'), '$lbl3' => t('Your new password is'), '$lbl4' => t('Save or copy your new password - and then'), - '$lbl5' => '' . t('click here to login') . '.', + '$lbl5' => '' . t('click here to login') . '.', '$lbl6' => t('Your password may be changed from the Settings page after successful login.'), '$newpass' => $new_password, - '$baseurl' => $a->get_baseurl() + '$baseurl' => App::get_baseurl() )); info("Your password has been reset." . EOL); $sitename = $a->config['sitename']; - $siteurl = $a->get_baseurl(); // $username, $email, $new_password $preamble = deindent(t(' Dear %1$s, @@ -140,7 +141,7 @@ function lostpass_content(&$a) { ')); $preamble = sprintf($preamble, $username); - $body = sprintf($body, $siteurl, $email, $new_password); + $body = sprintf($body, App::get_baseurl(), $email, $new_password); notification(array( 'type' => "SYSTEM_EMAIL", @@ -165,5 +166,5 @@ function lostpass_content(&$a) { return $o; } -} + }