X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Flostpass.php;h=af4518ca16246292a9b8a18f8461797d9e9646e1;hb=ffc8b2a79ae3f42339c689cd7b8da66d62c6b71c;hp=c39a38cca95fe002b7caf7fa03ba49faa6977a37;hpb=9ab55181ed9a08c4887eabe5a85e58bc3b34d9fb;p=friendica.git diff --git a/mod/lostpass.php b/mod/lostpass.php index c39a38cca9..af4518ca16 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -8,9 +8,9 @@ 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'; @@ -32,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) { @@ -69,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 @@ -91,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 @@ -125,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); @@ -163,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