@@ -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']) |
@@ -127,8 +127,7 @@ |
||
| 127 | 127 | if (!empty($default)) |
| 128 | 128 | { |
| 129 | 129 | $module = $this->session_helper->findModule($class); |
| 130 | - } |
|
| 131 | - else |
|
| 130 | + } else |
|
| 132 | 131 | { |
| 133 | 132 | foreach ($modules as $row) |
| 134 | 133 | { |
@@ -147,8 +147,7 @@ discard block |
||
| 147 | 147 | if (!empty($secure)) |
| 148 | 148 | { |
| 149 | 149 | return 'on' == strtolower($secure) || '1' == $secure; |
| 150 | - } |
|
| 151 | - else if ('443' == $this->request->server('SERVER_PORT')) |
|
| 150 | + } else if ('443' == $this->request->server('SERVER_PORT')) |
|
| 152 | 151 | { |
| 153 | 152 | return true; |
| 154 | 153 | } |
@@ -236,10 +235,12 @@ discard block |
||
| 236 | 235 | |
| 237 | 236 | if (property_exists($response, 'errorCode')) |
| 238 | 237 | { |
| 239 | - if ($response->errorCode == 4) // errorCode 4 means that this device wasn't registered |
|
| 238 | + if ($response->errorCode == 4) { |
|
| 239 | + // errorCode 4 means that this device wasn't registered |
|
| 240 | 240 | { |
| 241 | 241 | throw new AccessDeniedHttpException($this->user->lang('TFA_NOT_REGISTERED')); |
| 242 | 242 | } |
| 243 | + } |
|
| 243 | 244 | throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG')); |
| 244 | 245 | } |
| 245 | 246 | $result = new AuthenticationResponse($response->signatureData, $response->clientData, $response->keyHandle, $response->errorCode); |
@@ -253,12 +254,10 @@ discard block |
||
| 253 | 254 | |
| 254 | 255 | $sql = 'UPDATE ' . $this->registration_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE registration_id = ' . (int) $reg->getId(); |
| 255 | 256 | $this->db->sql_query($sql); |
| 256 | - } |
|
| 257 | - catch (U2fError $error) |
|
| 257 | + } catch (U2fError $error) |
|
| 258 | 258 | { |
| 259 | 259 | $this->createError($error); |
| 260 | - } |
|
| 261 | - catch (\InvalidArgumentException $invalid) |
|
| 260 | + } catch (\InvalidArgumentException $invalid) |
|
| 262 | 261 | { |
| 263 | 262 | throw new BadRequestHttpException($this->user->lang('TFA_SOMETHING_WENT_WRONG') . '<br />' . $invalid->getMessage(), $invalid); |
| 264 | 263 | } |
@@ -295,8 +294,7 @@ discard block |
||
| 295 | 294 | if ($count == 0) |
| 296 | 295 | { |
| 297 | 296 | trigger_error('TFA_UNABLE_TO_UPDATE_SESSION'); |
| 298 | - } |
|
| 299 | - else if ($count > 1) |
|
| 297 | + } else if ($count > 1) |
|
| 300 | 298 | { |
| 301 | 299 | // Reset sessions table. We had multiple sessions with same ID!!! |
| 302 | 300 | $sql_ary['u2f_request'] = ''; |
@@ -340,8 +338,7 @@ discard block |
||
| 340 | 338 | ); |
| 341 | 339 | |
| 342 | 340 | $this->update_session($sql_ary); |
| 343 | - } |
|
| 344 | - catch (U2fError $err) |
|
| 341 | + } catch (U2fError $err) |
|
| 345 | 342 | { |
| 346 | 343 | $this->createError($err); |
| 347 | 344 | } |
@@ -108,18 +108,15 @@ discard block |
||
| 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 |
||
| 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 | { |