@@ -199,8 +199,7 @@ |
||
199 | 199 | // We simply return and continue the login procedure (The normal way :)), |
200 | 200 | // and will disable all pages until he has added a 2FA key. |
201 | 201 | return $event; |
202 | - } |
|
203 | - else |
|
202 | + } else |
|
204 | 203 | { |
205 | 204 | $this->session_helper->generate_page($event['login']['user_row']['user_id'], $event['admin'], $event['autologin'], !$this->request->is_set_post('viewonline'), $this->request->variable('redirect', '')); |
206 | 205 | } |
@@ -91,16 +91,16 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function __construct(helper $controller_helper, driver_interface $db, template $template, user $user, request_interface $request, config $config, log $log, session_helper_interface $session_helper, $root_path, $php_ext) |
93 | 93 | { |
94 | - $this->controller_helper = $controller_helper; |
|
95 | - $this->template = $template; |
|
96 | - $this->db = $db; |
|
97 | - $this->user = $user; |
|
98 | - $this->request = $request; |
|
99 | - $this->config = $config; |
|
100 | - $this->session_helper = $session_helper; |
|
101 | - $this->root_path = $root_path; |
|
102 | - $this->php_ext = $php_ext; |
|
103 | - $this->log = $log; |
|
94 | + $this->controller_helper = $controller_helper; |
|
95 | + $this->template = $template; |
|
96 | + $this->db = $db; |
|
97 | + $this->user = $user; |
|
98 | + $this->request = $request; |
|
99 | + $this->config = $config; |
|
100 | + $this->session_helper = $session_helper; |
|
101 | + $this->root_path = $root_path; |
|
102 | + $this->php_ext = $php_ext; |
|
103 | + $this->log = $log; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | 'tfa_random' => '', |
136 | 136 | 'tfa_uid' => 0, |
137 | 137 | ); |
138 | - $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . " |
|
138 | + $sql = 'UPDATE '.SESSIONS_TABLE.' SET '.$this->db->sql_build_array('UPDATE', $sql_ary)." |
|
139 | 139 | WHERE |
140 | - session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "' AND |
|
140 | + session_id = '" . $this->db->sql_escape($this->user->data['session_id'])."' AND |
|
141 | 141 | session_user_id = " . (int) $this->user->data['user_id']; |
142 | 142 | $this->db->sql_query($sql); |
143 | 143 | |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | if ($admin) |
202 | 202 | { |
203 | 203 | // the login array is used because the user ids do not differ for re-authentication |
204 | - $sql = 'DELETE FROM ' . SESSIONS_TABLE . " |
|
205 | - WHERE session_id = '" . $this->db->sql_escape($old_session_id) . "' |
|
204 | + $sql = 'DELETE FROM '.SESSIONS_TABLE." |
|
205 | + WHERE session_id = '" . $this->db->sql_escape($old_session_id)."' |
|
206 | 206 | AND session_user_id = " . (int) $user_id; |
207 | 207 | $this->db->sql_query($sql); |
208 | 208 |
@@ -162,8 +162,7 @@ discard block |
||
162 | 162 | $this->template->assign_var('S_ERROR', $this->user->lang('TFA_INCORRECT_KEY')); |
163 | 163 | $this->session_helper->generate_page($user_id, $admin, $auto_login, $viewonline, $redirect); |
164 | 164 | } |
165 | - } |
|
166 | - catch (http_exception $ex) // @TODO: Replace exception with own exception |
|
165 | + } catch (http_exception $ex) // @TODO: Replace exception with own exception |
|
167 | 166 | { |
168 | 167 | |
169 | 168 | $this->log->add('critical', $this->user->data['user_id'], $this->user->ip, 'LOG_TFA_EXCEPTION', false, [$ex->getMessage()]); |
@@ -177,8 +176,7 @@ discard block |
||
177 | 176 | { |
178 | 177 | $this->template->assign_var('S_ERROR', $this->user->lang($ex->getMessage())); |
179 | 178 | $this->session_helper->generate_page($user_id, $admin, $auto_login, $viewonline, $redirect); |
180 | - } |
|
181 | - else |
|
179 | + } else |
|
182 | 180 | { |
183 | 181 | throw $ex; |
184 | 182 | } |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | 'title' => 'ACP_TFA_SETTINGS', |
44 | 44 | 'vars' => array( |
45 | 45 | 'legend1' => 'ACP_TFA_SETTINGS', |
46 | - 'tfa_mode' => array('lang' => 'TFA_MODE', 'validate' => 'int', 'type' => 'select', 'method' => 'select_tfa_method', 'explain' => true), |
|
47 | - 'tfa_acp' => array('lang' => 'TFA_ACP', 'validate' => 'int', 'type' => 'radio', 'explain' => true), |
|
46 | + 'tfa_mode' => array('lang' => 'TFA_MODE', 'validate' => 'int', 'type' => 'select', 'method' => 'select_tfa_method', 'explain' => true), |
|
47 | + 'tfa_acp' => array('lang' => 'TFA_ACP', 'validate' => 'int', 'type' => 'radio', 'explain' => true), |
|
48 | 48 | |
49 | 49 | 'legend4' => 'ACP_SUBMIT_CHANGES', |
50 | 50 | ) |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | |
99 | 99 | if ($submit) |
100 | 100 | { |
101 | - $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_TFA_CONFIG_' . strtoupper($mode)); |
|
101 | + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_TFA_CONFIG_'.strtoupper($mode)); |
|
102 | 102 | |
103 | 103 | $message = $user->lang('CONFIG_UPDATED'); |
104 | 104 | $message_type = E_USER_NOTICE; |
105 | 105 | |
106 | - trigger_error($message . adm_back_link($this->u_action), $message_type); |
|
106 | + trigger_error($message.adm_back_link($this->u_action), $message_type); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | if (!$request->is_secure()) |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | $template->assign_vars(array( |
118 | 118 | 'L_TITLE' => $user->lang($display_vars['title']), |
119 | - 'L_TITLE_EXPLAIN' => $user->lang($display_vars['title'] . '_EXPLAIN'), |
|
119 | + 'L_TITLE_EXPLAIN' => $user->lang($display_vars['title'].'_EXPLAIN'), |
|
120 | 120 | |
121 | 121 | 'S_ERROR' => (sizeof($error)) ? true : false, |
122 | 122 | 'ERROR_MSG' => implode('<br />', $error), |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | $type = explode(':', $vars['type']); |
146 | 146 | |
147 | 147 | $l_explain = ''; |
148 | - if ($vars['explain'] && array_key_exists($vars['lang'] . '_EXPLAIN', $user->lang)) |
|
148 | + if ($vars['explain'] && array_key_exists($vars['lang'].'_EXPLAIN', $user->lang)) |
|
149 | 149 | { |
150 | - $l_explain = $user->lang($vars['lang'] . '_EXPLAIN'); |
|
150 | + $l_explain = $user->lang($vars['lang'].'_EXPLAIN'); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | $content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | foreach ($act_ary as $key => $data) |
188 | 188 | { |
189 | 189 | $selected = ($data == $selected_value) ? ' selected="selected"' : ''; |
190 | - $act_options .= '<option value="' . $data . '"' . $selected . '>' . $user->lang($key) . '</option>'; |
|
190 | + $act_options .= '<option value="'.$data.'"'.$selected.'>'.$user->lang($key).'</option>'; |
|
191 | 191 | } |
192 | 192 | return $act_options; |
193 | 193 | } |