@@ -131,12 +131,10 @@ discard block |
||
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 |
||
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 |
||
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'] = ''; |
@@ -162,8 +162,7 @@ |
||
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']) |
@@ -205,10 +205,12 @@ discard block |
||
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 |
||
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 | } |