diff options
author | Simon Rettberg | 2020-06-26 14:07:56 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-06-26 14:07:56 +0200 |
commit | 13e8ac42cab7c169f5d115286314f17e8f814f71 (patch) | |
tree | ea222c05e909d6d2c412a5f70b334b8df488a8d8 /inc | |
parent | [register] Simplify code (diff) | |
download | bwlp-webadmin-13e8ac42cab7c169f5d115286314f17e8f814f71.tar.gz bwlp-webadmin-13e8ac42cab7c169f5d115286314f17e8f814f71.tar.xz bwlp-webadmin-13e8ac42cab7c169f5d115286314f17e8f814f71.zip |
Make scoped affiliation attribute name configurable
Diffstat (limited to 'inc')
-rw-r--r-- | inc/user.inc.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/user.inc.php b/inc/user.inc.php index e2523f9..a5a8e3c 100644 --- a/inc/user.inc.php +++ b/inc/user.inc.php @@ -196,9 +196,9 @@ class User 'email' => $_SERVER['mail'], ); // Figure out whether the user should be considered a tutor - if (isset($_SERVER['affiliation']) && (strpos(";{$_SERVER['affiliation']}", ';employee@') !== false - || strpos(";{$_SERVER['affiliation']}", ';staff@') !== false - || strpos(";{$_SERVER['affiliation']}", ';faculty@') !== false)) + if (isset($_SERVER[CONFIG_SCOPED_AFFILIATION]) && (strpos(";{$_SERVER[CONFIG_SCOPED_AFFILIATION]}", ';employee@') !== false + || strpos(";{$_SERVER[CONFIG_SCOPED_AFFILIATION]}", ';staff@') !== false + || strpos(";{$_SERVER[CONFIG_SCOPED_AFFILIATION]}", ';faculty@') !== false)) self::$user['role'] = 'TUTOR'; elseif (isset($_SERVER['entitlement']) && strpos(";{$_SERVER['entitlement']};", CONFIG_ENTITLEMENT) !== false) self::$user['role'] = 'TUTOR'; @@ -208,7 +208,7 @@ class User if (isset($_SERVER[CONFIG_EPPN]) && preg_match('/@([0-9a-zA-Z\-\._]+)$/', $_SERVER[CONFIG_EPPN], $out)) { self::$user['organization'] = $out[1]; } - if (!isset(self::$user['organization']) && isset($_SERVER['affiliation']) && preg_match('/@([0-9a-zA-Z\-\._]+)(;|$)/', $_SERVER['affiliation'], $out)) { + if (!isset(self::$user['organization']) && isset($_SERVER[CONFIG_SCOPED_AFFILIATION]) && preg_match('/@([0-9a-zA-Z\-\._]+)(;|$)/', $_SERVER[CONFIG_SCOPED_AFFILIATION], $out)) { self::$user['organization'] = $out[1]; } // Get matching db entry if any |