@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | public function is_usable($user_id) |
| 123 | 123 | { |
| 124 | 124 | $sql = 'SELECT COUNT(registration_id) as reg_id |
| 125 | - FROM ' . $this->otp_registration_table . ' |
|
| 125 | + FROM ' . $this->otp_registration_table.' |
|
| 126 | 126 | WHERE |
| 127 | 127 | user_id = ' . (int) $user_id; |
| 128 | 128 | $result = $this->db->sql_query($sql); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $secret = $this->otp->generateSecret(); |
| 207 | 207 | $QR = $this->otp_helper->generateKeyURI('totp', $secret, generate_board_url()); |
| 208 | 208 | $this->template->assign_vars(array( |
| 209 | - 'TFA_QR_CODE' => 'https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=' . $QR, |
|
| 209 | + 'TFA_QR_CODE' => 'https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl='.$QR, |
|
| 210 | 210 | 'TFA_SECRET' => $secret, |
| 211 | 211 | 'L_TFA_ADD_OTP_KEY_EXPLAIN' => $this->user->lang('TFA_ADD_OTP_KEY_EXPLAIN', $secret), |
| 212 | 212 | 'S_HIDDEN_FIELDS' => build_hidden_fields(array( |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | public function register() |
| 227 | 227 | { |
| 228 | 228 | $secret = $this->request->variable('secret', ''); |
| 229 | - $otp = $this->request->variable('otp', ''); |
|
| 229 | + $otp = $this->request->variable('otp', ''); |
|
| 230 | 230 | |
| 231 | 231 | if (!$this->otp->checkTOTP($secret, $otp)) |
| 232 | 232 | { |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | 'last_used' => time(), |
| 241 | 241 | ); |
| 242 | 242 | |
| 243 | - $sql = 'INSERT INTO ' . $this->otp_registration_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); |
|
| 243 | + $sql = 'INSERT INTO '.$this->otp_registration_table.' '.$this->db->sql_build_array('INSERT', $sql_ary); |
|
| 244 | 244 | $this->db->sql_query($sql); |
| 245 | 245 | } |
| 246 | 246 | |
@@ -263,8 +263,8 @@ discard block |
||
| 263 | 263 | */ |
| 264 | 264 | public function delete($key) |
| 265 | 265 | { |
| 266 | - $sql = 'DELETE FROM ' . $this->otp_registration_table . ' |
|
| 267 | - WHERE user_id = ' . (int) $this->user->data['user_id'] . ' |
|
| 266 | + $sql = 'DELETE FROM '.$this->otp_registration_table.' |
|
| 267 | + WHERE user_id = ' . (int) $this->user->data['user_id'].' |
|
| 268 | 268 | AND registration_id =' . (int) $key; |
| 269 | 269 | |
| 270 | 270 | $this->db->sql_query($sql); |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | $this->user = $user; |
| 62 | 62 | $this->request = $request; |
| 63 | 63 | $this->template = $template; |
| 64 | - $this->root_path= $root_path; |
|
| 64 | + $this->root_path = $root_path; |
|
| 65 | 65 | |
| 66 | - $this->registration_table = $registration_table; |
|
| 66 | + $this->registration_table = $registration_table; |
|
| 67 | 67 | |
| 68 | - $this->u2f = new \paul999\u2f\U2F('https://' . $this->request->server('HTTP_HOST')); |
|
| 68 | + $this->u2f = new \paul999\u2f\U2F('https://'.$this->request->server('HTTP_HOST')); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | return false; |
| 99 | 99 | } |
| 100 | 100 | $sql = 'SELECT COUNT(registration_id) as reg_id |
| 101 | - FROM ' . $this->registration_table . ' |
|
| 101 | + FROM ' . $this->registration_table.' |
|
| 102 | 102 | WHERE |
| 103 | 103 | user_id = ' . (int) $user_id; |
| 104 | 104 | $result = $this->db->sql_query($sql); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function is_potentially_usable($user_id = false) |
| 121 | 121 | { |
| 122 | - $browsercap = new Browscap($this->root_path . 'cache/'); |
|
| 122 | + $browsercap = new Browscap($this->root_path.'cache/'); |
|
| 123 | 123 | $info = $browsercap->getBrowser($this->request->server('HTTP_USER_AGENT')); |
| 124 | 124 | return strtolower($info->Browser) === 'chrome' && $this->is_ssl(); |
| 125 | 125 | } |
@@ -200,9 +200,9 @@ discard block |
||
| 200 | 200 | try |
| 201 | 201 | { |
| 202 | 202 | $sql = 'SELECT u2f_request |
| 203 | - FROM ' . SESSIONS_TABLE . ' |
|
| 203 | + FROM ' . SESSIONS_TABLE.' |
|
| 204 | 204 | WHERE |
| 205 | - session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND |
|
| 205 | + session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND |
|
| 206 | 206 | session_user_id = ' . (int) $this->user->data['user_id']; |
| 207 | 207 | $result = $this->db->sql_query($sql); |
| 208 | 208 | $row = $this->db->sql_fetchrow($result); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | 'last_used' => time(), |
| 233 | 233 | ); |
| 234 | 234 | |
| 235 | - $sql = 'UPDATE ' . $this->registration_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE registration_id = ' . (int) $reg->getId(); |
|
| 235 | + $sql = 'UPDATE '.$this->registration_table.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).' WHERE registration_id = '.(int) $reg->getId(); |
|
| 236 | 236 | $this->db->sql_query($sql); |
| 237 | 237 | } |
| 238 | 238 | catch (U2fError $error) |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | } |
| 242 | 242 | catch (\InvalidArgumentException $invalid) |
| 243 | 243 | { |
| 244 | - throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG') . '<br />' . $invalid->getMessage(), $invalid); |
|
| 244 | + throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG').'<br />'.$invalid->getMessage(), $invalid); |
|
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | 'last_used' => time(), |
| 327 | 327 | ); |
| 328 | 328 | |
| 329 | - $sql = 'INSERT INTO ' . $this->registration_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); |
|
| 329 | + $sql = 'INSERT INTO '.$this->registration_table.' '.$this->db->sql_build_array('INSERT', $sql_ary); |
|
| 330 | 330 | $this->db->sql_query($sql); |
| 331 | 331 | |
| 332 | 332 | $sql_ary = array( |
@@ -358,8 +358,8 @@ discard block |
||
| 358 | 358 | */ |
| 359 | 359 | public function delete($key) |
| 360 | 360 | { |
| 361 | - $sql = 'DELETE FROM ' . $this->registration_table . ' |
|
| 362 | - WHERE user_id = ' . (int) $this->user->data['user_id'] . ' |
|
| 361 | + $sql = 'DELETE FROM '.$this->registration_table.' |
|
| 362 | + WHERE user_id = ' . (int) $this->user->data['user_id'].' |
|
| 363 | 363 | AND registration_id =' . (int) $key; |
| 364 | 364 | |
| 365 | 365 | $this->db->sql_query($sql); |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | */ |
| 402 | 402 | private function getRegistrations($user_id) |
| 403 | 403 | { |
| 404 | - $sql = 'SELECT * FROM ' . $this->registration_table . ' WHERE user_id = ' . (int) $user_id; |
|
| 404 | + $sql = 'SELECT * FROM '.$this->registration_table.' WHERE user_id = '.(int) $user_id; |
|
| 405 | 405 | $result = $this->db->sql_query($sql); |
| 406 | 406 | $rows = array(); |
| 407 | 407 | |
@@ -489,9 +489,9 @@ discard block |
||
| 489 | 489 | */ |
| 490 | 490 | private function update_session($sql_ary) |
| 491 | 491 | { |
| 492 | - $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
| 492 | + $sql = 'UPDATE '.SESSIONS_TABLE.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).' |
|
| 493 | 493 | WHERE |
| 494 | - session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND |
|
| 494 | + session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND |
|
| 495 | 495 | session_user_id = ' . (int) $this->user->data['user_id']; |
| 496 | 496 | $this->db->sql_query($sql); |
| 497 | 497 | |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | protected function show_ucp_complete($table) |
| 38 | 38 | { |
| 39 | 39 | $sql = 'SELECT * |
| 40 | - FROM ' . $table . ' |
|
| 41 | - WHERE user_id = ' . (int) $this->user->data['user_id'] . ' |
|
| 40 | + FROM ' . $table.' |
|
| 41 | + WHERE user_id = ' . (int) $this->user->data['user_id'].' |
|
| 42 | 42 | ORDER BY registration_id ASC'; |
| 43 | 43 | |
| 44 | 44 | $result = $this->db->sql_query($sql); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | protected function check_table_for_user($table, $user_id) |
| 68 | 68 | { |
| 69 | 69 | $sql = 'SELECT COUNT(registration_id) as reg_id |
| 70 | - FROM ' . $table . ' |
|
| 70 | + FROM ' . $table.' |
|
| 71 | 71 | WHERE |
| 72 | 72 | user_id = ' . (int) $user_id; |
| 73 | 73 | $result = $this->db->sql_query($sql); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | return array( |
| 18 | 18 | 'add_tables' => array( |
| 19 | - $this->table_prefix . 'tfa_otp_registration' => array( |
|
| 19 | + $this->table_prefix.'tfa_otp_registration' => array( |
|
| 20 | 20 | 'COLUMNS' => array( |
| 21 | 21 | 'registration_id' => array('UINT', null, 'auto_increment'), |
| 22 | 22 | 'user_id' => array('UINT', 0), |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | return array( |
| 39 | 39 | 'drop_tables' => array( |
| 40 | - $this->table_prefix . 'tfa_otp_registration', |
|
| 40 | + $this->table_prefix.'tfa_otp_registration', |
|
| 41 | 41 | ), |
| 42 | 42 | ); |
| 43 | 43 | } |