summaryrefslogtreecommitdiffstats
path: root/shib/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'shib/api.php')
-rw-r--r--shib/api.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/shib/api.php b/shib/api.php
index 6772e86..0910c3d 100644
--- a/shib/api.php
+++ b/shib/api.php
@@ -37,6 +37,7 @@ if (empty($_SERVER['persistent-id'])) {
. " WHERE user.shibid = :shibid LIMIT 1", array('shibid' => $shibId));
if ($user === false) {
// Not found, so we don't know which satellite to use
+ // TODO: Support STUDENT mode
$response['status'] = 'unregistered';
$response['id'] = $shibId;
$response['url'] = 'https://bwlp-masterserver.ruf.uni-freiburg.de/webif/';
@@ -52,7 +53,7 @@ if (empty($_SERVER['persistent-id'])) {
if (empty($mail) && isset($_SERVER['mail']))
$mail = trim($_SERVER['mail']);
//
- $login = ( empty($user['userid']) ? $shibId : $user['userid'] );
+ $login = (empty($user['userid']) ? $shibId : $user['userid'] );
if (empty($firstName) || empty($lastName) || empty($login)) {
// This means the user did not provide personal information on signup, nor does the IdP send them
$response['status'] = 'anonymous';
@@ -61,9 +62,11 @@ if (empty($_SERVER['persistent-id'])) {
// Figure out role
if (strpos(";{$_SERVER['entitlement']};", ';http://bwidm.de/entitlement/bwLehrpool;') !== false) {
$role = 'TUTOR';
- } else if (strpos(";{$_SERVER['affiliation']};", ';employee@') !== false) {
+ } else if (strpos(";{$_SERVER['affiliation']};", ';employee@') !== false
+ || strpos(";{$_SERVER['affiliation']};", ';staff@') !== false) {
$role = 'TUTOR';
} else {
+ @file_put_contents('/tmp/shib-' . time() . '-' . $_SERVER['REMOTE_ADDR'] . '.txt', print_r($_SERVER, true));
$role = 'STUDENT';
}
// Determine satellite(s)