git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c5afbbf
)
login/mailpass: prefer full name to address user
author
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 10 Feb 2019 07:22:48 +0000
(08:22 +0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 10 Feb 2019 08:22:03 +0000
(09:22 +0100)
login/mailpass.inc.php
patch
|
blob
|
history
diff --git
a/login/mailpass.inc.php
b/login/mailpass.inc.php
index 1be0d68e14c3c4c5e9e4bb4532570fdd84f3da8e..5edc29e524f4099a4067dd20d55cb8b23d3845e3 100644
(file)
--- a/
login/mailpass.inc.php
+++ b/
login/mailpass.inc.php
@@
-14,6
+14,8
@@
function mailtoken($email)
{
$found = userbymail($email);
if (!$found) return FALSE;
{
$found = userbymail($email);
if (!$found) return FALSE;
+ $user = new User("profile/$found");
+ if (empty($user)) return FALSE;
$token = substr(sha1('$Random'.rand()), 0, 10);
if (!file_put_contents("profile/$found/.token", $token))
$token = substr(sha1('$Random'.rand()), 0, 10);
if (!file_put_contents("profile/$found/.token", $token))
@@
-22,7
+24,7
@@
function mailtoken($email)
$sitename = $_SERVER['HTTP_HOST'];
$sitelink = 'https://'.$sitename;
$rep = [
$sitename = $_SERVER['HTTP_HOST'];
$sitelink = 'https://'.$sitename;
$rep = [
- '[[user]]' => $found,
+ '[[user]]' => $
user->name ?: $
found,
'[[link]]' => "$sitelink/login/pass?token=$found:$token",
'[[site]]' => $sitename,
];
'[[link]]' => "$sitelink/login/pass?token=$found:$token",
'[[site]]' => $sitename,
];