Completed
Push — master ( 8aa37c...8f6c9f )
by Paul
02:55 queued 29s
created
ucp/tfa_module.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -108,18 +108,15 @@  discard block
 block discarded – undo
108 108
 				if ($module->can_register())
109 109
 				{
110 110
 					$this->tpl_name = $module->register_start();
111
-				}
112
-				else
111
+				} else
113 112
 				{
114 113
 					$error[] = 'TFA_MODULE_NO_REGISTER';
115 114
 				}
116
-			}
117
-			else
115
+			} else
118 116
 			{
119 117
 				$error[] = $this->user->lang('TFA_MODULE_NOT_FOUND', $class);
120 118
 			}
121
-		}
122
-		catch (\Exception $e)
119
+		} catch (\Exception $e)
123 120
 		{
124 121
 			$error[] = $e->getMessage();
125 122
 		}
@@ -151,8 +148,7 @@  discard block
 block discarded – undo
151 148
 					if (!check_form_key('ucp_tfa_keys'))
152 149
 					{
153 150
 						$error[] = 'FORM_INVALID';
154
-					}
155
-					else
151
+					} else
156 152
 					{
157 153
 						if ($this->request->variable('md', false, false, \phpbb\request\request_interface::POST))
158 154
 						{
Please login to merge, or discard this patch.
modules/u2f.php 1 patch
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -152,8 +152,7 @@  discard block
 block discarded – undo
152 152
 		if (!empty($secure))
153 153
 		{
154 154
 			return 'on' == strtolower($secure) || '1' == $secure;
155
-		}
156
-		else if ('443' == $this->request->server('SERVER_PORT'))
155
+		} else if ('443' == $this->request->server('SERVER_PORT'))
157 156
 		{
158 157
 			return true;
159 158
 		}
@@ -234,10 +233,12 @@  discard block
 block discarded – undo
234 233
 
235 234
 			if (property_exists($response, 'errorCode'))
236 235
 			{
237
-				if ($response->errorCode == 4) // errorCode 4 means that this device wasn't registered
236
+				if ($response->errorCode == 4) {
237
+					// errorCode 4 means that this device wasn't registered
238 238
 				{
239 239
 					throw new AccessDeniedHttpException($this->user->lang('TFA_NOT_REGISTERED'));
240 240
 				}
241
+				}
241 242
 				throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG'));
242 243
 			}
243 244
 			$result = new AuthenticationResponse($response->signatureData, $response->clientData, $response->keyHandle); // Do not need to include errorCode, as we already handled it.
@@ -251,12 +252,10 @@  discard block
 block discarded – undo
251 252
 
252 253
 			$sql = 'UPDATE ' . $this->registration_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE registration_id = ' . (int) $reg->getId();
253 254
 			$this->db->sql_query($sql);
254
-		}
255
-		catch (U2fError $error)
255
+		} catch (U2fError $error)
256 256
 		{
257 257
 			$this->createError($error);
258
-		}
259
-		catch (\InvalidArgumentException $invalid)
258
+		} catch (\InvalidArgumentException $invalid)
260 259
 		{
261 260
 			throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG') . '<br />' . $invalid->getMessage(), $invalid);
262 261
 		}
@@ -351,8 +350,7 @@  discard block
 block discarded – undo
351 350
 			);
352 351
 
353 352
 			$this->update_session($sql_ary);
354
-		}
355
-		catch (U2fError $err)
353
+		} catch (U2fError $err)
356 354
 		{
357 355
 			$this->createError($err);
358 356
 		}
Please login to merge, or discard this patch.
event/listener.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -182,8 +182,7 @@  discard block
 block discarded – undo
182 182
 					// We simply return and continue the login procedure (The normal way :)),
183 183
 					// and will disable all pages untill he has added a 2FA key.
184 184
 					return $event;
185
-				}
186
-				else
185
+				} else
187 186
 				{
188 187
 					$this->user->add_lang_ext('paul999/tfa', 'common');
189 188
 					$user_id = $event['user_id'];
@@ -196,8 +195,7 @@  discard block
 block discarded – undo
196 195
 					if (!empty($class) && $class != '_')
197 196
 					{
198 197
 						$module = $this->session_helper->findModule($class);
199
-					}
200
-					else
198
+					} else
201 199
 					{
202 200
 						/**
203 201
 						 * @var module_interface $row
Please login to merge, or discard this patch.