support for CAS fixedServiceURL

pull/3075/head
Sébastien Ducoulombier 6 years ago
parent 70064575ae
commit c1f31a7c7e
  1. 2
      app/config/auth.conf.dist.php
  2. 15
      main/auth/cas/cas_var.inc.php

@ -120,4 +120,6 @@ $cas = [
// 'verbose' => false,
// 'debug' => '/var/log/cas_debug.log',
'noCasServerValidation' => true, // set to false in production
// 'fixedServiceURL' => false, // false by default, set to either true or to the service URL string if needed
// sites might also need proxy_settings in configuration.php
];

@ -47,10 +47,8 @@ if (api_is_cas_activated()) {
phpCAS::setNoCasServerValidation();
}
global $_configuration;
if (is_array($_configuration)
&& array_key_exists('proxy_settings', $_configuration)) {
$proxySettings = $_configuration['proxy_settings'];
$proxySettings = api_get_configuration_value('proxy_settings');
if (false !== $proxySettings) {
if (is_array($proxySettings) && array_key_exists('https', $proxySettings)) {
$https = $proxySettings['https'];
if (is_string($https) && !empty($https)) {
@ -58,5 +56,14 @@ if (api_is_cas_activated()) {
}
}
}
if (is_array($cas) && array_key_exists('fixedServiceURL', $cas)) {
$fixedServiceURL = $cas['fixedServiceURL'];
if (is_string($fixedServiceURL)) {
phpCAS::setFixedServiceURL($fixedServiceURL);
} else if (is_bool($fixedServiceURL) && $fixedServiceURL) {
phpCAS::setFixedServiceURL(api_get_configuration_value('root_web'));
}
}
}
}

Loading…
Cancel
Save