X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Flostpass.php;h=af4518ca16246292a9b8a18f8461797d9e9646e1;hb=b705a91ccdb574aeb99a2a4edb55fd549a14d3e8;hp=ec397b7a1684e981bbf48f71f5f744df0883be18;hpb=407b2397cbb25a1de9252f16279dfdd786ffade1;p=friendica.git diff --git a/mod/lostpass.php b/mod/lostpass.php index ec397b7a16..af4518ca16 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -8,12 +8,11 @@ use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Database\DBM; use Friendica\Model\User; +use Friendica\Util\DateTimeFormat; require_once 'boot.php'; -require_once 'include/datetime.php'; require_once 'include/enotify.php'; require_once 'include/text.php'; -require_once 'include/pgettext.php'; function lostpass_post(App $a) { @@ -33,7 +32,7 @@ function lostpass_post(App $a) $fields = [ 'pwdreset' => $pwdreset_token, - 'pwdreset_time' => datetime_convert() + 'pwdreset_time' => DateTimeFormat::utcNow() ]; $result = dba::update('user', $fields, ['uid' => $user['uid']]); if ($result) { @@ -70,6 +69,7 @@ function lostpass_post(App $a) notification([ 'type' => SYSTEM_EMAIL, 'to_email' => $user['email'], + 'uid' => $user['uid'], 'subject' => L10n::t('Password reset requested at %s', $sitename), 'preamble' => $preamble, 'body' => $body @@ -92,7 +92,7 @@ function lostpass_content(App $a) } // Password reset requests expire in 60 minutes - if ($user['pwdreset_time'] < datetime_convert('UTC', 'UTC', 'now - 1 hour')) { + if ($user['pwdreset_time'] < DateTimeFormat::utc('now - 1 hour')) { $fields = [ 'pwdreset' => null, 'pwdreset_time' => null @@ -126,6 +126,7 @@ function lostpass_form() function lostpass_generate_password($user) { $o = ''; + $a = get_app(); $new_password = User::generateNewPassword(); $result = User::updatePassword($user['uid'], $new_password); @@ -148,8 +149,8 @@ function lostpass_generate_password($user) $preamble = deindent(L10n::t(' Dear %1$s, Your password has been changed as requested. Please retain this - information for your records (or change your password immediately to - something that you will remember). + information for your records ' . "\x28" . 'or change your password immediately to + something that you will remember' . "\x29" . '. ', $user['username'])); $body = deindent(L10n::t(' Your login details are as follows: @@ -164,6 +165,7 @@ function lostpass_generate_password($user) notification([ 'type' => SYSTEM_EMAIL, 'to_email' => $user['email'], + 'uid' => $user['uid'], 'subject' => L10n::t('Your password has been changed at %s', $sitename), 'preamble' => $preamble, 'body' => $body