@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | if (array_key_exists('includeValues', $config)) { |
98 | 98 | if (!is_bool($config['includeValues'])) { |
99 | 99 | throw new Error\Exception( |
100 | - 'Consent: includeValues must be boolean. ' . |
|
101 | - var_export($config['includeValues'], true) . ' given.' |
|
100 | + 'Consent: includeValues must be boolean. '. |
|
101 | + var_export($config['includeValues'], true).' given.' |
|
102 | 102 | ); |
103 | 103 | } |
104 | 104 | $this->includeValues = $config['includeValues']; |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | if (array_key_exists('checked', $config)) { |
108 | 108 | if (!is_bool($config['checked'])) { |
109 | 109 | throw new Error\Exception( |
110 | - 'Consent: checked must be boolean. ' . |
|
111 | - var_export($config['checked'], true) . ' given.' |
|
110 | + 'Consent: checked must be boolean. '. |
|
111 | + var_export($config['checked'], true).' given.' |
|
112 | 112 | ); |
113 | 113 | } |
114 | 114 | $this->checked = $config['checked']; |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | if (array_key_exists('focus', $config)) { |
118 | 118 | if (!in_array($config['focus'], ['yes', 'no'], true)) { |
119 | 119 | throw new Error\Exception( |
120 | - 'Consent: focus must be a string with values `yes` or `no`. ' . |
|
121 | - var_export($config['focus'], true) . ' given.' |
|
120 | + 'Consent: focus must be a string with values `yes` or `no`. '. |
|
121 | + var_export($config['focus'], true).' given.' |
|
122 | 122 | ); |
123 | 123 | } |
124 | 124 | $this->focus = $config['focus']; |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | if (array_key_exists('hiddenAttributes', $config)) { |
128 | 128 | if (!is_array($config['hiddenAttributes'])) { |
129 | 129 | throw new Error\Exception( |
130 | - 'Consent: hiddenAttributes must be an array. ' . |
|
131 | - var_export($config['hiddenAttributes'], true) . ' given.' |
|
130 | + 'Consent: hiddenAttributes must be an array. '. |
|
131 | + var_export($config['hiddenAttributes'], true).' given.' |
|
132 | 132 | ); |
133 | 133 | } |
134 | 134 | $this->hiddenAttributes = $config['hiddenAttributes']; |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | if (array_key_exists('attributes.exclude', $config)) { |
138 | 138 | if (!is_array($config['attributes.exclude'])) { |
139 | 139 | throw new Error\Exception( |
140 | - 'Consent: attributes.exclude must be an array. ' . |
|
141 | - var_export($config['attributes.exclude'], true) . ' given.' |
|
140 | + 'Consent: attributes.exclude must be an array. '. |
|
141 | + var_export($config['attributes.exclude'], true).' given.' |
|
142 | 142 | ); |
143 | 143 | } |
144 | 144 | $this->noconsentattributes = $config['attributes.exclude']; |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | Logger::warning("The 'noconsentattributes' option has been deprecated in favour of 'attributes.exclude'."); |
147 | 147 | if (!is_array($config['noconsentattributes'])) { |
148 | 148 | throw new Error\Exception( |
149 | - 'Consent: noconsentattributes must be an array. ' . |
|
150 | - var_export($config['noconsentattributes'], true) . ' given.' |
|
149 | + 'Consent: noconsentattributes must be an array. '. |
|
150 | + var_export($config['noconsentattributes'], true).' given.' |
|
151 | 151 | ); |
152 | 152 | } |
153 | 153 | $this->noconsentattributes = $config['noconsentattributes']; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $this->store = \SimpleSAML\Module\consent\Store::parseStoreConfig($config['store']); |
159 | 159 | } catch (Exception $e) { |
160 | 160 | Logger::error( |
161 | - 'Consent: Could not create consent storage: ' . |
|
161 | + 'Consent: Could not create consent storage: '. |
|
162 | 162 | $e->getMessage() |
163 | 163 | ); |
164 | 164 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | isset($state['Source']['consent.disable']) && |
279 | 279 | self::checkDisable($state['Source']['consent.disable'], $spEntityId) |
280 | 280 | ) { |
281 | - Logger::debug('Consent: Consent disabled for entity ' . $spEntityId . ' with IdP ' . $idpEntityId); |
|
281 | + Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId); |
|
282 | 282 | Stats::log('consent:disabled', $statsData); |
283 | 283 | return; |
284 | 284 | } |
@@ -286,14 +286,14 @@ discard block |
||
286 | 286 | isset($state['Destination']['consent.disable']) && |
287 | 287 | self::checkDisable($state['Destination']['consent.disable'], $idpEntityId) |
288 | 288 | ) { |
289 | - Logger::debug('Consent: Consent disabled for entity ' . $spEntityId . ' with IdP ' . $idpEntityId); |
|
289 | + Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId); |
|
290 | 290 | Stats::log('consent:disabled', $statsData); |
291 | 291 | return; |
292 | 292 | } |
293 | 293 | |
294 | 294 | if ($this->store !== null) { |
295 | - $source = $state['Source']['metadata-set'] . '|' . $idpEntityId; |
|
296 | - $destination = $state['Destination']['metadata-set'] . '|' . $spEntityId; |
|
295 | + $source = $state['Source']['metadata-set'].'|'.$idpEntityId; |
|
296 | + $destination = $state['Destination']['metadata-set'].'|'.$spEntityId; |
|
297 | 297 | $attributes = $state['Attributes']; |
298 | 298 | Assert::keyExists($attributes, $this->identifyingAttribute, "No attribute '%s' was found in the user's attributes."); |
299 | 299 | |
@@ -304,16 +304,16 @@ discard block |
||
304 | 304 | } |
305 | 305 | } |
306 | 306 | |
307 | - Logger::debug('Consent: userid: ' . $attributes[$this->identifyingAttribute]); |
|
308 | - Logger::debug('Consent: source: ' . $source); |
|
309 | - Logger::debug('Consent: destination: ' . $destination); |
|
307 | + Logger::debug('Consent: userid: '.$attributes[$this->identifyingAttribute]); |
|
308 | + Logger::debug('Consent: source: '.$source); |
|
309 | + Logger::debug('Consent: destination: '.$destination); |
|
310 | 310 | |
311 | 311 | $userId = self::getHashedUserID($attributes[$this->identifyingAttribute], $source); |
312 | 312 | $targetedId = self::getTargetedID($userid, $source, $destination); |
313 | 313 | $attributeSet = self::getAttributeHash($attributes, $this->includeValues); |
314 | 314 | |
315 | 315 | Logger::debug( |
316 | - 'Consent: hasConsent() [' . $userId . '|' . $targetedId . '|' . $attributeSet . ']' |
|
316 | + 'Consent: hasConsent() ['.$userId.'|'.$targetedId.'|'.$attributeSet.']' |
|
317 | 317 | ); |
318 | 318 | |
319 | 319 | try { |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $state['consent:store.destination'] = $targetedId; |
333 | 333 | $state['consent:store.attributeSet'] = $attributeSet; |
334 | 334 | } catch (\Exception $e) { |
335 | - Logger::error('Consent: Error reading from storage: ' . $e->getMessage()); |
|
335 | + Logger::error('Consent: Error reading from storage: '.$e->getMessage()); |
|
336 | 336 | Logger::stats('Consent failed'); |
337 | 337 | Stats::log('consent:failed', $statsData); |
338 | 338 | } |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | */ |
374 | 374 | public static function getHashedUserID(string $userid, string $source): string |
375 | 375 | { |
376 | - return hash('sha1', $userid . '|' . Utils\Config::getSecretSalt() . '|' . $source); |
|
376 | + return hash('sha1', $userid.'|'.Utils\Config::getSecretSalt().'|'.$source); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | */ |
389 | 389 | public static function getTargetedID(string $userid, string $source, string $destination): string |
390 | 390 | { |
391 | - return hash('sha1', $userid . '|' . Utils\Config::getSecretSalt() . '|' . $source . '|' . $destination); |
|
391 | + return hash('sha1', $userid.'|'.Utils\Config::getSecretSalt().'|'.$source.'|'.$destination); |
|
392 | 392 | } |
393 | 393 | |
394 | 394 |