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

Commit 8c5aecd

Browse files
melangervyskocilpavel
authored andcommitted
Added possibility to show statistics only after authentication (#34)
* Added possibility to show statistics only after authentication
1 parent 1f4d34f commit 8c5aecd

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
5+
#### Added
6+
- Added possibility to show statistics only after authentication
7+
58
#### Changed
69
- Remove unnecessary is_null()
710
- Use SimpleSAML\Database

config-templates/module_statisticsproxy.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,10 @@
9797
* Fill the table name for serviceProviders
9898
*/
9999
'serviceProvidersMapTableName' => 'serviceProvidersMap',
100+
101+
/**
102+
* Authentication source name if authentication should be required.
103+
* Defaults to empty string.
104+
*/
105+
//'requireAuth.source' => 'default-sp',
100106
];

www/index.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
$session = Session::getSessionFromRequest();
1616

1717
$configStatisticsproxy = Configuration::getConfig(CONFIG_FILE_NAME_STATISTICSPROXY);
18+
19+
$authSource = $configStatisticsproxy->getString('requireAuth.source', '');
20+
if ($authSource) {
21+
$as = new \SimpleSAML\Auth\Simple($authSource);
22+
$as->requireAuth();
23+
}
24+
1825
$mode = $configStatisticsproxy->getString(MODE, 'PROXY');
1926

2027
$t = new Template($config, 'proxystatistics:statistics-tpl.php');

0 commit comments

Comments
 (0)