Skip to content

Commit

Permalink
corecting certificate information for redirected profiles and profile…
Browse files Browse the repository at this point in the history
…s without any certificates
  • Loading branch information
Tomasz Wolniewicz committed Jun 21, 2024
1 parent fbb5f66 commit 18aa87b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
3 changes: 2 additions & 1 deletion core/AbstractProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ abstract class AbstractProfile extends EntityWithDBProperties
const READINESS_LEVEL_SHOWTIME = 2;


const CERT_STATUS_NONE = -1;
const CERT_STATUS_OK = 0;
const CERT_STATUS_WARN = 1;
const CERT_STATUS_ERROR = 2;
Expand Down Expand Up @@ -941,7 +942,7 @@ public function certificateStatus()
$result = $this->databaseHandle->exec($query, "i", $this->identifier);
$rows = $result->fetch_all();
$x509 = new \core\common\X509();
$profileStatus = self::CERT_STATUS_OK;
$profileStatus = self::CERT_STATUS_NONE;
foreach ($rows as $row) {
$encodedCert = $row[0];
$tm = $x509->processCertificate(base64_decode($encodedCert))['full_details']['validTo_time_t']- time();
Expand Down
33 changes: 17 additions & 16 deletions web/admin/overview_org.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,23 @@ function displayRadiusPropertyWidget(&$theProfile, $readonly, &$uiElements, $edi
$iconData = $uiElements->iconData('PROFILES_REDIRECTED');
$iconData['text'] = _("Profile redirected");
$buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
} else {
$certStatus = $theProfile->certificateStatus();
switch ($certStatus) {
case core\AbstractProfile::CERT_STATUS_OK:
$iconData = $uiElements->iconData('CERT_STATUS_OK');
$buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
break;
case core\AbstractProfile::CERT_STATUS_WARN:
$iconData = $uiElements->iconData('CERT_STATUS_WARN');
$buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
break;
case core\AbstractProfile::CERT_STATUS_ERROR:
$iconData = $uiElements->iconData('CERT_STATUS_ERROR');
$buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
break;
}

}

$certStatus = $theProfile->certificateStatus();
switch ($certStatus) {
case core\AbstractProfile::CERT_STATUS_OK:
$iconData = $uiElements->iconData('CERT_STATUS_OK');
$buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
break;
case core\AbstractProfile::CERT_STATUS_WARN:
$iconData = $uiElements->iconData('CERT_STATUS_WARN');
$buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
break;
case core\AbstractProfile::CERT_STATUS_ERROR:
$iconData = $uiElements->iconData('CERT_STATUS_ERROR');
$buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
break;
}
$buffer_headline .= "</div>";

Expand Down

0 comments on commit 18aa87b

Please sign in to comment.