Fix support of phpCAS >= 1.6
This commit is contained in:
parent
d16e6064c9
commit
ec756111c6
1 changed files with 20 additions and 1 deletions
21
index.php
21
index.php
|
@ -254,7 +254,26 @@ if (is_writable($phpCAS_logfile) || (!is_file($phpCAS_logfile) && is_writable(di
|
||||||
phpCAS::setDebug($phpCAS_logfile);
|
phpCAS::setDebug($phpCAS_logfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
phpCAS::client(CAS_VERSION_2_0, $cas_host, $cas_servers[$cas_host]['port'], $cas_servers[$cas_host]['context']);
|
// phpCAS client initialization
|
||||||
|
$init_args = [
|
||||||
|
CAS_VERSION_2_0,
|
||||||
|
$cas_host,
|
||||||
|
$cas_servers[$cas_host]['port'],
|
||||||
|
$cas_servers[$cas_host]['context'],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Note: Determine phpCAS version to correctly handle the $service_base_url parameter added in 1.6.0.
|
||||||
|
// Note: this parameter is also required for Debian Buster 1.3.6-1+deb10u1 package, because
|
||||||
|
// to fix CVE-2022-39369, this version was patched and this parameter have been added. Use Reflection
|
||||||
|
// to correctly handle this case.
|
||||||
|
$init_method = new ReflectionMethod("phpCAS", "client");
|
||||||
|
if (
|
||||||
|
intval(str_replace('.', '000', phpCAS::getVersion()).'000') >= 100060000000
|
||||||
|
|| $init_method->getNumberOfRequiredParameters() > 4
|
||||||
|
)
|
||||||
|
$init_args[] = $service_url;
|
||||||
|
|
||||||
|
call_user_func_array(["phpCAS", "client"], $init_args);
|
||||||
phpCAS::setFixedServiceURL($service_url);
|
phpCAS::setFixedServiceURL($service_url);
|
||||||
|
|
||||||
// Set extra CURL options
|
// Set extra CURL options
|
||||||
|
|
Loading…
Reference in a new issue