summaryrefslogtreecommitdiffstats
path: root/shib
diff options
context:
space:
mode:
authorSimon Rettberg2022-11-22 17:13:31 +0100
committerSimon Rettberg2022-11-22 17:13:31 +0100
commit7b0d121555d4d748ff4fd29944743a013e62772e (patch)
tree4b930a9f862a63c3dc1b1015b81daa6442d831bb /shib
parentapi: Fix error message (diff)
downloadbwlp-webadmin-7b0d121555d4d748ff4fd29944743a013e62772e.tar.gz
bwlp-webadmin-7b0d121555d4d748ff4fd29944743a013e62772e.tar.xz
bwlp-webadmin-7b0d121555d4d748ff4fd29944743a013e62772e.zip
api: Hard-code bogus name/mail for read only (STUDENT) login
Diffstat (limited to 'shib')
-rw-r--r--shib/api.php12
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])) {