Completed
Push — master ( 678059...7aa399 )
by Paul
02:58
created
migrations/initial_backup_schema.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
migrations/initial_otp_schema.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
modules/backup_key.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
 					'last_used' => time(),
183 183
 					'valid'		=> false,
184 184
 				);
185
-				$sql = 'UPDATE ' . $this->backup_registration_table . ' 
186
-							SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' 
185
+				$sql = 'UPDATE '.$this->backup_registration_table.' 
186
+							SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' 
187 187
 							WHERE 
188 188
 								registration_id = ' . (int) $registration['registration_id'];
189 189
 				$this->db->sql_query($sql);
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
 	 */
266 266
 	public function delete($key)
267 267
 	{
268
-		$sql = 'DELETE FROM ' . $this->backup_registration_table . '
269
-					WHERE user_id = ' . (int) $this->user->data['user_id'] . '
268
+		$sql = 'DELETE FROM '.$this->backup_registration_table.'
269
+					WHERE user_id = ' . (int) $this->user->data['user_id'].'
270 270
 					AND registration_id =' . (int) $key;
271 271
 
272 272
 		$this->db->sql_query($sql);
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 */
280 280
 	private function getRegistrations($user_id)
281 281
 	{
282
-		$sql = 'SELECT * FROM ' . $this->backup_registration_table . ' WHERE user_id = ' . (int) $user_id;
282
+		$sql = 'SELECT * FROM '.$this->backup_registration_table.' WHERE user_id = '.(int) $user_id;
283 283
 		$result = $this->db->sql_query($sql);
284 284
 		$rows = $this->db->sql_fetchrowset($result);
285 285
 
Please login to merge, or discard this patch.
helper/session_helper.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function __construct(driver_interface $db, config $config, user $user, service_collection $modules, template $template, helper $controller_helper, $registration_table, $user_table)
90 90
 	{
91
-		$this->db					= $db;
92
-		$this->user					= $user;
93
-		$this->config				= $config;
94
-		$this->template 			= $template;
91
+		$this->db = $db;
92
+		$this->user = $user;
93
+		$this->config = $config;
94
+		$this->template = $template;
95 95
 		$this->controller_helper 	= $controller_helper;
96 96
 		$this->registration_table	= $registration_table;
97
-		$this->user_table			= $user_table;
97
+		$this->user_table = $user_table;
98 98
 
99 99
 		$this->validateModules($modules);
100 100
 
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
 			'tfa_random' 	=> $random,
259 259
 			'tfa_uid'		=> $user_id,
260 260
 		);
261
-		$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
261
+		$sql = 'UPDATE '.SESSIONS_TABLE.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).'
262 262
 							WHERE
263
-								session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND
263
+								session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND
264 264
 								session_user_id = ' . (int) $this->user->data['user_id'];
265 265
 		$this->db->sql_query($sql);
266 266
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	{
289 289
 		if (empty($userdata))
290 290
 		{
291
-			$sql = 'SELECT * FROM ' . $this->user_table . ' WHERE user_id = ' . (int) $user_id;
291
+			$sql = 'SELECT * FROM '.$this->user_table.' WHERE user_id = '.(int) $user_id;
292 292
 			$result = $this->db->sql_query($sql);
293 293
 			$userdata = $this->db->sql_fetchrow($result);
294 294
 			$this->db->sql_freeresult($result);
Please login to merge, or discard this patch.
controller/main_controller.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function __construct(helper $controller_helper, driver_interface $db, template $template, user $user, request_interface $request, config $config, session_helper_interface $session_helper, $root_path, $php_ext)
88 88
 	{
89
-		$this->controller_helper 	= $controller_helper;
90
-		$this->template 			= $template;
91
-		$this->db					= $db;
92
-		$this->user					= $user;
93
-		$this->request				= $request;
94
-		$this->config				= $config;
95
-		$this->session_helper		= $session_helper;
96
-		$this->root_path			= $root_path;
97
-		$this->php_ext				= $php_ext;
89
+		$this->controller_helper = $controller_helper;
90
+		$this->template = $template;
91
+		$this->db = $db;
92
+		$this->user = $user;
93
+		$this->request = $request;
94
+		$this->config = $config;
95
+		$this->session_helper = $session_helper;
96
+		$this->root_path = $root_path;
97
+		$this->php_ext = $php_ext;
98 98
 
99 99
 	}
100 100
 
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
 			'tfa_random' => '',
130 130
 			'tfa_uid'    => 0,
131 131
 		);
132
-		$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
132
+		$sql = 'UPDATE '.SESSIONS_TABLE.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary).'
133 133
 							WHERE
134
-								session_id = \'' . $this->db->sql_escape($this->user->data['session_id']) . '\' AND
135
-								session_user_id = ' . (int)$this->user->data['user_id'];
134
+								session_id = \'' . $this->db->sql_escape($this->user->data['session_id']).'\' AND
135
+								session_user_id = ' . (int) $this->user->data['user_id'];
136 136
 		$this->db->sql_query($sql);
137 137
 
138 138
 		if (empty($class))
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
 			if ($admin)
181 181
 			{
182 182
 				// the login array is used because the user ids do not differ for re-authentication
183
-				$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
184
-						WHERE session_id = '" . $this->db->sql_escape($old_session_id) . "'
183
+				$sql = 'DELETE FROM '.SESSIONS_TABLE."
184
+						WHERE session_id = '" . $this->db->sql_escape($old_session_id)."'
185 185
 						AND session_user_id = " . (int) $user_id;
186 186
 				$this->db->sql_query($sql);
187 187
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,8 +155,7 @@
 block discarded – undo
155 155
 				$this->template->assign_var('S_ERROR', $this->user->lang('TFA_INCORRECT_KEY'));
156 156
 				$this->session_helper->generate_page($user_id, $admin, $auto_login, $viewonline, $redirect);
157 157
 			}
158
-		}
159
-		catch (BadRequestHttpException $ex) // @TODO: Replace exception with own exception
158
+		} catch (BadRequestHttpException $ex) // @TODO: Replace exception with own exception
160 159
 		{
161 160
 			$this->template->assign_var('S_ERROR', $ex->getMessage());
162 161
 			$this->session_helper->generate_page($user_id, $admin, $auto_login, $viewonline, $redirect);
Please login to merge, or discard this patch.