X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Flostpass.php;h=1a30effd4eba82e3b7fdc9d819bd76fe7b965112;hb=de4a2e6fd03cd0aab94a256eba92ed593931534b;hp=938d1cbb008ada25359cf6a68514760a2d98fc6f;hpb=04dceb955109eed93db5da1bd6c6d4cdd411a9be;p=friendica.git
diff --git a/mod/lostpass.php b/mod/lostpass.php
index 938d1cbb00..1a30effd4e 100644
--- a/mod/lostpass.php
+++ b/mod/lostpass.php
@@ -1,23 +1,27 @@
config['sitename'];
- $siteurl = $a->get_baseurl();
- $resetlink = $a->get_baseurl() . '/lostpass?verify=' . $new_password;
+ $resetlink = System::baseUrl() . '/lostpass?verify=' . $new_password;
$preamble = deindent(t('
Dear %1$s,
@@ -64,21 +67,21 @@ function lostpass_post(&$a) {
Login Name: %3$s'));
$preamble = sprintf($preamble, $username, $sitename);
- $body = sprintf($body, $resetlink, $siteurl, $email);
+ $body = sprintf($body, $resetlink, System::baseUrl(), $email);
notification(array(
- 'type' => "SYSTEM_EMAIL",
+ 'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Password reset requested at %s'),$sitename),
'preamble'=> $preamble,
'body' => $body));
- goaway(z_root());
+ goaway(System::baseUrl());
}
-function lostpass_content(&$a) {
+function lostpass_content(App $a) {
if(x($_GET,'verify')) {
@@ -88,7 +91,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;
}
@@ -103,24 +106,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' => System::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,
@@ -139,10 +143,10 @@ function lostpass_content(&$a) {
'));
$preamble = sprintf($preamble, $username);
- $body = sprintf($body, $siteurl, $email, $new_password);
+ $body = sprintf($body, System::baseUrl(), $email, $new_password);
notification(array(
- 'type' => "SYSTEM_EMAIL",
+ 'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Your password has been changed at %s'),$sitename),
'preamble'=> $preamble,