From 7b0d121555d4d748ff4fd29944743a013e62772e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 22 Nov 2022 17:13:31 +0100 Subject: api: Hard-code bogus name/mail for read only (STUDENT) login --- shib/api.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'shib') diff --git a/shib/api.php b/shib/api.php index 386c48d..7f510d8 100644 --- a/shib/api.php +++ b/shib/api.php @@ -86,15 +86,9 @@ if (empty($_SERVER['persistent-id'])) { // Not found, so we don't know which satellite to use if ($role === 'STUDENT') { $response['status'] = 'ok'; - if (isset($_SERVER['givenName'])) { - $response['firstName'] = $_SERVER['givenName']; - } - if (isset($_SERVER[CONFIG_SURNAME])) { - $response['lastName'] = $_SERVER[CONFIG_SURNAME]; - } - if (isset($_SERVER['mail'])) { - $response['mail'] = $_SERVER['mail']; - } + $response['firstName'] = $_SERVER['givenName'] ?? 'Anonymous'; + $response['lastName'] = $_SERVER[CONFIG_SURNAME] ?? 'Student'; + $response['mail'] = $_SERVER['mail'] ?? 'void@none.invalid'; $response['userId'] = $shibId; // Try to figure out orgId if (!isset($response['organizationId']) && isset($_SERVER[CONFIG_EPPN])) { -- cgit v1.2.3-55-g7522