diff options
-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])) { |