diff options
author | Simon Rettberg | 2022-11-22 17:13:31 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-11-22 17:13:31 +0100 |
commit | 7b0d121555d4d748ff4fd29944743a013e62772e (patch) | |
tree | 4b930a9f862a63c3dc1b1015b81daa6442d831bb | |
parent | api: Fix error message (diff) | |
download | bwlp-webadmin-7b0d121555d4d748ff4fd29944743a013e62772e.tar.gz bwlp-webadmin-7b0d121555d4d748ff4fd29944743a013e62772e.tar.xz bwlp-webadmin-7b0d121555d4d748ff4fd29944743a013e62772e.zip |
api: Hard-code bogus name/mail for read only (STUDENT) login
-rw-r--r-- | shib/api.php | 12 |
1 files changed, 3 insertions, 9 deletions
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])) { |