@@ -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_registration', |
|
40 | + $this->table_prefix.'tfa_otp_registration', |
|
41 | 41 | ), |
42 | 42 | ); |
43 | 43 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | public function is_usable($user_id) |
108 | 108 | { |
109 | 109 | $sql = 'SELECT COUNT(registration_id) as reg_id |
110 | - FROM ' . $this->otp_registration_table . ' |
|
110 | + FROM ' . $this->otp_registration_table.' |
|
111 | 111 | WHERE |
112 | 112 | user_id = ' . (int) $user_id; |
113 | 113 | $result = $this->db->sql_query($sql); |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | $sql_ary = array( |
181 | 181 | 'last_used' => time(), |
182 | 182 | ); |
183 | - $sql = 'UPDATE ' . $this->otp_registration_table . ' |
|
184 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
183 | + $sql = 'UPDATE '.$this->otp_registration_table.' |
|
184 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
185 | 185 | WHERE |
186 | 186 | registration_id = ' . (int) $registration['registration_id']; |
187 | 187 | $this->db->sql_query($sql); |
@@ -210,9 +210,9 @@ discard block |
||
210 | 210 | public function register_start() |
211 | 211 | { |
212 | 212 | $secret = $this->otp->generateSecret(); |
213 | - $QR = $this->otp_helper->generateKeyURI('totp', $secret, generate_board_url(), '',0, 'sha1'); |
|
213 | + $QR = $this->otp_helper->generateKeyURI('totp', $secret, generate_board_url(), '', 0, 'sha1'); |
|
214 | 214 | $this->template->assign_vars(array( |
215 | - 'TFA_QR_CODE' => 'https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=' . $QR, |
|
215 | + 'TFA_QR_CODE' => 'https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl='.$QR, |
|
216 | 216 | 'TFA_SECRET' => $secret, |
217 | 217 | 'L_TFA_ADD_OTP_KEY_EXPLAIN' => $this->user->lang('TFA_ADD_OTP_KEY_EXPLAIN', $secret), |
218 | 218 | 'S_HIDDEN_FIELDS_MODULE' => build_hidden_fields(array( |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | public function register() |
233 | 233 | { |
234 | 234 | $secret = $this->request->variable('secret', ''); |
235 | - $otp = $this->request->variable('register', ''); |
|
235 | + $otp = $this->request->variable('register', ''); |
|
236 | 236 | |
237 | 237 | if (!$this->otp->checkTOTP($secret, $otp, 'sha1')) |
238 | 238 | { |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | 'last_used' => time(), |
247 | 247 | ); |
248 | 248 | |
249 | - $sql = 'INSERT INTO ' . $this->otp_registration_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); |
|
249 | + $sql = 'INSERT INTO '.$this->otp_registration_table.' '.$this->db->sql_build_array('INSERT', $sql_ary); |
|
250 | 250 | $this->db->sql_query($sql); |
251 | 251 | } |
252 | 252 | |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | */ |
270 | 270 | public function delete($key) |
271 | 271 | { |
272 | - $sql = 'DELETE FROM ' . $this->otp_registration_table . ' |
|
273 | - WHERE user_id = ' . (int) $this->user->data['user_id'] . ' |
|
272 | + $sql = 'DELETE FROM '.$this->otp_registration_table.' |
|
273 | + WHERE user_id = ' . (int) $this->user->data['user_id'].' |
|
274 | 274 | AND registration_id =' . (int) $key; |
275 | 275 | |
276 | 276 | $this->db->sql_query($sql); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | */ |
284 | 284 | private function getRegistrations($user_id) |
285 | 285 | { |
286 | - $sql = 'SELECT * FROM ' . $this->otp_registration_table . ' WHERE user_id = ' . (int) $user_id; |
|
286 | + $sql = 'SELECT * FROM '.$this->otp_registration_table.' WHERE user_id = '.(int) $user_id; |
|
287 | 287 | $result = $this->db->sql_query($sql); |
288 | 288 | $rows = $this->db->sql_fetchrowset($result); |
289 | 289 |