This repository was archived by the owner on Sep 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-20
lines changed
Expand file tree Collapse file tree 2 files changed +3
-20
lines changed Original file line number Diff line number Diff line change 22All 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
Original file line number Diff line number Diff line change 2020if ($ 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 ' );
You can’t perform that action at this time.
0 commit comments