Completed
Push — master ( 23d816...b58616 )
by Paul
02:25
created
modules/otp.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.