@@ -232,8 +232,8 @@ |
||
| 232 | 232 | */ |
| 233 | 233 | public function delete($key) |
| 234 | 234 | { |
| 235 | - $sql = 'DELETE FROM ' . $this->backup_registration_table . ' |
|
| 236 | - WHERE user_id = ' . (int) $this->user->data['user_id'] . ' |
|
| 235 | + $sql = 'DELETE FROM '.$this->backup_registration_table.' |
|
| 236 | + WHERE user_id = ' . (int) $this->user->data['user_id'].' |
|
| 237 | 237 | AND registration_id =' . (int) $key; |
| 238 | 238 | |
| 239 | 239 | $this->db->sql_query($sql); |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | $sql_ary = array( |
| 178 | 178 | 'last_used' => time(), |
| 179 | 179 | ); |
| 180 | - $sql = 'UPDATE ' . $this->otp_registration_table . ' |
|
| 181 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
| 180 | + $sql = 'UPDATE '.$this->otp_registration_table.' |
|
| 181 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
| 182 | 182 | WHERE |
| 183 | 183 | registration_id = ' . (int) $registration['registration_id']; |
| 184 | 184 | $this->db->sql_query($sql); |
@@ -208,9 +208,9 @@ discard block |
||
| 208 | 208 | public function register_start() |
| 209 | 209 | { |
| 210 | 210 | $secret = $this->otp->generateSecret(); |
| 211 | - $QR = $this->otp_helper->generateKeyURI('totp', $secret, generate_board_url(), '',0, 'sha1'); |
|
| 211 | + $QR = $this->otp_helper->generateKeyURI('totp', $secret, generate_board_url(), '', 0, 'sha1'); |
|
| 212 | 212 | $this->template->assign_vars(array( |
| 213 | - 'TFA_QR_CODE' => 'https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=' . $QR, |
|
| 213 | + 'TFA_QR_CODE' => 'https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl='.$QR, |
|
| 214 | 214 | 'TFA_SECRET' => $secret, |
| 215 | 215 | 'L_TFA_ADD_OTP_KEY_EXPLAIN' => $this->user->lang('TFA_ADD_OTP_KEY_EXPLAIN', $secret), |
| 216 | 216 | 'S_HIDDEN_FIELDS_MODULE' => build_hidden_fields(array( |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | public function register() |
| 231 | 231 | { |
| 232 | 232 | $secret = $this->request->variable('secret', ''); |
| 233 | - $otp = $this->request->variable('register', ''); |
|
| 233 | + $otp = $this->request->variable('register', ''); |
|
| 234 | 234 | |
| 235 | 235 | if (!$this->otp->checkTOTP($secret, $otp, 'sha1')) |
| 236 | 236 | { |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | 'last_used' => time(), |
| 245 | 245 | ); |
| 246 | 246 | |
| 247 | - $sql = 'INSERT INTO ' . $this->otp_registration_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); |
|
| 247 | + $sql = 'INSERT INTO '.$this->otp_registration_table.' '.$this->db->sql_build_array('INSERT', $sql_ary); |
|
| 248 | 248 | $this->db->sql_query($sql); |
| 249 | 249 | } |
| 250 | 250 | |
@@ -267,8 +267,8 @@ discard block |
||
| 267 | 267 | */ |
| 268 | 268 | public function delete($key) |
| 269 | 269 | { |
| 270 | - $sql = 'DELETE FROM ' . $this->otp_registration_table . ' |
|
| 271 | - WHERE user_id = ' . (int) $this->user->data['user_id'] . ' |
|
| 270 | + $sql = 'DELETE FROM '.$this->otp_registration_table.' |
|
| 271 | + WHERE user_id = ' . (int) $this->user->data['user_id'].' |
|
| 272 | 272 | AND registration_id =' . (int) $key; |
| 273 | 273 | |
| 274 | 274 | $this->db->sql_query($sql); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | private function getRegistrations($user_id) |
| 283 | 283 | { |
| 284 | - $sql = 'SELECT * FROM ' . $this->otp_registration_table . ' WHERE user_id = ' . (int) $user_id; |
|
| 284 | + $sql = 'SELECT * FROM '.$this->otp_registration_table.' WHERE user_id = '.(int) $user_id; |
|
| 285 | 285 | $result = $this->db->sql_query($sql); |
| 286 | 286 | $rows = $this->db->sql_fetchrowset($result); |
| 287 | 287 | |
@@ -38,10 +38,10 @@ discard block |
||
| 38 | 38 | protected function show_ucp_complete($table, $where = '') |
| 39 | 39 | { |
| 40 | 40 | $sql = 'SELECT * |
| 41 | - FROM ' . $table . ' |
|
| 41 | + FROM ' . $table.' |
|
| 42 | 42 | WHERE |
| 43 | - user_id = ' . (int) $this->user->data['user_id'] . ' |
|
| 44 | - ' . $where . ' |
|
| 43 | + user_id = ' . (int) $this->user->data['user_id'].' |
|
| 44 | + ' . $where.' |
|
| 45 | 45 | ORDER BY registration_id ASC'; |
| 46 | 46 | |
| 47 | 47 | $result = $this->db->sql_query($sql); |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | protected function check_table_for_user($table, $user_id, $where = '') |
| 72 | 72 | { |
| 73 | 73 | $sql = 'SELECT COUNT(registration_id) as reg_id |
| 74 | - FROM ' . $table . ' |
|
| 74 | + FROM ' . $table.' |
|
| 75 | 75 | WHERE |
| 76 | - user_id = ' . (int) $user_id . |
|
| 77 | - ' ' . $where; |
|
| 76 | + user_id = ' . (int) $user_id. |
|
| 77 | + ' '.$where; |
|
| 78 | 78 | $result = $this->db->sql_query($sql); |
| 79 | 79 | $row = $this->db->sql_fetchrow($result); |
| 80 | 80 | $this->db->sql_freeresult($result); |
@@ -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 | /** |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function is_potentially_usable($user_id = false) |
| 113 | 113 | { |
| 114 | - $browsercap = new Browscap($this->root_path . 'cache/'); |
|
| 114 | + $browsercap = new Browscap($this->root_path.'cache/'); |
|
| 115 | 115 | $info = $browsercap->getBrowser($this->request->server('HTTP_USER_AGENT')); |
| 116 | 116 | return strtolower($info->Browser) === 'chrome' && $this->is_ssl(); |
| 117 | 117 | } |
@@ -194,9 +194,9 @@ discard block |
||
| 194 | 194 | try |
| 195 | 195 | { |
| 196 | 196 | $sql = 'SELECT u2f_request |
| 197 | - FROM ' . SESSIONS_TABLE . ' |
|
| 197 | + FROM ' . SESSIONS_TABLE.' |
|
| 198 | 198 | WHERE |
| 199 | - session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND |
|
| 199 | + session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND |
|
| 200 | 200 | session_user_id = ' . (int) $this->user->data['user_id']; |
| 201 | 201 | $result = $this->db->sql_query($sql); |
| 202 | 202 | $row = $this->db->sql_fetchrow($result); |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | 'last_used' => time(), |
| 227 | 227 | ); |
| 228 | 228 | |
| 229 | - $sql = 'UPDATE ' . $this->registration_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE registration_id = ' . (int) $reg->getId(); |
|
| 229 | + $sql = 'UPDATE '.$this->registration_table.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).' WHERE registration_id = '.(int) $reg->getId(); |
|
| 230 | 230 | $this->db->sql_query($sql); |
| 231 | 231 | |
| 232 | 232 | return true; |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | catch (\InvalidArgumentException $invalid) |
| 239 | 239 | { |
| 240 | - throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG') . '<br />' . $invalid->getMessage(), $invalid); |
|
| 240 | + throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG').'<br />'.$invalid->getMessage(), $invalid); |
|
| 241 | 241 | } |
| 242 | 242 | return false; |
| 243 | 243 | } |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | 'last_used' => time(), |
| 323 | 323 | ); |
| 324 | 324 | |
| 325 | - $sql = 'INSERT INTO ' . $this->registration_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); |
|
| 325 | + $sql = 'INSERT INTO '.$this->registration_table.' '.$this->db->sql_build_array('INSERT', $sql_ary); |
|
| 326 | 326 | $this->db->sql_query($sql); |
| 327 | 327 | |
| 328 | 328 | $sql_ary = array( |
@@ -354,8 +354,8 @@ discard block |
||
| 354 | 354 | */ |
| 355 | 355 | public function delete($key) |
| 356 | 356 | { |
| 357 | - $sql = 'DELETE FROM ' . $this->registration_table . ' |
|
| 358 | - WHERE user_id = ' . (int) $this->user->data['user_id'] . ' |
|
| 357 | + $sql = 'DELETE FROM '.$this->registration_table.' |
|
| 358 | + WHERE user_id = ' . (int) $this->user->data['user_id'].' |
|
| 359 | 359 | AND registration_id =' . (int) $key; |
| 360 | 360 | |
| 361 | 361 | $this->db->sql_query($sql); |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | */ |
| 398 | 398 | private function getRegistrations($user_id) |
| 399 | 399 | { |
| 400 | - $sql = 'SELECT * FROM ' . $this->registration_table . ' WHERE user_id = ' . (int) $user_id; |
|
| 400 | + $sql = 'SELECT * FROM '.$this->registration_table.' WHERE user_id = '.(int) $user_id; |
|
| 401 | 401 | $result = $this->db->sql_query($sql); |
| 402 | 402 | $rows = array(); |
| 403 | 403 | |
@@ -485,9 +485,9 @@ discard block |
||
| 485 | 485 | */ |
| 486 | 486 | private function update_session($sql_ary) |
| 487 | 487 | { |
| 488 | - $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
| 488 | + $sql = 'UPDATE '.SESSIONS_TABLE.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).' |
|
| 489 | 489 | WHERE |
| 490 | - session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND |
|
| 490 | + session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND |
|
| 491 | 491 | session_user_id = ' . (int) $this->user->data['user_id']; |
| 492 | 492 | $this->db->sql_query($sql); |
| 493 | 493 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | return array( |
| 18 | 18 | 'add_tables' => array( |
| 19 | - $this->table_prefix . 'tfa_back_reg' => array( |
|
| 19 | + $this->table_prefix.'tfa_back_reg' => array( |
|
| 20 | 20 | 'COLUMNS' => array( |
| 21 | 21 | 'registration_id' => array('UINT', null, 'auto_increment'), |
| 22 | 22 | 'user_id' => array('UINT', 0), |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | return array( |
| 40 | 40 | 'drop_tables' => array( |
| 41 | - $this->table_prefix . 'tfa_back_reg', |
|
| 41 | + $this->table_prefix.'tfa_back_reg', |
|
| 42 | 42 | ), |
| 43 | 43 | ); |
| 44 | 44 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | return array( |
| 18 | 18 | 'add_tables' => array( |
| 19 | - $this->table_prefix . 'tfa_otp_reg' => array( |
|
| 19 | + $this->table_prefix.'tfa_otp_reg' => 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_reg', |
|
| 40 | + $this->table_prefix.'tfa_otp_reg', |
|
| 41 | 41 | ), |
| 42 | 42 | ); |
| 43 | 43 | } |