Skip to content

Commit

Permalink
N°7792 Do not initialize CAS if already started
Browse files Browse the repository at this point in the history
  • Loading branch information
Timmy38 committed Nov 22, 2024
1 parent 596e26a commit 19eae91
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions datamodels/2.x/authent-cas/src/CASLoginExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ public function LogoutAction()
private static function InitCASClient()
{
$bCASDebug = Config::Get('cas_debug');
if ($bCASDebug)
{
if ($bCASDebug) {
phpCAS::setLogger(new CASLogger(APPROOT.'log/cas.log'));
}

Expand All @@ -171,18 +170,17 @@ private static function InitCASClient()
$iCASPort = Config::Get('cas_port');
$sCASContext = Config::Get('cas_context');
$sServiceBaseURL = Config::Get('service_base_url', self::GetServiceBaseURL());
phpCAS::client($sCASVersion, $sCASHost, $iCASPort, $sCASContext, $sServiceBaseURL, false /* session already started */);
if (!phpCAS::isInitialized()) {
phpCAS::client($sCASVersion, $sCASHost, $iCASPort, $sCASContext, $sServiceBaseURL, false /* session already started */);
}
$sCASCACertPath = Config::Get('cas_server_ca_cert_path');
if (empty($sCASCACertPath))
{
if (empty($sCASCACertPath)) {
// If no certificate authority is provided, do not attempt to validate
// the server's certificate
// THIS SETTING IS NOT RECOMMENDED FOR PRODUCTION.
// VALIDATING THE CAS SERVER IS CRUCIAL TO THE SECURITY OF THE CAS PROTOCOL!
phpCAS::setNoCasServerValidation();
}
else
{
} else {
phpCAS::setCasServerCACert($sCASCACertPath);
}
}
Expand Down

0 comments on commit 19eae91

Please sign in to comment.