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

Commit f15cd8f

Browse files
melangervyskocilpavel
authored andcommitted
Added possibility to show statistics only after authentication
1 parent 5587d10 commit f15cd8f

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
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

www/index.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,6 @@
2020
if ($authSource) {
2121
$as = new \SimpleSAML\Auth\Simple($authSource);
2222
$as->requireAuth();
23-
$attributes = $as->getAttributes();
24-
$authAttributes = $configStatisticsproxy->getArray('requireAuth.attributes', []);
25-
if ($authAttributes) {
26-
foreach ($authAttributes as $attribute => $values) {
27-
if (!isset($attributes[$attribute])) {
28-
throw new \SimpleSAML\Error\Error('NOACCESS');
29-
}
30-
$currentValues = $attributes[$attribute];
31-
if (
32-
is_array($values[0]) && !array_reduce($values, function ($res, $value) use ($currentValues) {
33-
return $res || empty(array_diff($value, $currentValues));
34-
}, false)
35-
) {
36-
throw new \SimpleSAML\Error\Error('NOACCESS');
37-
}
38-
if (!is_array($values[0]) && empty(array_intersect($currentValues, $values))) {
39-
throw new \SimpleSAML\Error\Error('NOACCESS');
40-
}
41-
}
42-
}
4323
}
4424

4525
$mode = $configStatisticsproxy->getString(MODE, 'PROXY');

0 commit comments

Comments
 (0)