Completed
Push — master ( 7ee1a3...efdf4a )
by Paul
02:33
created
modules/u2f.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
 		$this->user     = $user;
79 79
 		$this->request  = $request;
80 80
 		$this->template = $template;
81
-		$this->root_path= $root_path;
81
+		$this->root_path = $root_path;
82 82
 
83
-		$this->registration_table	= $registration_table;
83
+		$this->registration_table = $registration_table;
84 84
 
85
-		$this->u2f = new \paul999\u2f\U2F('https://' . $this->request->server('HTTP_HOST'));
85
+		$this->u2f = new \paul999\u2f\U2F('https://'.$this->request->server('HTTP_HOST'));
86 86
 	}
87 87
 
88 88
 	/**
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 			return false;
116 116
 		}
117 117
 		$sql = 'SELECT COUNT(registration_id) as reg_id 
118
-					FROM ' . $this->registration_table . ' 
118
+					FROM ' . $this->registration_table.' 
119 119
 					WHERE 
120 120
 						user_id = ' . (int) $user_id;
121 121
 		$result = $this->db->sql_query($sql);
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 */
137 137
 	public function is_potentially_usable($user_id = false)
138 138
 	{
139
-		$browsercap = new Browscap($this->root_path . 'cache/');
139
+		$browsercap = new Browscap($this->root_path.'cache/');
140 140
 		$info = $browsercap->getBrowser($this->request->server('HTTP_USER_AGENT'));
141 141
 		return strtolower($info->Browser) === 'chrome' && $this->is_ssl();
142 142
 	}
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
 		try
218 218
 		{
219 219
 			$sql = 'SELECT u2f_request 
220
-						FROM ' . SESSIONS_TABLE . ' 
220
+						FROM ' . SESSIONS_TABLE.' 
221 221
 						WHERE
222
-							session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND
222
+							session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND
223 223
 							session_user_id = ' . (int) $this->user->data['user_id'];
224 224
 			$result = $this->db->sql_query($sql);
225 225
 			$row = $this->db->sql_fetchrow($result);
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 				'last_used' => time(),
250 250
 			);
251 251
 
252
-			$sql = 'UPDATE ' . $this->registration_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE registration_id = ' . (int) $reg->getId();
252
+			$sql = 'UPDATE '.$this->registration_table.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).' WHERE registration_id = '.(int) $reg->getId();
253 253
 			$this->db->sql_query($sql);
254 254
 		}
255 255
 		catch (U2fError $error)
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 		}
259 259
 		catch (\InvalidArgumentException $invalid)
260 260
 		{
261
-			throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG') . '<br />' . $invalid->getMessage(), $invalid);
261
+			throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG').'<br />'.$invalid->getMessage(), $invalid);
262 262
 		}
263 263
 	}
264 264
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 				'last_used' => time(),
344 344
 			);
345 345
 
346
-			$sql = 'INSERT INTO ' . $this->registration_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
346
+			$sql = 'INSERT INTO '.$this->registration_table.' '.$this->db->sql_build_array('INSERT', $sql_ary);
347 347
 			$this->db->sql_query($sql);
348 348
 
349 349
 			$sql_ary = array(
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 	public function show_ucp()
366 366
 	{
367 367
 		$sql = 'SELECT *
368
-			FROM ' . $this->registration_table . '
369
-			WHERE user_id = ' . (int) $this->user->data['user_id'] . '
368
+			FROM ' . $this->registration_table.'
369
+			WHERE user_id = ' . (int) $this->user->data['user_id'].'
370 370
 			ORDER BY registration_id ASC';
371 371
 
372 372
 		$result = $this->db->sql_query($sql);
@@ -391,8 +391,8 @@  discard block
 block discarded – undo
391 391
 	 */
392 392
 	public function delete($key)
393 393
 	{
394
-			$sql = 'DELETE FROM ' . $this->registration_table . '
395
-						WHERE user_id = ' . (int) $this->user->data['user_id'] . '
394
+			$sql = 'DELETE FROM '.$this->registration_table.'
395
+						WHERE user_id = ' . (int) $this->user->data['user_id'].'
396 396
 						AND registration_id =' . (int) $key;
397 397
 
398 398
 			$this->db->sql_query($sql);
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	 */
435 435
 	private function getRegistrations($user_id)
436 436
 	{
437
-		$sql = 'SELECT * FROM ' . $this->registration_table . ' WHERE user_id = ' . (int) $user_id;
437
+		$sql = 'SELECT * FROM '.$this->registration_table.' WHERE user_id = '.(int) $user_id;
438 438
 		$result = $this->db->sql_query($sql);
439 439
 		$rows = array();
440 440
 
@@ -522,9 +522,9 @@  discard block
 block discarded – undo
522 522
 	 */
523 523
 	private function update_session($sql_ary)
524 524
 	{
525
-		$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
525
+		$sql = 'UPDATE '.SESSIONS_TABLE.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).'
526 526
 							WHERE
527
-								session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND
527
+								session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND
528 528
 								session_user_id = ' . (int) $this->user->data['user_id'];
529 529
 		$this->db->sql_query($sql);
530 530
 
Please login to merge, or discard this patch.