SimpleSAML
|
|
$idpdata) {
$idpname = $idpid; // IdP may not have a friendly readable name configured
$latestexpiry = get_saml_metadata_expiry($idpid);
if (isset($idpdata["name"])) {
if (is_string($idpdata["name"])) {
$idpfriendlyname = $idpdata["name"];
} else {
$idpfriendlyname = (string) ($idpdata["name"][$GLOBALS['language']] ?? reset($idpdata["name"]));
}
$idpname .= " (" . $idpfriendlyname . ")";
}
$placeholders = ["%idpname", "%expiretime"];
$replace = [$idpname, $latestexpiry];
// show status
if ($latestexpiry < date("Y-m-d H:i")) {
$status = 'FAIL';
$info = str_replace($placeholders, $replace, $GLOBALS['lang']['simplesaml_idp_cert_expired']);
} elseif ($latestexpiry < date("Y-m-d H:i", time() + 60 * 60 * 24 * 7)) {
$status = 'FAIL';
$info = str_replace($placeholders, $replace, $GLOBALS['lang']['simplesaml_idp_cert_expiring']);
} else {
$status = 'OK';
$info = str_replace($placeholders, $replace, $GLOBALS['lang']['simplesaml_idp_cert_expires']);
}
?>
|
|
|