@@ -129,7 +129,7 @@ |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (!is_array($config)) { |
| 132 | - throw new \Exception('Invalid configuration for consent store option: ' . var_export($config, true)); |
|
| 132 | + throw new \Exception('Invalid configuration for consent store option: '.var_export($config, true)); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if (!array_key_exists(0, $config)) { |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | if (array_key_exists('includeValues', $config)) { |
| 89 | 89 | if (!is_bool($config['includeValues'])) { |
| 90 | 90 | throw new \SimpleSAML\Error\Exception( |
| 91 | - 'Consent: includeValues must be boolean. ' . |
|
| 92 | - var_export($config['includeValues'], true) . ' given.' |
|
| 91 | + 'Consent: includeValues must be boolean. '. |
|
| 92 | + var_export($config['includeValues'], true).' given.' |
|
| 93 | 93 | ); |
| 94 | 94 | } |
| 95 | 95 | $this->includeValues = $config['includeValues']; |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | if (array_key_exists('checked', $config)) { |
| 99 | 99 | if (!is_bool($config['checked'])) { |
| 100 | 100 | throw new \SimpleSAML\Error\Exception( |
| 101 | - 'Consent: checked must be boolean. ' . |
|
| 102 | - var_export($config['checked'], true) . ' given.' |
|
| 101 | + 'Consent: checked must be boolean. '. |
|
| 102 | + var_export($config['checked'], true).' given.' |
|
| 103 | 103 | ); |
| 104 | 104 | } |
| 105 | 105 | $this->checked = $config['checked']; |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | if (array_key_exists('focus', $config)) { |
| 109 | 109 | if (!in_array($config['focus'], ['yes', 'no'], true)) { |
| 110 | 110 | throw new \SimpleSAML\Error\Exception( |
| 111 | - 'Consent: focus must be a string with values `yes` or `no`. ' . |
|
| 112 | - var_export($config['focus'], true) . ' given.' |
|
| 111 | + 'Consent: focus must be a string with values `yes` or `no`. '. |
|
| 112 | + var_export($config['focus'], true).' given.' |
|
| 113 | 113 | ); |
| 114 | 114 | } |
| 115 | 115 | $this->focus = $config['focus']; |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | if (array_key_exists('hiddenAttributes', $config)) { |
| 119 | 119 | if (!is_array($config['hiddenAttributes'])) { |
| 120 | 120 | throw new \SimpleSAML\Error\Exception( |
| 121 | - 'Consent: hiddenAttributes must be an array. ' . |
|
| 122 | - var_export($config['hiddenAttributes'], true) . ' given.' |
|
| 121 | + 'Consent: hiddenAttributes must be an array. '. |
|
| 122 | + var_export($config['hiddenAttributes'], true).' given.' |
|
| 123 | 123 | ); |
| 124 | 124 | } |
| 125 | 125 | $this->hiddenAttributes = $config['hiddenAttributes']; |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | if (array_key_exists('attributes.exclude', $config)) { |
| 129 | 129 | if (!is_array($config['attributes.exclude'])) { |
| 130 | 130 | throw new \SimpleSAML\Error\Exception( |
| 131 | - 'Consent: attributes.exclude must be an array. ' . |
|
| 132 | - var_export($config['attributes.exclude'], true) . ' given.' |
|
| 131 | + 'Consent: attributes.exclude must be an array. '. |
|
| 132 | + var_export($config['attributes.exclude'], true).' given.' |
|
| 133 | 133 | ); |
| 134 | 134 | } |
| 135 | 135 | $this->noconsentattributes = $config['attributes.exclude']; |
@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | Logger::warning("The 'noconsentattributes' option has been deprecated in favour of 'attributes.exclude'."); |
| 138 | 138 | if (!is_array($config['noconsentattributes'])) { |
| 139 | 139 | throw new \SimpleSAML\Error\Exception( |
| 140 | - 'Consent: noconsentattributes must be an array. ' . |
|
| 141 | - var_export($config['noconsentattributes'], true) . ' given.' |
|
| 140 | + 'Consent: noconsentattributes must be an array. '. |
|
| 141 | + var_export($config['noconsentattributes'], true).' given.' |
|
| 142 | 142 | ); |
| 143 | 143 | } |
| 144 | 144 | $this->noconsentattributes = $config['noconsentattributes']; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $this->store = \SimpleSAML\Module\consent\Store::parseStoreConfig($config['store']); |
| 150 | 150 | } catch (\Exception $e) { |
| 151 | 151 | Logger::error( |
| 152 | - 'Consent: Could not create consent storage: ' . |
|
| 152 | + 'Consent: Could not create consent storage: '. |
|
| 153 | 153 | $e->getMessage() |
| 154 | 154 | ); |
| 155 | 155 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | isset($state['Source']['consent.disable']) && |
| 269 | 269 | self::checkDisable($state['Source']['consent.disable'], $spEntityId) |
| 270 | 270 | ) { |
| 271 | - Logger::debug('Consent: Consent disabled for entity ' . $spEntityId . ' with IdP ' . $idpEntityId); |
|
| 271 | + Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId); |
|
| 272 | 272 | Stats::log('consent:disabled', $statsData); |
| 273 | 273 | return; |
| 274 | 274 | } |
@@ -276,14 +276,14 @@ discard block |
||
| 276 | 276 | isset($state['Destination']['consent.disable']) && |
| 277 | 277 | self::checkDisable($state['Destination']['consent.disable'], $idpEntityId) |
| 278 | 278 | ) { |
| 279 | - Logger::debug('Consent: Consent disabled for entity ' . $spEntityId . ' with IdP ' . $idpEntityId); |
|
| 279 | + Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId); |
|
| 280 | 280 | Stats::log('consent:disabled', $statsData); |
| 281 | 281 | return; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | if ($this->store !== null) { |
| 285 | - $source = $state['Source']['metadata-set'] . '|' . $idpEntityId; |
|
| 286 | - $destination = $state['Destination']['metadata-set'] . '|' . $spEntityId; |
|
| 285 | + $source = $state['Source']['metadata-set'].'|'.$idpEntityId; |
|
| 286 | + $destination = $state['Destination']['metadata-set'].'|'.$spEntityId; |
|
| 287 | 287 | $attributes = $state['Attributes']; |
| 288 | 288 | |
| 289 | 289 | // Remove attributes that do not require consent |
@@ -293,16 +293,16 @@ discard block |
||
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | - Logger::debug('Consent: userid: ' . $state['UserID']); |
|
| 297 | - Logger::debug('Consent: source: ' . $source); |
|
| 298 | - Logger::debug('Consent: destination: ' . $destination); |
|
| 296 | + Logger::debug('Consent: userid: '.$state['UserID']); |
|
| 297 | + Logger::debug('Consent: source: '.$source); |
|
| 298 | + Logger::debug('Consent: destination: '.$destination); |
|
| 299 | 299 | |
| 300 | 300 | $userId = self::getHashedUserID($state['UserID'], $source); |
| 301 | 301 | $targetedId = self::getTargetedID($state['UserID'], $source, $destination); |
| 302 | 302 | $attributeSet = self::getAttributeHash($attributes, $this->includeValues); |
| 303 | 303 | |
| 304 | 304 | Logger::debug( |
| 305 | - 'Consent: hasConsent() [' . $userId . '|' . $targetedId . '|' . $attributeSet . ']' |
|
| 305 | + 'Consent: hasConsent() ['.$userId.'|'.$targetedId.'|'.$attributeSet.']' |
|
| 306 | 306 | ); |
| 307 | 307 | |
| 308 | 308 | try { |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | $state['consent:store.destination'] = $targetedId; |
| 322 | 322 | $state['consent:store.attributeSet'] = $attributeSet; |
| 323 | 323 | } catch (\Exception $e) { |
| 324 | - Logger::error('Consent: Error reading from storage: ' . $e->getMessage()); |
|
| 324 | + Logger::error('Consent: Error reading from storage: '.$e->getMessage()); |
|
| 325 | 325 | Logger::stats('Consent failed'); |
| 326 | 326 | Stats::log('consent:failed', $statsData); |
| 327 | 327 | } |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | */ |
| 363 | 363 | public static function getHashedUserID($userid, $source) |
| 364 | 364 | { |
| 365 | - return hash('sha1', $userid . '|' . Utils\Config::getSecretSalt() . '|' . $source); |
|
| 365 | + return hash('sha1', $userid.'|'.Utils\Config::getSecretSalt().'|'.$source); |
|
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | */ |
| 378 | 378 | public static function getTargetedID($userid, $source, $destination) |
| 379 | 379 | { |
| 380 | - return hash('sha1', $userid . '|' . Utils\Config::getSecretSalt() . '|' . $source . '|' . $destination); |
|
| 380 | + return hash('sha1', $userid.'|'.Utils\Config::getSecretSalt().'|'.$source.'|'.$destination); |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | $attributeSet = $state['consent:store.attributeSet']; |
| 73 | 73 | |
| 74 | 74 | \SimpleSAML\Logger::debug( |
| 75 | - 'Consent - saveConsent() : [' . $userId . '|' . $targetedId . '|' . $attributeSet . ']' |
|
| 75 | + 'Consent - saveConsent() : ['.$userId.'|'.$targetedId.'|'.$attributeSet.']' |
|
| 76 | 76 | ); |
| 77 | 77 | try { |
| 78 | 78 | $store->saveConsent($userId, $targetedId, $attributeSet); |
| 79 | 79 | } catch (\Exception $e) { |
| 80 | - \SimpleSAML\Logger::error('Consent: Error writing to storage: ' . $e->getMessage()); |
|
| 80 | + \SimpleSAML\Logger::error('Consent: Error writing to storage: '.$e->getMessage()); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
@@ -228,38 +228,38 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | $alternate = ['odd', 'even']; |
| 230 | 230 | $i = 0; |
| 231 | - $summary = 'summary="' . $translator->t('{consent:consent:table_summary}') . '"'; |
|
| 231 | + $summary = 'summary="'.$translator->t('{consent:consent:table_summary}').'"'; |
|
| 232 | 232 | |
| 233 | 233 | if (strlen($nameParent) > 0) { |
| 234 | - $parentStr = strtolower($nameParent) . '_'; |
|
| 235 | - $str = '<table class="attributes" ' . $summary . '>'; |
|
| 234 | + $parentStr = strtolower($nameParent).'_'; |
|
| 235 | + $str = '<table class="attributes" '.$summary.'>'; |
|
| 236 | 236 | } else { |
| 237 | 237 | $parentStr = ''; |
| 238 | - $str = '<table id="table_with_attributes" class="attributes" ' . $summary . '>'; |
|
| 239 | - $str .= "\n" . '<caption>' . $translator->t('{consent:consent:table_caption}') . '</caption>'; |
|
| 238 | + $str = '<table id="table_with_attributes" class="attributes" '.$summary.'>'; |
|
| 239 | + $str .= "\n".'<caption>'.$translator->t('{consent:consent:table_caption}').'</caption>'; |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | foreach ($attributes as $name => $value) { |
| 243 | 243 | $nameraw = $name; |
| 244 | - $name = $translator->getAttributeTranslation($parentStr . $nameraw); |
|
| 244 | + $name = $translator->getAttributeTranslation($parentStr.$nameraw); |
|
| 245 | 245 | |
| 246 | 246 | if (preg_match('/^child_/', $nameraw)) { |
| 247 | 247 | // insert child table |
| 248 | 248 | $parentName = preg_replace('/^child_/', '', $nameraw); |
| 249 | 249 | foreach ($value as $child) { |
| 250 | - $str .= "\n" . '<tr class="odd"><td class="td_odd">' . |
|
| 251 | - present_attributes($t, $child, $parentName) . '</td></tr>'; |
|
| 250 | + $str .= "\n".'<tr class="odd"><td class="td_odd">'. |
|
| 251 | + present_attributes($t, $child, $parentName).'</td></tr>'; |
|
| 252 | 252 | } |
| 253 | 253 | } else { |
| 254 | 254 | // insert values directly |
| 255 | 255 | |
| 256 | - $str .= "\n" . '<tr class="' . $alternate[($i++ % 2)] . |
|
| 257 | - '"><td><span class="attrname">' . htmlspecialchars($name) . '</span></td>'; |
|
| 256 | + $str .= "\n".'<tr class="'.$alternate[($i++ % 2)]. |
|
| 257 | + '"><td><span class="attrname">'.htmlspecialchars($name).'</span></td>'; |
|
| 258 | 258 | |
| 259 | 259 | $isHidden = in_array($nameraw, $t->data['hiddenAttributes'], true); |
| 260 | 260 | if ($isHidden) { |
| 261 | 261 | $hiddenId = \SimpleSAML\Utils\Random::generateID(); |
| 262 | - $str .= '<td><span class="attrvalue hidden" id="hidden_' . $hiddenId . '">'; |
|
| 262 | + $str .= '<td><span class="attrvalue hidden" id="hidden_'.$hiddenId.'">'; |
|
| 263 | 263 | } else { |
| 264 | 264 | $hiddenId = ''; |
| 265 | 265 | $str .= '<td><span class="attrvalue">'; |
@@ -270,18 +270,18 @@ discard block |
||
| 270 | 270 | $str .= '<ul>'; |
| 271 | 271 | foreach ($value as $listitem) { |
| 272 | 272 | if ($nameraw === 'jpegPhoto') { |
| 273 | - $str .= '<li><img src="data:image/jpeg;base64,' . |
|
| 274 | - htmlspecialchars($listitem) . '" alt="User photo" /></li>'; |
|
| 273 | + $str .= '<li><img src="data:image/jpeg;base64,'. |
|
| 274 | + htmlspecialchars($listitem).'" alt="User photo" /></li>'; |
|
| 275 | 275 | } else { |
| 276 | - $str .= '<li>' . htmlspecialchars($listitem) . '</li>'; |
|
| 276 | + $str .= '<li>'.htmlspecialchars($listitem).'</li>'; |
|
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | $str .= '</ul>'; |
| 280 | 280 | } elseif (isset($value[0])) { |
| 281 | 281 | // we hawe only one value |
| 282 | 282 | if ($nameraw === 'jpegPhoto') { |
| 283 | - $str .= '<img src="data:image/jpeg;base64,' . |
|
| 284 | - htmlspecialchars($value[0]) . '" alt="User photo" />'; |
|
| 283 | + $str .= '<img src="data:image/jpeg;base64,'. |
|
| 284 | + htmlspecialchars($value[0]).'" alt="User photo" />'; |
|
| 285 | 285 | } else { |
| 286 | 286 | $str .= htmlspecialchars($value[0]); |
| 287 | 287 | } |
@@ -289,10 +289,10 @@ discard block |
||
| 289 | 289 | $str .= '</span>'; |
| 290 | 290 | |
| 291 | 291 | if ($isHidden) { |
| 292 | - $str .= '<div class="attrvalue consent_showattribute" id="visible_' . $hiddenId . '">'; |
|
| 292 | + $str .= '<div class="attrvalue consent_showattribute" id="visible_'.$hiddenId.'">'; |
|
| 293 | 293 | $str .= '... '; |
| 294 | - $str .= '<a class="consent_showattributelink" href="javascript:SimpleSAML_show(\'hidden_' . $hiddenId; |
|
| 295 | - $str .= '\'); SimpleSAML_hide(\'visible_' . $hiddenId . '\');">'; |
|
| 294 | + $str .= '<a class="consent_showattributelink" href="javascript:SimpleSAML_show(\'hidden_'.$hiddenId; |
|
| 295 | + $str .= '\'); SimpleSAML_hide(\'visible_'.$hiddenId.'\');">'; |
|
| 296 | 296 | $str .= $translator->t('{consent:consent:show_attribute}'); |
| 297 | 297 | $str .= '</a>'; |
| 298 | 298 | $str .= '</div>'; |
@@ -42,19 +42,19 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $cookieName = self::getCookieName($userId, $destinationId); |
| 44 | 44 | |
| 45 | - $data = $userId . ':' . $attributeSet . ':' . $destinationId; |
|
| 45 | + $data = $userId.':'.$attributeSet.':'.$destinationId; |
|
| 46 | 46 | |
| 47 | - \SimpleSAML\Logger::debug('Consent cookie - Get [' . $data . ']'); |
|
| 47 | + \SimpleSAML\Logger::debug('Consent cookie - Get ['.$data.']'); |
|
| 48 | 48 | |
| 49 | 49 | if (!array_key_exists($cookieName, $_COOKIE)) { |
| 50 | 50 | \SimpleSAML\Logger::debug( |
| 51 | - 'Consent cookie - no cookie with name \'' . $cookieName . '\'.' |
|
| 51 | + 'Consent cookie - no cookie with name \''.$cookieName.'\'.' |
|
| 52 | 52 | ); |
| 53 | 53 | return false; |
| 54 | 54 | } |
| 55 | 55 | if (!is_string($_COOKIE[$cookieName])) { |
| 56 | 56 | \SimpleSAML\Logger::warning( |
| 57 | - 'Value of consent cookie wasn\'t a string. Was: ' . |
|
| 57 | + 'Value of consent cookie wasn\'t a string. Was: '. |
|
| 58 | 58 | var_export($_COOKIE[$cookieName], true) |
| 59 | 59 | ); |
| 60 | 60 | return false; |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | public function saveConsent(string $userId, string $destinationId, string $attributeSet) |
| 93 | 93 | { |
| 94 | 94 | $name = self::getCookieName($userId, $destinationId); |
| 95 | - $value = $userId . ':' . $attributeSet . ':' . $destinationId; |
|
| 95 | + $value = $userId.':'.$attributeSet.':'.$destinationId; |
|
| 96 | 96 | |
| 97 | - \SimpleSAML\Logger::debug('Consent cookie - Set [' . $value . ']'); |
|
| 97 | + \SimpleSAML\Logger::debug('Consent cookie - Set ['.$value.']'); |
|
| 98 | 98 | |
| 99 | 99 | $value = self::sign($value); |
| 100 | 100 | return $this->setConsentCookie($name, $value); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $tmp = explode(':', $value, 3); |
| 165 | 165 | if (count($tmp) !== 3) { |
| 166 | 166 | \SimpleSAML\Logger::warning( |
| 167 | - 'Consent cookie with invalid value: ' . $value |
|
| 167 | + 'Consent cookie with invalid value: '.$value |
|
| 168 | 168 | ); |
| 169 | 169 | continue; |
| 170 | 170 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | { |
| 196 | 196 | $secretSalt = \SimpleSAML\Utils\Config::getSecretSalt(); |
| 197 | 197 | |
| 198 | - return sha1($secretSalt . $data . $secretSalt) . ':' . $data; |
|
| 198 | + return sha1($secretSalt.$data.$secretSalt).':'.$data; |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | */ |
| 240 | 240 | private static function getCookieName(string $userId, string $destinationId) |
| 241 | 241 | { |
| 242 | - return '\SimpleSAML\Module\consent:' . sha1($userId . ':' . $destinationId); |
|
| 242 | + return '\SimpleSAML\Module\consent:'.sha1($userId.':'.$destinationId); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | public function hasConsent(string $userId, string $destinationId, string $attributeSet) |
| 170 | 170 | { |
| 171 | 171 | $st = $this->execute( |
| 172 | - 'UPDATE ' . $this->table . ' ' . |
|
| 173 | - 'SET usage_date = ' . $this->dateTime . ' ' . |
|
| 172 | + 'UPDATE '.$this->table.' '. |
|
| 173 | + 'SET usage_date = '.$this->dateTime.' '. |
|
| 174 | 174 | 'WHERE hashed_user_id = ? AND service_id = ? AND attribute = ?', |
| 175 | 175 | [$userId, $destinationId, $attributeSet] |
| 176 | 176 | ); |
@@ -206,8 +206,8 @@ discard block |
||
| 206 | 206 | { |
| 207 | 207 | // Check for old consent (with different attribute set) |
| 208 | 208 | $st = $this->execute( |
| 209 | - 'UPDATE ' . $this->table . ' ' . |
|
| 210 | - 'SET consent_date = ' . $this->dateTime . ', usage_date = ' . $this->dateTime . ', attribute = ? ' . |
|
| 209 | + 'UPDATE '.$this->table.' '. |
|
| 210 | + 'SET consent_date = '.$this->dateTime.', usage_date = '.$this->dateTime.', attribute = ? '. |
|
| 211 | 211 | 'WHERE hashed_user_id = ? AND service_id = ?', |
| 212 | 212 | [$attributeSet, $userId, $destinationId] |
| 213 | 213 | ); |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | // Add new consent |
| 226 | 226 | $st = $this->execute( |
| 227 | - 'INSERT INTO ' . $this->table . ' (' . 'consent_date, usage_date, hashed_user_id, service_id, attribute' . |
|
| 228 | - ') ' . 'VALUES (' . $this->dateTime . ', ' . $this->dateTime . ', ?, ?, ?)', |
|
| 227 | + 'INSERT INTO '.$this->table.' ('.'consent_date, usage_date, hashed_user_id, service_id, attribute'. |
|
| 228 | + ') '.'VALUES ('.$this->dateTime.', '.$this->dateTime.', ?, ?, ?)', |
|
| 229 | 229 | [$userId, $destinationId, $attributeSet] |
| 230 | 230 | ); |
| 231 | 231 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | public function deleteConsent(string $userId, string $destinationId) |
| 250 | 250 | { |
| 251 | 251 | $st = $this->execute( |
| 252 | - 'DELETE FROM ' . $this->table . ' WHERE hashed_user_id = ? AND service_id = ?;', |
|
| 252 | + 'DELETE FROM '.$this->table.' WHERE hashed_user_id = ? AND service_id = ?;', |
|
| 253 | 253 | [$userId, $destinationId] |
| 254 | 254 | ); |
| 255 | 255 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | public function deleteAllConsents(string $userId) |
| 278 | 278 | { |
| 279 | 279 | $st = $this->execute( |
| 280 | - 'DELETE FROM ' . $this->table . ' WHERE hashed_user_id = ?', |
|
| 280 | + 'DELETE FROM '.$this->table.' WHERE hashed_user_id = ?', |
|
| 281 | 281 | [$userId] |
| 282 | 282 | ); |
| 283 | 283 | |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | if ($st->rowCount() > 0) { |
| 289 | - \SimpleSAML\Logger::debug('consent:Database - Deleted (' . $st->rowCount() . ') consent(s) . '); |
|
| 289 | + \SimpleSAML\Logger::debug('consent:Database - Deleted ('.$st->rowCount().') consent(s) . '); |
|
| 290 | 290 | return $st->rowCount(); |
| 291 | 291 | } |
| 292 | 292 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | $ret = []; |
| 310 | 310 | |
| 311 | 311 | $st = $this->execute( |
| 312 | - 'SELECT service_id, attribute, consent_date, usage_date FROM ' . $this->table . |
|
| 312 | + 'SELECT service_id, attribute, consent_date, usage_date FROM '.$this->table. |
|
| 313 | 313 | ' WHERE hashed_user_id = ?', |
| 314 | 314 | [$userId] |
| 315 | 315 | ); |
@@ -348,16 +348,16 @@ discard block |
||
| 348 | 348 | $st = $db->prepare($statement); |
| 349 | 349 | if ($st === false) { |
| 350 | 350 | \SimpleSAML\Logger::error( |
| 351 | - 'consent:Database - Error preparing statement \'' . |
|
| 352 | - $statement . '\': ' . self::formatError($db->errorInfo()) |
|
| 351 | + 'consent:Database - Error preparing statement \''. |
|
| 352 | + $statement.'\': '.self::formatError($db->errorInfo()) |
|
| 353 | 353 | ); |
| 354 | 354 | return false; |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | if ($st->execute($parameters) !== true) { |
| 358 | 358 | \SimpleSAML\Logger::error( |
| 359 | - 'consent:Database - Error executing statement \'' . |
|
| 360 | - $statement . '\': ' . self::formatError($st->errorInfo()) |
|
| 359 | + 'consent:Database - Error executing statement \''. |
|
| 360 | + $statement.'\': '.self::formatError($st->errorInfo()) |
|
| 361 | 361 | ); |
| 362 | 362 | return false; |
| 363 | 363 | } |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $ret = []; |
| 382 | 382 | |
| 383 | 383 | // Get total number of consents |
| 384 | - $st = $this->execute('SELECT COUNT(*) AS no FROM ' . $this->table, []); |
|
| 384 | + $st = $this->execute('SELECT COUNT(*) AS no FROM '.$this->table, []); |
|
| 385 | 385 | |
| 386 | 386 | if ($st === false) { |
| 387 | 387 | return []; |
@@ -393,8 +393,8 @@ discard block |
||
| 393 | 393 | |
| 394 | 394 | // Get total number of users that has given consent |
| 395 | 395 | $st = $this->execute( |
| 396 | - 'SELECT COUNT(*) AS no ' . |
|
| 397 | - 'FROM (SELECT DISTINCT hashed_user_id FROM ' . $this->table . ' ) AS foo', |
|
| 396 | + 'SELECT COUNT(*) AS no '. |
|
| 397 | + 'FROM (SELECT DISTINCT hashed_user_id FROM '.$this->table.' ) AS foo', |
|
| 398 | 398 | [] |
| 399 | 399 | ); |
| 400 | 400 | |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | |
| 409 | 409 | // Get total number of services that has been given consent to |
| 410 | 410 | $st = $this->execute( |
| 411 | - 'SELECT COUNT(*) AS no FROM (SELECT DISTINCT service_id FROM ' . $this->table . ') AS foo', |
|
| 411 | + 'SELECT COUNT(*) AS no FROM (SELECT DISTINCT service_id FROM '.$this->table.') AS foo', |
|
| 412 | 412 | [] |
| 413 | 413 | ); |
| 414 | 414 | |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | { |
| 465 | 465 | Assert::greaterThanEq(count($error), 3); |
| 466 | 466 | |
| 467 | - return $error[0] . ' - ' . $error[2] . ' (' . $error[1] . ')'; |
|
| 467 | + return $error[0].' - '.$error[2].' ('.$error[1].')'; |
|
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | public function selftest() |
| 477 | 477 | { |
| 478 | 478 | $st = $this->execute( |
| 479 | - 'SELECT * FROM ' . $this->table . ' WHERE hashed_user_id = ? AND service_id = ? AND attribute = ?', |
|
| 479 | + 'SELECT * FROM '.$this->table.' WHERE hashed_user_id = ? AND service_id = ? AND attribute = ?', |
|
| 480 | 480 | ['test', 'test', 'test'] |
| 481 | 481 | ); |
| 482 | 482 | |