@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | $this->user = $user; |
| 81 | 81 | $this->request = $request; |
| 82 | 82 | $this->template = $template; |
| 83 | - $this->root_path= $root_path; |
|
| 83 | + $this->root_path = $root_path; |
|
| 84 | 84 | |
| 85 | - $this->registration_table = $registration_table; |
|
| 85 | + $this->registration_table = $registration_table; |
|
| 86 | 86 | |
| 87 | - $this->u2f = new \paul999\u2f\U2F('https://' . $this->request->server('HTTP_HOST')); |
|
| 87 | + $this->u2f = new \paul999\u2f\U2F('https://'.$this->request->server('HTTP_HOST')); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | return false; |
| 118 | 118 | } |
| 119 | 119 | $sql = 'SELECT COUNT(registration_id) as reg_id |
| 120 | - FROM ' . $this->registration_table . ' |
|
| 120 | + FROM ' . $this->registration_table.' |
|
| 121 | 121 | WHERE |
| 122 | 122 | user_id = ' . (int) $user_id; |
| 123 | 123 | $result = $this->db->sql_query($sql); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function is_potentially_usable($user_id = false) |
| 140 | 140 | { |
| 141 | - $browsercap = new Browscap($this->root_path . 'cache/'); |
|
| 141 | + $browsercap = new Browscap($this->root_path.'cache/'); |
|
| 142 | 142 | $info = $browsercap->getBrowser($this->request->server('HTTP_USER_AGENT')); |
| 143 | 143 | return $info->Browser === 'chrome' && $this->is_ssl(); |
| 144 | 144 | } |
@@ -191,9 +191,9 @@ discard block |
||
| 191 | 191 | 'u2f_request' => $registrations |
| 192 | 192 | ); |
| 193 | 193 | |
| 194 | - $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
| 194 | + $sql = 'UPDATE '.SESSIONS_TABLE.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).' |
|
| 195 | 195 | WHERE |
| 196 | - session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND |
|
| 196 | + session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND |
|
| 197 | 197 | session_user_id = ' . (int) $this->user->data['user_id']; |
| 198 | 198 | $this->db->sql_query($sql); |
| 199 | 199 | $count = $this->db->sql_affectedrows(); |
@@ -204,9 +204,9 @@ discard block |
||
| 204 | 204 | { |
| 205 | 205 | // Reset sessions table. We had multiple sessions with same ID!!! |
| 206 | 206 | $sql_ary['u2f_request'] = ''; |
| 207 | - $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
| 207 | + $sql = 'UPDATE '.SESSIONS_TABLE.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).' |
|
| 208 | 208 | WHERE |
| 209 | - session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND |
|
| 209 | + session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND |
|
| 210 | 210 | session_user_id = ' . (int) $this->user->data['user_id']; |
| 211 | 211 | $this->db->sql_query($sql); |
| 212 | 212 | } |
@@ -226,9 +226,9 @@ discard block |
||
| 226 | 226 | try |
| 227 | 227 | { |
| 228 | 228 | $sql = 'SELECT u2f_request |
| 229 | - FROM ' . SESSIONS_TABLE . ' |
|
| 229 | + FROM ' . SESSIONS_TABLE.' |
|
| 230 | 230 | WHERE |
| 231 | - session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND |
|
| 231 | + session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND |
|
| 232 | 232 | session_user_id = ' . (int) $this->user->data['user_id']; |
| 233 | 233 | $result = $this->db->sql_query($sql); |
| 234 | 234 | $row = $this->db->sql_fetchrow($result); |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | 'last_used' => time(), |
| 259 | 259 | ); |
| 260 | 260 | |
| 261 | - $sql = 'UPDATE ' . $this->registration_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE registration_id = ' . (int) $reg->getId(); |
|
| 261 | + $sql = 'UPDATE '.$this->registration_table.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).' WHERE registration_id = '.(int) $reg->getId(); |
|
| 262 | 262 | $this->db->sql_query($sql); |
| 263 | 263 | } |
| 264 | 264 | catch (U2fError $error) |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | catch (\InvalidArgumentException $invalid) |
| 269 | 269 | { |
| 270 | - throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG') . '<br />' . $invalid->getMessage(), $invalid); |
|
| 270 | + throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG').'<br />'.$invalid->getMessage(), $invalid); |
|
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | 'last_used' => time(), |
| 343 | 343 | ); |
| 344 | 344 | |
| 345 | - $sql = 'INSERT INTO ' . $this->registration_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); |
|
| 345 | + $sql = 'INSERT INTO '.$this->registration_table.' '.$this->db->sql_build_array('INSERT', $sql_ary); |
|
| 346 | 346 | $this->db->sql_query($sql); |
| 347 | 347 | |
| 348 | 348 | $sql_ary = array( |
@@ -364,8 +364,8 @@ discard block |
||
| 364 | 364 | public function show_ucp() |
| 365 | 365 | { |
| 366 | 366 | $sql = 'SELECT * |
| 367 | - FROM ' . $this->registration_table . ' |
|
| 368 | - WHERE user_id = ' . (int) $this->user->data['user_id'] . ' |
|
| 367 | + FROM ' . $this->registration_table.' |
|
| 368 | + WHERE user_id = ' . (int) $this->user->data['user_id'].' |
|
| 369 | 369 | ORDER BY registration_id ASC'; |
| 370 | 370 | |
| 371 | 371 | $result = $this->db->sql_query($sql); |
@@ -403,8 +403,8 @@ discard block |
||
| 403 | 403 | if (isset($data['keys'])) |
| 404 | 404 | { |
| 405 | 405 | $sql_where = $this->db->sql_in_set('registration_id', $data['keys']); |
| 406 | - $sql = 'DELETE FROM ' . $this->registration_table . ' |
|
| 407 | - WHERE user_id = ' . (int) $this->user->data['user_id'] . ' |
|
| 406 | + $sql = 'DELETE FROM '.$this->registration_table.' |
|
| 407 | + WHERE user_id = ' . (int) $this->user->data['user_id'].' |
|
| 408 | 408 | AND ' . $sql_where; |
| 409 | 409 | |
| 410 | 410 | $this->db->sql_query($sql); |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | */ |
| 438 | 438 | private function getRegistrations($user_id) |
| 439 | 439 | { |
| 440 | - $sql = 'SELECT * FROM ' . $this->registration_table . ' WHERE user_id = ' . (int) $user_id; |
|
| 440 | + $sql = 'SELECT * FROM '.$this->registration_table.' WHERE user_id = '.(int) $user_id; |
|
| 441 | 441 | $result = $this->db->sql_query($sql); |
| 442 | 442 | $rows = array(); |
| 443 | 443 | |
@@ -525,9 +525,9 @@ discard block |
||
| 525 | 525 | */ |
| 526 | 526 | private function update_session($sql_ary) |
| 527 | 527 | { |
| 528 | - $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
| 528 | + $sql = 'UPDATE '.SESSIONS_TABLE.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).' |
|
| 529 | 529 | WHERE |
| 530 | - session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND |
|
| 530 | + session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND |
|
| 531 | 531 | session_user_id = ' . (int) $this->user->data['user_id']; |
| 532 | 532 | $this->db->sql_query($sql); |
| 533 | 533 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | { |
| 103 | 103 | $module->register(); |
| 104 | 104 | meta_refresh(3, $this->u_action); |
| 105 | - $message = $this->user->lang['TFA_KEY_ADDED'] . '<br /><br />' . sprintf($this->user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); |
|
| 105 | + $message = $this->user->lang['TFA_KEY_ADDED'].'<br /><br />'.sprintf($this->user->lang['RETURN_UCP'], '<a href="'.$this->u_action.'">', '</a>'); |
|
| 106 | 106 | trigger_error($message); |
| 107 | 107 | } |
| 108 | 108 | if ($module->can_register()) |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | meta_refresh(3, $this->u_action); |
| 230 | - $message = $this->user->lang['TFA_KEYS_DELETED'] . '<br /><br />' . sprintf($this->user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); |
|
| 230 | + $message = $this->user->lang['TFA_KEYS_DELETED'].'<br /><br />'.sprintf($this->user->lang['RETURN_UCP'], '<a href="'.$this->u_action.'">', '</a>'); |
|
| 231 | 231 | trigger_error($message); |
| 232 | 232 | } |
| 233 | 233 | } |