From 7a811b07f634d3f2bb8c3478a020fc430cf70f7d Mon Sep 17 00:00:00 2001 From: Marcus Proest Date: Thu, 28 Mar 2019 11:19:27 +0100 Subject: Make URLs, brand names and list of admins configurable --- shib/api.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'shib') diff --git a/shib/api.php b/shib/api.php index 2098765..4bfee68 100644 --- a/shib/api.php +++ b/shib/api.php @@ -36,7 +36,7 @@ if (empty($_SERVER['persistent-id'])) { . " INNER JOIN organization USING (organizationid) " . " WHERE user.shibid = :shibid LIMIT 1", array('shibid' => $shibId)); // Figure out role - if (strpos(";{$_SERVER['entitlement']};", ';http://bwidm.de/entitlement/bwLehrpool;') !== false) { + if (strpos(";{$_SERVER['entitlement']};", CONFIG_ENTITLEMENT) !== false) { $role = 'TUTOR'; } else if (strpos(";{$_SERVER['affiliation']};", ';employee@') !== false || strpos(";{$_SERVER['affiliation']};", ';staff@') !== false @@ -48,11 +48,11 @@ if (empty($_SERVER['persistent-id'])) { // NEW: Ignore students for now $response = array( 'status' => 'error', - 'error' => "Sie wurden als Student eingestuft und können sich daher nicht an der bwLehrpool-Suite anmelden." + 'error' => "Sie wurden als Student eingestuft und können sich daher nicht an der " . CONFIG_SUITE . "-Suite anmelden." . "\nFalls Ihr Nutzerkonto kein Studentenkonto ist stellen Sie sicher, dass Ihr IdP für berechtigte" - . "\nAccounts entweder das bwLehrpool-Entitlement ausliefert, oder das Attribut 'affiliation'" + . "\nAccounts entweder das " . CONFIG_SUITE . "-Entitlement ausliefert, oder das Attribut 'affiliation'" . "\nausgeliefert wird, und es entweder 'employee@..', 'staff@..' oder 'faculty@..' enthält." - . "\n\nMehr Informationen finden Sie unter www.bwlehrpool.de" + . "\n\nMehr Informationen finden Sie unter " . CONFIG_HELPURL ); Header('Content-Type: text/plain; charset=utf-8'); die(json_encode($response, JSON_PRETTY_PRINT)); @@ -106,7 +106,7 @@ if (empty($_SERVER['persistent-id'])) { $response['status'] = 'unregistered'; } $response['id'] = $shibId; - $response['url'] = 'https://bwlp-masterserver.ruf.uni-freiburg.de/webif/'; + $response['url'] = CONFIG_MASTERWEBIF; @file_put_contents('/tmp/shib-unreg-' . time() . '-' . $_SERVER['REMOTE_ADDR'] . '.txt', print_r($_SERVER, true)); } else { // Found, see if we got personal information, either temporarily through metadata, or from database -- cgit v1.2.3-55-g7522