Skip to content

Commit

Permalink
Fix CAS server status check
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Jan 15, 2025
1 parent 3c0650c commit 8064f9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/System/Status/StatusChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,14 @@ public static function getCASStatus($public_only = true): array
if ($status === null) {
$status['status'] = self::STATUS_NO_DATA;
if (!empty($CFG_GLPI['cas_host'])) {
$url = $CFG_GLPI['cas_host'];
// Rebuild CAS URL
// see `CAS_Client::_getServerBaseURL()`
$url = 'https://' . $CFG_GLPI['cas_host'];
if (!empty($CFG_GLPI['cas_port'])) {
$url .= ':' . (int)$CFG_GLPI['cas_port'];
}
$url .= '/' . $CFG_GLPI['cas_uri'];

if (Toolbox::isUrlSafe($url)) {
$data = Toolbox::getURLContent($url);
if (!empty($data)) {
Expand Down

0 comments on commit 8064f9e

Please sign in to comment.