Use absolute URLs in invitation emails
This commit is contained in:
@@ -31,7 +31,11 @@
|
||||
$result = $um->inviteUser($email, $role, $app_access);
|
||||
|
||||
// Both new and existing users require explicit acceptance via email
|
||||
$invite_url = rtrim($server_url, '/') . ($result['new_user']
|
||||
// Absolute URL: the link is opened from a mail client, where a bare
|
||||
// /app/... path goes nowhere. Same construction as register.php.
|
||||
$invite_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http')
|
||||
. '://' . $_SERVER['HTTP_HOST']
|
||||
. rtrim($server_url, '/') . ($result['new_user']
|
||||
? '/login/invited_onboarding.php?token=' . $result['token']
|
||||
: '/login/accept_invite.php?token=' . $result['token']);
|
||||
|
||||
@@ -89,7 +93,11 @@
|
||||
$map_id = (int)($data['map_id'] ?? 0);
|
||||
$result = $um->resendInvite($map_id);
|
||||
|
||||
$invite_url = rtrim($server_url, '/') . ($result['is_new_user']
|
||||
// Absolute URL: the link is opened from a mail client, where a bare
|
||||
// /app/... path goes nowhere. Same construction as register.php.
|
||||
$invite_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http')
|
||||
. '://' . $_SERVER['HTTP_HOST']
|
||||
. rtrim($server_url, '/') . ($result['is_new_user']
|
||||
? '/login/invited_onboarding.php?token=' . $result['token']
|
||||
: '/login/accept_invite.php?token=' . $result['token']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user