Completed
Push — master ( 08db4b...4c3b40 )
by Paul
02:33
created
ucp/tfa_module.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -199,7 +199,7 @@
 block discarded – undo
199 199
 				'LAST_USED' => $this->user->format_date($row['last_used']),
200 200
 			));
201 201
 
202
-			$reg				= new registration_helper();
202
+			$reg = new registration_helper();
203 203
 			$reg->setCounter($row['counter']);
204 204
 			$reg->setCertificate($row['certificate']);
205 205
 			$reg->setKeyHandle($row['key_handle']);
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -131,12 +131,10 @@  discard block
 block discarded – undo
131 131
 			$message = $this->user->lang['TFA_KEY_ADDED'] . '<br /><br />' . sprintf($this->user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
132 132
 			trigger_error($message);
133 133
 
134
-		}
135
-		catch (U2fError $err)
134
+		} catch (U2fError $err)
136 135
 		{
137 136
 			$this->createError($err, $error);
138
-		}
139
-		catch (\InvalidArgumentException $e)
137
+		} catch (\InvalidArgumentException $e)
140 138
 		{
141 139
 			$error[] = $e->getMessage();
142 140
 		}
@@ -161,8 +159,7 @@  discard block
 block discarded – undo
161 159
 			if (!check_form_key('ucp_tfa_keys'))
162 160
 			{
163 161
 				$error[] = 'FORM_INVALID';
164
-			}
165
-			else
162
+			} else
166 163
 			{
167 164
 				switch ($mode)
168 165
 				{
@@ -218,8 +215,7 @@  discard block
 block discarded – undo
218 215
 		if ($count == 0)
219 216
 		{
220 217
 			trigger_error('TFA_UNABLE_TO_UPDATE_SESSION');
221
-		}
222
-		else if ($count > 1)
218
+		} else if ($count > 1)
223 219
 		{
224 220
 			// Reset sessions table. We had multiple sessions with same ID!!!
225 221
 			$sql_ary['u2f_request'] = '';
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- *
4
- * 2FA extension for the phpBB Forum Software package.
5
- *
6
- * @copyright (c) 2015 Paul Sohier
7
- * @license GNU General Public License, version 2 (GPL-2.0)
8
- *
9
- */
3
+	 *
4
+	 * 2FA extension for the phpBB Forum Software package.
5
+	 *
6
+	 * @copyright (c) 2015 Paul Sohier
7
+	 * @license GNU General Public License, version 2 (GPL-2.0)
8
+	 *
9
+	 */
10 10
 
11 11
 namespace paul999\tfa\acp;
12 12
 
Please login to merge, or discard this patch.
event/listener.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -76,14 +76,14 @@
 block discarded – undo
76 76
 	 */
77 77
 	public function __construct(session_helper_interface $helper, helper $controller_helper, user $user, request_interface $request, driver_interface $db, config $config, $php_ext, $root_path)
78 78
 	{
79
-		$this->helper				= $helper;
80
-		$this->controller_helper 	= $controller_helper;
81
-		$this->user					= $user;
79
+		$this->helper = $helper;
80
+		$this->controller_helper = $controller_helper;
81
+		$this->user = $user;
82 82
 		$this->request				= $request;
83
-		$this->config				= $config;
84
-		$this->db					= $db;
83
+		$this->config = $config;
84
+		$this->db = $db;
85 85
 		$this->php_ext				= $php_ext;
86
-		$this->root_path			= $root_path;
86
+		$this->root_path = $root_path;
87 87
 	}
88 88
 
89 89
 	/**
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -162,8 +162,7 @@
 block discarded – undo
162 162
 					// We simply return and continue the login procedure (The normal way :)),
163 163
 					// and will disable all pages untill he has added a 2FA key.
164 164
 					return;
165
-				}
166
-				else
165
+				} else
167 166
 				{
168 167
 					$redirect = $this->request->variable('redirect', "{$this->root_path}index.{$this->php_ext}");
169 168
 					if ($event['admin'])
Please login to merge, or discard this patch.
helper/session_helper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@
 block discarded – undo
56 56
 	 */
57 57
 	public function __construct(driver_interface $db, config $config, $registration_table, $user_table)
58 58
 	{
59
-		$this->db					= $db;
60
-		$this->config				= $config;
61
-		$this->registration_table	= $registration_table;
62
-		$this->user_table			= $user_table;
59
+		$this->db = $db;
60
+		$this->config = $config;
61
+		$this->registration_table = $registration_table;
62
+		$this->user_table = $user_table;
63 63
 	}
64 64
 
65 65
 	/**
Please login to merge, or discard this patch.
acp/tfa_module.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 			'title'	=> 'ACP_TFA_SETTINGS',
44 44
 			'vars'	=> array(
45 45
 				'legend1'				=> 'ACP_TFA_SETTINGS',
46
-				'tfa_mode'				=> array('lang' => 'TFA_MODE',			'validate' => 'bool',	'type' => 'select', 'method' => 'select_tfa_method', 'explain' => true),
46
+				'tfa_mode'				=> array('lang' => 'TFA_MODE', 'validate' => 'bool', 'type' => 'select', 'method' => 'select_tfa_method', 'explain' => true),
47 47
 
48 48
 				'legend4'				=> 'ACP_SUBMIT_CHANGES',
49 49
 			)
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 			$l_explain = '';
147 147
 			if ($vars['explain'] && isset($user->lang[$vars['lang'] . '_EXPLAIN']))
148 148
 			{
149
-				$l_explain =  $user->lang[$vars['lang'] . '_EXPLAIN'];
149
+				$l_explain = $user->lang[$vars['lang'] . '_EXPLAIN'];
150 150
 			}
151 151
 
152 152
 			$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- *
4
- * 2FA extension for the phpBB Forum Software package.
5
- *
6
- * @copyright (c) 2015 Paul Sohier
7
- * @license GNU General Public License, version 2 (GPL-2.0)
8
- *
9
- */
3
+	 *
4
+	 * 2FA extension for the phpBB Forum Software package.
5
+	 *
6
+	 * @copyright (c) 2015 Paul Sohier
7
+	 * @license GNU General Public License, version 2 (GPL-2.0)
8
+	 *
9
+	 */
10 10
 
11 11
 namespace paul999\tfa\acp;
12 12
 
Please login to merge, or discard this patch.
acp/tfa_info.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- *
4
- * 2FA extension for the phpBB Forum Software package.
5
- *
6
- * @copyright (c) 2015 Paul Sohier
7
- * @license GNU General Public License, version 2 (GPL-2.0)
8
- *
9
- */
3
+	 *
4
+	 * 2FA extension for the phpBB Forum Software package.
5
+	 *
6
+	 * @copyright (c) 2015 Paul Sohier
7
+	 * @license GNU General Public License, version 2 (GPL-2.0)
8
+	 *
9
+	 */
10 10
 
11 11
 namespace paul999\tfa\acp;
12 12
 
Please login to merge, or discard this patch.
controller/main_controller.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -98,16 +98,16 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	public function __construct(helper $controller_helper, driver_interface $db, template $template, user $user, request_interface $request, config $config, $root_path, $php_ext, $user_table, $registration_table)
100 100
 	{
101
-		$this->controller_helper 	= $controller_helper;
102
-		$this->template 			= $template;
103
-		$this->db					= $db;
104
-		$this->user					= $user;
101
+		$this->controller_helper = $controller_helper;
102
+		$this->template = $template;
103
+		$this->db = $db;
104
+		$this->user = $user;
105 105
 		$this->request				= $request;
106
-		$this->config				= $config;
107
-		$this->root_path			= $root_path;
106
+		$this->config = $config;
107
+		$this->root_path = $root_path;
108 108
 		$this->php_ext				= $php_ext;
109
-		$this->user_table			= $user_table;
110
-		$this->registration_table	= $registration_table;
109
+		$this->user_table = $user_table;
110
+		$this->registration_table = $registration_table;
111 111
 
112 112
 		$this->u2f = new U2F('https://' . $this->request->server('HTTP_HOST'));
113 113
 	}
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 		{
204 204
 			$response = json_decode(htmlspecialchars_decode($this->request->variable('authenticate', '')));
205 205
 
206
-			if (property_exists( $response, 'errorCode'))
206
+			if (property_exists($response, 'errorCode'))
207 207
 			{
208 208
 				if ($response->errorCode == 4) // errorCode 4 means that this device wasn't registered
209 209
 				{
@@ -276,13 +276,13 @@  discard block
 block discarded – undo
276 276
 
277 277
 		while ($row = $this->db->sql_fetchrow($result))
278 278
 		{
279
-			$reg 				= new registration_helper();
279
+			$reg = new registration_helper();
280 280
 			$reg->setCounter($row['counter']);
281 281
 			$reg->setCertificate($row['certificate']);
282 282
 			$reg->setKeyHandle($row['key_handle']);
283 283
 			$reg->setPublicKey($row['public_key']);
284
-			$reg->id 			= $row['registration_id'];
285
-			$rows[] 			= $reg;
284
+			$reg->id = $row['registration_id'];
285
+			$rows[] = $reg;
286 286
 		}
287 287
 
288 288
 		$this->db->sql_freeresult($result);
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -205,10 +205,12 @@  discard block
 block discarded – undo
205 205
 
206 206
 			if (property_exists( $response, 'errorCode'))
207 207
 			{
208
-				if ($response->errorCode == 4) // errorCode 4 means that this device wasn't registered
208
+				if ($response->errorCode == 4) {
209
+					// errorCode 4 means that this device wasn't registered
209 210
 				{
210 211
 					throw new AccessDeniedHttpException($this->user->lang('TFA_NOT_REGISTERED'));
211 212
 				}
213
+				}
212 214
 			}
213 215
 
214 216
 			/** @var \paul999\tfa\helper\registration_helper $reg */
@@ -250,12 +252,10 @@  discard block
 block discarded – undo
250 252
 				redirect(append_sid($redirect, false, true, $this->user->data['session_id']));
251 253
 			}
252 254
 			throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG'));
253
-		}
254
-		catch (U2fError $error)
255
+		} catch (U2fError $error)
255 256
 		{
256 257
 			$this->createError($error);
257
-		}
258
-		catch (\InvalidArgumentException $invalid)
258
+		} catch (\InvalidArgumentException $invalid)
259 259
 		{
260 260
 			throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG') . '<br />' . $invalid->getMessage(), $invalid);
261 261
 		}
Please login to merge, or discard this patch.
language/en/ucp_tfa.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- *
4
- * 2FA extension for the phpBB Forum Software package.
5
- *
6
- * @copyright (c) 2015 Paul Sohier
7
- * @license GNU General Public License, version 2 (GPL-2.0)
8
- *
9
- */
3
+	 *
4
+	 * 2FA extension for the phpBB Forum Software package.
5
+	 *
6
+	 * @copyright (c) 2015 Paul Sohier
7
+	 * @license GNU General Public License, version 2 (GPL-2.0)
8
+	 *
9
+	 */
10 10
 
11 11
 namespace paul999\tfa\acp;
12 12
 
Please login to merge, or discard this patch.
language/en/acp_tfa.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- *
4
- * 2FA extension for the phpBB Forum Software package.
5
- *
6
- * @copyright (c) 2015 Paul Sohier
7
- * @license GNU General Public License, version 2 (GPL-2.0)
8
- *
9
- */
3
+	 *
4
+	 * 2FA extension for the phpBB Forum Software package.
5
+	 *
6
+	 * @copyright (c) 2015 Paul Sohier
7
+	 * @license GNU General Public License, version 2 (GPL-2.0)
8
+	 *
9
+	 */
10 10
 
11 11
 namespace paul999\tfa\acp;
12 12
 
Please login to merge, or discard this patch.
language/en/info_ucp_tfa.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- *
4
- * 2FA extension for the phpBB Forum Software package.
5
- *
6
- * @copyright (c) 2015 Paul Sohier
7
- * @license GNU General Public License, version 2 (GPL-2.0)
8
- *
9
- */
3
+	 *
4
+	 * 2FA extension for the phpBB Forum Software package.
5
+	 *
6
+	 * @copyright (c) 2015 Paul Sohier
7
+	 * @license GNU General Public License, version 2 (GPL-2.0)
8
+	 *
9
+	 */
10 10
 
11 11
 namespace paul999\tfa\acp;
12 12
 
Please login to merge, or discard this patch.