Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 0ac5a9f

Browse files
committed
fix: Fixed ECS bugs
1 parent e1ad062 commit 0ac5a9f

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

lib/NagiosStatusConnector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public function getStatus()
6363
{
6464
$result = [];
6565

66-
if (! ($key = file_get_contents($this->keyPath))) {
66+
$key = file_get_contents($this->keyPath);
67+
if ($key === false) {
6768
throw new Exception('Cannot load ket from path: \'' . $this->keyPath . '\' !');
6869
}
6970

templates/metadata_expiration-tpl.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/**
46
* This template just shows a time to metadata expiration.
57
*

www/metadata_expiration.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/**
4-
* This script loads all the metadata and finds the one which
5-
* is closest to expiration. Then it sends the time to expiration
6-
* to the template.
6+
* This script loads all the metadata and finds the one which is closest to expiration. Then it sends the time to
7+
* expiration to the template.
78
*
89
* This can be used to check whether the meta refresh works without problems.
910
*/
@@ -13,30 +14,33 @@
1314

1415
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
1516

16-
$metaentries = ['hosted' => [], 'remote' => [] ];
17+
$metaentries = [
18+
'hosted' => [],
19+
'remote' => [],
20+
];
1721
$metaentries['remote']['saml20-idp-remote'] = $metadata->getList('saml20-idp-remote');
1822
$metaentries['remote']['shib13-idp-remote'] = $metadata->getList('shib13-idp-remote');
1923

20-
if ($config->getBoolean('enable.saml20-idp', FALSE) === true) {
24+
if ($config->getBoolean('enable.saml20-idp', false) === true) {
2125
try {
2226
$metaentries['remote']['saml20-sp-remote'] = $metadata->getList('saml20-sp-remote');
23-
} catch(Exception $e) {
27+
} catch (Exception $e) {
2428
SimpleSAML\Logger::error('Federation: Error loading saml20-idp: ' . $e->getMessage());
2529
}
2630
}
2731

28-
if ($config->getBoolean('enable.shib13-idp', FALSE) === true) {
32+
if ($config->getBoolean('enable.shib13-idp', false) === true) {
2933
try {
3034
$metaentries['remote']['shib13-sp-remote'] = $metadata->getList('shib13-sp-remote');
31-
} catch(Exception $e) {
35+
} catch (Exception $e) {
3236
SimpleSAML\Logger::error('Federation: Error loading shib13-idp: ' . $e->getMessage());
3337
}
3438
}
3539

36-
if ($config->getBoolean('enable.adfs-idp', FALSE) === true) {
40+
if ($config->getBoolean('enable.adfs-idp', false) === true) {
3741
try {
3842
$metaentries['remote']['adfs-sp-remote'] = $metadata->getList('adfs-sp-remote');
39-
} catch(Exception $e) {
43+
} catch (Exception $e) {
4044
SimpleSAML\Logger::error('Federation: Error loading adfs-idp: ' . $e->getMessage());
4145
}
4246
}

0 commit comments

Comments
 (0)