@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'statrules' => [ |
97 | 97 | 'sloratio' => [ |
98 | 98 | 'name' => 'SLO to SSO ratio', |
99 | - 'descr' => 'Comparison of the number of Single Log-Out compared to Single Sign-On.' . |
|
99 | + 'descr' => 'Comparison of the number of Single Log-Out compared to Single Sign-On.'. |
|
100 | 100 | ' Graph shows how many logouts where initiated for each Single Sign-On.', |
101 | 101 | 'type' => 'calculated', |
102 | 102 | 'presenter' => 'statistics:Ratio', |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | ], |
109 | 109 | 'ssomulti' => [ |
110 | 110 | 'name' => 'Requests per session', |
111 | - 'descr' => 'Number of SSO request pairs exchanged between IdP and SP within the same IdP session.' . |
|
111 | + 'descr' => 'Number of SSO request pairs exchanged between IdP and SP within the same IdP session.'. |
|
112 | 112 | ' A high number indicates that the session at the SP is timing out faster than at the IdP.', |
113 | 113 | 'type' => 'calculated', |
114 | 114 | 'presenter' => 'statistics:Ratio', |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | ], |
151 | 151 | 'consent' => [ |
152 | 152 | 'name' => 'Consent', |
153 | - 'descr' => 'Consent statistics. Everytime a user logs in to a service an entry is logged for' . |
|
153 | + 'descr' => 'Consent statistics. Everytime a user logs in to a service an entry is logged for'. |
|
154 | 154 | ' one of three states: consent was found, consent was not found or consent storage was not available.', |
155 | 155 | 'action' => 'consent', |
156 | 156 | 'col' => 6, |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | ], |
162 | 162 | 'consentresponse' => [ |
163 | 163 | 'name' => 'Consent response', |
164 | - 'descr' => 'Consent response statistics. Everytime a user accepts consent,' . |
|
164 | + 'descr' => 'Consent response statistics. Everytime a user accepts consent,'. |
|
165 | 165 | ' it is logged whether the user selected to remember the consent to next time.', |
166 | 166 | 'action' => 'consentResponse', |
167 | 167 | 'col' => 6, |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $data = $dataset->getDebugData(); |
161 | 161 | foreach ($data as $de) { |
162 | 162 | if (isset($de[1])) { |
163 | - echo '"' . $de[0] . '",' . $de[1] . "\n"; |
|
163 | + echo '"'.$de[0].'",'.$de[1]."\n"; |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | exit; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | } |
239 | 239 | if ($type === 'get') { |
240 | - return Module::getModuleURL("statistics/showstats.php") . '?' . http_build_query($vars, '', '&'); |
|
240 | + return Module::getModuleURL("statistics/showstats.php").'?'.http_build_query($vars, '', '&'); |
|
241 | 241 | } |
242 | 242 | return $vars; |
243 | 243 | } |
@@ -57,6 +57,6 @@ |
||
57 | 57 | { |
58 | 58 | $month = ($from % 12) + 1; |
59 | 59 | $year = 2000 + intval(floor($from / 12)); |
60 | - return $year . '-' . $month; |
|
60 | + return $year.'-'.$month; |
|
61 | 61 | } |
62 | 62 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $as->requireAuth(); |
56 | 56 | |
57 | 57 | // User logged in with auth source. |
58 | - Logger::debug('Statistics auth - valid login with auth source [' . $authsource . ']'); |
|
58 | + Logger::debug('Statistics auth - valid login with auth source ['.$authsource.']'); |
|
59 | 59 | |
60 | 60 | // Retrieving attributes |
61 | 61 | $attributes = $as->getAttributes(); |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | // Check if userid is allowed access.. |
70 | 70 | if (in_array($attributes[$useridattr][0], $allowedusers, true)) { |
71 | 71 | Logger::debug( |
72 | - 'Statistics auth - User granted access by user ID [' . $attributes[$useridattr][0] . ']' |
|
72 | + 'Statistics auth - User granted access by user ID ['.$attributes[$useridattr][0].']' |
|
73 | 73 | ); |
74 | 74 | return; |
75 | 75 | } |
76 | 76 | Logger::debug( |
77 | - 'Statistics auth - User denied access by user ID [' . $attributes[$useridattr][0] . ']' |
|
77 | + 'Statistics auth - User denied access by user ID ['.$attributes[$useridattr][0].']' |
|
78 | 78 | ); |
79 | 79 | } else { |
80 | 80 | Logger::debug('Statistics auth - no allowedUsers list.'); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | try { |
18 | 18 | $statconfig = Configuration::getConfig('module_statistics.php'); |
19 | 19 | } catch (Exception $e) { |
20 | - $hookinfo['errors'][] = '[statistics] Could not get configuration: ' . $e->getMessage(); |
|
20 | + $hookinfo['errors'][] = '[statistics] Could not get configuration: '.$e->getMessage(); |
|
21 | 21 | return; |
22 | 22 | } |
23 | 23 | |
@@ -25,19 +25,19 @@ discard block |
||
25 | 25 | $inputfile = $statconfig->getValue('inputfile'); |
26 | 26 | |
27 | 27 | if (file_exists($statdir)) { |
28 | - $hookinfo['info'][] = '[statistics] Statistics dir [' . $statdir . '] exists'; |
|
28 | + $hookinfo['info'][] = '[statistics] Statistics dir ['.$statdir.'] exists'; |
|
29 | 29 | if (is_writable($statdir)) { |
30 | - $hookinfo['info'][] = '[statistics] Statistics dir [' . $statdir . '] is writable'; |
|
30 | + $hookinfo['info'][] = '[statistics] Statistics dir ['.$statdir.'] is writable'; |
|
31 | 31 | } else { |
32 | - $hookinfo['errors'][] = '[statistics] Statistics dir [' . $statdir . '] is not writable'; |
|
32 | + $hookinfo['errors'][] = '[statistics] Statistics dir ['.$statdir.'] is not writable'; |
|
33 | 33 | } |
34 | 34 | } else { |
35 | - $hookinfo['errors'][] = '[statistics] Statistics dir [' . $statdir . '] does not exist'; |
|
35 | + $hookinfo['errors'][] = '[statistics] Statistics dir ['.$statdir.'] does not exist'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | if (file_exists($inputfile)) { |
39 | - $hookinfo['info'][] = '[statistics] Input file [' . $inputfile . '] exists'; |
|
39 | + $hookinfo['info'][] = '[statistics] Input file ['.$inputfile.'] exists'; |
|
40 | 40 | } else { |
41 | - $hookinfo['errors'][] = '[statistics] Input file [' . $inputfile . '] does not exist'; |
|
41 | + $hookinfo['errors'][] = '[statistics] Input file ['.$inputfile.'] does not exist'; |
|
42 | 42 | } |
43 | 43 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $aggregator->store($results); |
41 | 41 | } |
42 | 42 | } catch (Exception $e) { |
43 | - $message = 'Loganalyzer threw exception: ' . $e->getMessage(); |
|
43 | + $message = 'Loganalyzer threw exception: '.$e->getMessage(); |
|
44 | 44 | Logger::warning($message); |
45 | 45 | $croninfo['summary'][] = $message; |
46 | 46 | } |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | 'Statistics\FieldPresentation' |
346 | 346 | ); |
347 | 347 | if (!class_exists($classname)) { |
348 | - throw new Exception('Could not find field presentation plugin [' . $classname . ']: No class found'); |
|
348 | + throw new Exception('Could not find field presentation plugin ['.$classname.']: No class found'); |
|
349 | 349 | } |
350 | 350 | $presentationHandler = new $classname($availdelimiters, $fieldpresConfig->getValue('config'), $t); |
351 | 351 | |
@@ -387,17 +387,17 @@ discard block |
||
387 | 387 | $rules = Arrays::arrayize($this->ruleid); |
388 | 388 | foreach ($rules as $rule) { |
389 | 389 | // Get file and extract results. |
390 | - $resultFileName = $statdir . '/' . $rule . '-' . $this->timeres . '-' . $this->fileslot . '.stat'; |
|
390 | + $resultFileName = $statdir.'/'.$rule.'-'.$this->timeres.'-'.$this->fileslot.'.stat'; |
|
391 | 391 | if (!file_exists($resultFileName)) { |
392 | - throw new Exception('Aggregated statitics file [' . $resultFileName . '] not found.'); |
|
392 | + throw new Exception('Aggregated statitics file ['.$resultFileName.'] not found.'); |
|
393 | 393 | } |
394 | 394 | if (!is_readable($resultFileName)) { |
395 | - throw new Exception('Could not read statitics file [' . $resultFileName . ']. Bad file permissions?'); |
|
395 | + throw new Exception('Could not read statitics file ['.$resultFileName.']. Bad file permissions?'); |
|
396 | 396 | } |
397 | 397 | $resultfile = file_get_contents($resultFileName); |
398 | 398 | $newres = unserialize($resultfile); |
399 | 399 | if (empty($newres)) { |
400 | - throw new Exception('Aggregated statistics in file [' . $resultFileName . '] was empty.'); |
|
400 | + throw new Exception('Aggregated statistics in file ['.$resultFileName.'] was empty.'); |
|
401 | 401 | } |
402 | 402 | $resarray[] = $newres; |
403 | 403 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * Walk through file lists, and get available [rule][fileslot]... |
52 | 52 | */ |
53 | 53 | if (!is_dir($statdir)) { |
54 | - throw new Exception('Statisics output directory [' . $statdir . '] does not exist.'); |
|
54 | + throw new Exception('Statisics output directory ['.$statdir.'] does not exist.'); |
|
55 | 55 | } |
56 | 56 | $filelist = scandir($statdir); |
57 | 57 | $this->available = []; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } |
66 | 66 | } |
67 | 67 | if (empty($this->available)) { |
68 | - throw new Exception('No aggregated statistics files found in [' . $statdir . ']'); |
|
68 | + throw new Exception('No aggregated statistics files found in ['.$statdir.']'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function dumpConfig(): void |
66 | 66 | { |
67 | - echo 'Statistics directory : ' . $this->statdir . "\n"; |
|
68 | - echo 'Input file : ' . $this->inputfile . "\n"; |
|
69 | - echo 'Offset : ' . $this->offset . "\n"; |
|
67 | + echo 'Statistics directory : '.$this->statdir."\n"; |
|
68 | + echo 'Input file : '.$this->inputfile."\n"; |
|
69 | + echo 'Offset : '.$this->offset."\n"; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function debugInfo(): void |
77 | 77 | { |
78 | 78 | // 1024*1024=1048576 |
79 | - echo 'Memory usage : ' . number_format(memory_get_usage() / 1048576, 2) . " MB\n"; |
|
79 | + echo 'Memory usage : '.number_format(memory_get_usage() / 1048576, 2)." MB\n"; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function loadMetadata(): void |
87 | 87 | { |
88 | - $filename = $this->statdir . '/.stat.metadata'; |
|
88 | + $filename = $this->statdir.'/.stat.metadata'; |
|
89 | 89 | $metadata = null; |
90 | 90 | if (file_exists($filename)) { |
91 | 91 | $metadata = unserialize(file_get_contents($filename)); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $this->metadata['memory'] = memory_get_usage(); |
113 | 113 | $this->metadata['lastrun'] = time(); |
114 | 114 | |
115 | - $filename = $this->statdir . '/.stat.metadata'; |
|
115 | + $filename = $this->statdir.'/.stat.metadata'; |
|
116 | 116 | file_put_contents($filename, serialize($this->metadata), LOCK_EX); |
117 | 117 | } |
118 | 118 | |
@@ -127,17 +127,17 @@ discard block |
||
127 | 127 | $this->loadMetadata(); |
128 | 128 | |
129 | 129 | if (!is_dir($this->statdir)) { |
130 | - throw new Exception('Statistics module: output dir does not exist [' . $this->statdir . ']'); |
|
130 | + throw new Exception('Statistics module: output dir does not exist ['.$this->statdir.']'); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | if (!file_exists($this->inputfile)) { |
134 | - throw new Exception('Statistics module: input file does not exist [' . $this->inputfile . ']'); |
|
134 | + throw new Exception('Statistics module: input file does not exist ['.$this->inputfile.']'); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | $file = fopen($this->inputfile, 'r'); |
138 | 138 | |
139 | 139 | if ($file === false) { |
140 | - throw new Exception('Statistics module: unable to open file [' . $this->inputfile . ']'); |
|
140 | + throw new Exception('Statistics module: unable to open file ['.$this->inputfile.']'); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | $logparser = new LogParser( |
@@ -182,14 +182,14 @@ discard block |
||
182 | 182 | $action = trim($content[5]); |
183 | 183 | |
184 | 184 | if ($this->fromcmdline && ($i % 10000) == 0) { |
185 | - echo "Read line " . $i . "\n"; |
|
185 | + echo "Read line ".$i."\n"; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | if ($debug) { |
189 | 189 | echo "----------------------------------------\n"; |
190 | - echo 'Log line: ' . $logline . "\n"; |
|
191 | - echo 'Date parse [' . substr($logline, 0, $this->statconfig->getValue('datelength', 15)) . |
|
192 | - '] to [' . date(DATE_RFC822, $epoch) . ']' . "\n"; |
|
190 | + echo 'Log line: '.$logline."\n"; |
|
191 | + echo 'Date parse ['.substr($logline, 0, $this->statconfig->getValue('datelength', 15)). |
|
192 | + '] to ['.date(DATE_RFC822, $epoch).']'."\n"; |
|
193 | 193 | /** @var string $ret */ |
194 | 194 | $ret = print_r($content, true); |
195 | 195 | echo htmlentities($ret); |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | } |
363 | 363 | } |
364 | 364 | |
365 | - $filename = $this->statdir . '/' . $rulename . '-' . $tres . '-' . $fileno . '.stat'; |
|
365 | + $filename = $this->statdir.'/'.$rulename.'-'.$tres.'-'.$fileno.'.stat'; |
|
366 | 366 | if (file_exists($filename)) { |
367 | 367 | $previousData = unserialize(file_get_contents($filename)); |
368 | 368 | $filledresult = $this->cummulateData($previousData, $filledresult); |