'', 'title' => '', 'phone' => '']; if ($invite && $link['state'] === 'pending') { $who = portalInviteWho($invite['invite_email'], $invite['invite_client_id']); $in['name'] = trim((string) $invite['invite_name']) !== '' ? (string) $invite['invite_name'] : (string) ($who['name'] ?? ''); if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['portal_join'])) { $in = [ 'name' => (string) ($_POST['name'] ?? ''), 'title' => (string) ($_POST['title'] ?? ''), 'phone' => (string) ($_POST['phone'] ?? ''), ]; $method = (string) ($_POST['method'] ?? 'local'); $contact_id = portalInviteAccept($invite, $in + [ 'method' => $method, 'password' => (string) ($_POST['new_password'] ?? ''), 'confirm' => (string) ($_POST['confirm_password'] ?? ''), ], $error); if ($contact_id) { $first = strtok(trim(preg_replace('/\s+/', ' ', $in['name'])), ' '); $_SESSION['login_message'] = "Welcome, $first - your account is ready. " . (isset($methods[$method]) && $method === 'azure' ? 'Sign in with your Microsoft 365 account below.' : 'Sign in with ' . $invite['invite_email'] . ' and your new password.'); $_SESSION['login_message_type'] = 'success'; header("Location: /login.php"); exit(); } // Used in the meantime - say so rather than show the form again $link = portalInviteByLink($invite_id, $token); $invite = $link['row']; } } $signup = $invite && $invite['invite_kind'] === 'signup'; $by = $invite ? portalInviteBy($invite) : ''; $ask = $by !== '' ? "Ask $by to send it again." : 'Ask your company\'s primary contact or us to invite you.'; $notes = [ 'gone' => ["That link doesn't work", 'It may have been copied only in part - or a newer email replaced it, so use the link in the latest one.'], 'expired' => ['That link has run out', $signup ? 'Links to finish signing up work for ' . PORTAL_SIGNUP_LINK_HOURS . ' hours - ask for a new one.' : 'Invites work for ' . PORTAL_INVITE_LINK_DAYS . " days. $ask"], 'accepted' => ["You've joined already", 'Sign in with ' . ($invite['invite_email'] ?? 'your email address') . '. Forgot your password? Choose Forgot password on the sign-in page.'], 'cancelled' => ['That invite was cancelled', $ask], ]; $state = $link['state']; $title = $state === 'pending' ? ($signup ? 'Finish signing up' : 'Join ' . $invite['client_name']) : $notes[$state][0]; ?>
Your client portal account for = escapeHtml($invite['client_name']) ?>, as = escapeHtml($invite['invite_email']) ?>. = $by !== '' ? escapeHtml($by) . ' invited' : 'You are invited as' ?> = escapeHtml($invite['invite_email']) ?> to the = escapeHtml($company_name) ?> client portal - where you raise and follow support tickets.
= escapeHtml($notes[$state][1]) ?>
Sign in Ask for a new link Back to sign in