@@ -70,7 +70,7 @@ |
||
70 | 70 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('options') === false) { |
71 | 71 | // Not allowed page |
72 | 72 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
73 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
73 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
74 | 74 | exit; |
75 | 75 | } |
76 | 76 | ?> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $superGlobal = new SuperGlobal(); |
39 | 39 | $get = []; |
40 | 40 | $get['post_type'] = $superGlobal->get('post_type', 'GET'); |
41 | -if (isset($SETTINGS['duo']) === true && (int) $SETTINGS['duo'] === 1 && $get['post_type'] === 'duo' ) { |
|
41 | +if (isset($SETTINGS['duo']) === true && (int) $SETTINGS['duo'] === 1 && $get['post_type'] === 'duo') { |
|
42 | 42 | $get['duo_state'] = $superGlobal->get('state', 'GET'); |
43 | 43 | $get['duo_code'] = $superGlobal->get('duo_code', 'GET'); |
44 | 44 | } |
@@ -48,8 +48,7 @@ discard block |
||
48 | 48 | <div class="login-box"> |
49 | 49 | <div class="login-logo"><div style="margin:30px;">', |
50 | 50 | isset($SETTINGS['custom_logo']) === true && empty($SETTINGS['custom_logo']) === false ? |
51 | - '<img src="' . (string) $SETTINGS['custom_logo'] . '" alt="" style="text-align:center; max-width:100px;" />' : |
|
52 | - '<img src="includes/images/teampass-logo2-login.png" alt="Teampass Logo">', |
|
51 | + '<img src="'.(string) $SETTINGS['custom_logo'].'" alt="" style="text-align:center; max-width:100px;" />' : '<img src="includes/images/teampass-logo2-login.png" alt="Teampass Logo">', |
|
53 | 52 | ' |
54 | 53 | </div> |
55 | 54 | <div style="font-weight:bold;"> |
@@ -69,14 +68,14 @@ discard block |
||
69 | 68 | |
70 | 69 | <div class="card-body login-card-body1"> |
71 | 70 | <div class="input-group has-feedback mb-2"> |
72 | - <div class="input-group-prepend infotip" title="' . langHdl('login') . '"> |
|
71 | + <div class="input-group-prepend infotip" title="' . langHdl('login').'"> |
|
73 | 72 | <span class="input-group-text"><i class="fa-solid fa-user fa-fw"></i></span> |
74 | 73 | </div>'; |
75 | 74 | if ( |
76 | 75 | isset($SETTINGS['enable_http_request_login']) === true |
77 | 76 | && (int) $SETTINGS['enable_http_request_login'] === 1 |
78 | 77 | && $superGlobal->get('PHP_AUTH_USER', 'SERVER') !== null |
79 | - && ! (isset($SETTINGS['maintenance_mode']) === true |
|
78 | + && !(isset($SETTINGS['maintenance_mode']) === true |
|
80 | 79 | && (int) $SETTINGS['maintenance_mode'] === 1) |
81 | 80 | ) { |
82 | 81 | if (strpos($superGlobal->get('PHP_AUTH_USER', 'SERVER'), '@') !== false) { |
@@ -90,32 +89,32 @@ discard block |
||
90 | 89 | <input type="text" id="login" class="form-control" placeholder="', filter_var($username, FILTER_SANITIZE_FULL_SPECIAL_CHARS), '" readonly>'; |
91 | 90 | } else { |
92 | 91 | echo ' |
93 | - <input type="text" id="login" class="form-control" placeholder="' . langHdl('index_login') . '" value="'.(null !== $superGlobal->get('login', 'SESSION') && empty($superGlobal->get('login', 'SESSION')) === false ? filter_var($superGlobal->get('login', 'SESSION'), FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '').'">'; |
|
92 | + <input type="text" id="login" class="form-control" placeholder="' . langHdl('index_login').'" value="'.(null !== $superGlobal->get('login', 'SESSION') && empty($superGlobal->get('login', 'SESSION')) === false ? filter_var($superGlobal->get('login', 'SESSION'), FILTER_SANITIZE_FULL_SPECIAL_CHARS) : '').'">'; |
|
94 | 93 | } |
95 | 94 | |
96 | 95 | echo ' |
97 | 96 | </div>'; |
98 | -if (! (isset($SETTINGS['enable_http_request_login']) === true |
|
97 | +if (!(isset($SETTINGS['enable_http_request_login']) === true |
|
99 | 98 | && (int) $SETTINGS['enable_http_request_login'] === 1 |
100 | 99 | && $superGlobal->get('PHP_AUTH_USER', 'SERVER') !== null |
101 | - && ! (isset($SETTINGS['maintenance_mode']) === true |
|
100 | + && !(isset($SETTINGS['maintenance_mode']) === true |
|
102 | 101 | && (int) $SETTINGS['maintenance_mode'] === 1))) { |
103 | 102 | echo ' |
104 | 103 | <div class="input-group has-feedback mb-2"> |
105 | - <div class="input-group-prepend infotip" title="' . langHdl('password') . '"> |
|
104 | + <div class="input-group-prepend infotip" title="' . langHdl('password').'"> |
|
106 | 105 | <span class="input-group-text"><i class="fa-solid fa-lock fa-fw"></i></span> |
107 | 106 | </div> |
108 | - <input type="password" id="pw" class="form-control submit-button" placeholder="' . langHdl('index_password') . '"> |
|
107 | + <input type="password" id="pw" class="form-control submit-button" placeholder="' . langHdl('index_password').'"> |
|
109 | 108 | </div>'; |
110 | 109 | } |
111 | 110 | |
112 | 111 | echo ' |
113 | 112 | <div class="input-group has-feedback mb-2"> |
114 | - <div class="input-group-prepend infotip" title="' . langHdl('session_expiration_in_minutes') . '"> |
|
113 | + <div class="input-group-prepend infotip" title="' . langHdl('session_expiration_in_minutes').'"> |
|
115 | 114 | <span class="input-group-text"><i class="fa-solid fa-clock fa-fw"></i></span> |
116 | 115 | </div> |
117 | 116 | <input type="text" id="session_duration" class="form-control submit-button" |
118 | - placeholder="' . langHdl('index_session_duration') .' (' . langHdl('minutes') . ')" |
|
117 | + placeholder="' . langHdl('index_session_duration').' ('.langHdl('minutes').')" |
|
119 | 118 | value="', isset($SETTINGS['default_session_expiration_time']) === true ? $SETTINGS['default_session_expiration_time'] : '', '"> |
120 | 119 | </div>'; |
121 | 120 | // 2FA auth selector |
@@ -125,7 +124,7 @@ discard block |
||
125 | 124 | <input type="hidden" id="duo_state" value="', isset($get['duo_state']) === true && is_null($get['duo_state']) === false ? $get['duo_state'] : '', '"> |
126 | 125 | <div class="row mb-3 hidden" id="2fa_methods_selector"> |
127 | 126 | <div class="col-12"> |
128 | - <h8 class="login-box-msg">' . langHdl('2fa_authentication_selector') . '</h8> |
|
127 | + <h8 class="login-box-msg">' . langHdl('2fa_authentication_selector').'</h8> |
|
129 | 128 | <div class="2fa-methods text-center mt-2">', |
130 | 129 | isset($SETTINGS['google_authentication']) === true && (int) $SETTINGS['google_authentication'] === 1 ? |
131 | 130 | ' |
@@ -159,14 +158,14 @@ discard block |
||
159 | 158 | echo ' |
160 | 159 | <div id="div-2fa-google" class="mb-3 div-2fa-method hidden"> |
161 | 160 | <div class="input-group has-feedback mb-2"> |
162 | - <div class="input-group-prepend infotip" title="' . langHdl('mfa_unique_code') . '"> |
|
161 | + <div class="input-group-prepend infotip" title="' . langHdl('mfa_unique_code').'"> |
|
163 | 162 | <span class="input-group-text"><i class="fa-solid fa-key fa-fw"></i></span> |
164 | 163 | </div> |
165 | - <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . langHdl('ga_identification_code') . '" /> |
|
164 | + <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . langHdl('ga_identification_code').'" /> |
|
166 | 165 | <span class="input-group-append"> |
167 | 166 | <button type="button" class="btn btn-info btn-flat" onclick="send_user_new_temporary_ga_code()"> |
168 | 167 | <i class="fa-solid fa-envelope form-control-feedback pointer infotip" |
169 | - title="' . langHdl('i_need_to_generate_new_ga_code') . '"></i> |
|
168 | + title="' . langHdl('i_need_to_generate_new_ga_code').'"></i> |
|
170 | 169 | </button> |
171 | 170 | </span> |
172 | 171 | </div> |
@@ -184,7 +183,7 @@ discard block |
||
184 | 183 | <script> |
185 | 184 | var seconds = 1; |
186 | 185 | function updateLogonButton(timeToGo){ |
187 | - document.getElementById("but_identify_user").value = "' . langHdl('duration_login_attempt') . ' " + timeToGo; |
|
186 | + document.getElementById("but_identify_user").value = "' . langHdl('duration_login_attempt').' " + timeToGo; |
|
188 | 187 | } |
189 | 188 | $( window ).on( "load", function() { |
190 | 189 | updateLogonButton(seconds); |
@@ -193,7 +192,7 @@ discard block |
||
193 | 192 | if (seconds >= 0) { |
194 | 193 | updateLogonButton(seconds); |
195 | 194 | } else if(seconds === 0) { |
196 | - launchIdentify("", "' . $nextUrl . '"); |
|
195 | + launchIdentify("", "' . $nextUrl.'"); |
|
197 | 196 | } |
198 | 197 | updateLogonButton(seconds); |
199 | 198 | }, |
@@ -214,15 +213,15 @@ discard block |
||
214 | 213 | <div class="col-8"> |
215 | 214 | <div id="yubiko-new-key" class="alert alert-info hidden"> |
216 | 215 | <p> |
217 | - <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . langHdl('yubico_user_id') . '"> |
|
216 | + <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . langHdl('yubico_user_id').'"> |
|
218 | 217 | </p> |
219 | 218 | <p> |
220 | - <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . langHdl('yubico_user_key') . '"> |
|
219 | + <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . langHdl('yubico_user_key').'"> |
|
221 | 220 | </p> |
222 | 221 | </div> |
223 | - <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . langHdl('press_your_yubico_key') . '"> |
|
222 | + <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . langHdl('press_your_yubico_key').'"> |
|
224 | 223 | <div class="row"> |
225 | - <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . langHdl('register_new_yubiko_key') . '</span> |
|
224 | + <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . langHdl('register_new_yubiko_key').'</span> |
|
226 | 225 | </div> |
227 | 226 | </div> |
228 | 227 | </div>'; |
@@ -231,22 +230,22 @@ discard block |
||
231 | 230 | echo ' |
232 | 231 | <div class="row mb-3 mt-5"> |
233 | 232 | <div class="col-12"> |
234 | - <button id="but_identify_user" class="btn btn-primary btn-block">' . langHdl('log_in') . '</button> |
|
233 | + <button id="but_identify_user" class="btn btn-primary btn-block">' . langHdl('log_in').'</button> |
|
235 | 234 | |
236 | 235 | <!-- In case of upgrade, the user has to provide his One Time Code --> |
237 | 236 | <div class="card-body user-one-time-code-card-body hidden"> |
238 | - <h5 class="login-box-msg">' . langHdl('provide_personal_one_time_code') . '</h5> |
|
237 | + <h5 class="login-box-msg">' . langHdl('provide_personal_one_time_code').'</h5> |
|
239 | 238 | |
240 | 239 | <div class="input-group has-feedback mb-2 mt-4"> |
241 | 240 | <div class="input-group-prepend"> |
242 | 241 | <span class="input-group-text"><i class="fa-solid fa-unlock-alt"></i></span> |
243 | 242 | </div> |
244 | - <input type="password" id="user-one-time-code" class="form-control" placeholder="' . langHdl('one_time_code') . '"> |
|
243 | + <input type="password" id="user-one-time-code" class="form-control" placeholder="' . langHdl('one_time_code').'"> |
|
245 | 244 | </div> |
246 | 245 | |
247 | 246 | <div class="row mb-3"> |
248 | 247 | <div class="col-12"> |
249 | - <button id="but_confirm_otc" class="btn btn-primary btn-block">' . langHdl('confirm') . '</button> |
|
248 | + <button id="but_confirm_otc" class="btn btn-primary btn-block">' . langHdl('confirm').'</button> |
|
250 | 249 | </div> |
251 | 250 | </div> |
252 | 251 | </div> |
@@ -261,10 +260,10 @@ discard block |
||
261 | 260 | // In case of password change |
262 | 261 | echo ' |
263 | 262 | <div class="card-body confirm-password-card-body hidden"> |
264 | - <h5 class="login-box-msg">' . langHdl('new_password_required') . '</h5> |
|
263 | + <h5 class="login-box-msg">' . langHdl('new_password_required').'</h5> |
|
265 | 264 | |
266 | 265 | <div class="alert alert-info"> |
267 | - <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('password_strength') . ' |
|
266 | + <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('password_strength').' |
|
268 | 267 | <span id="confirm-password-level" class="ml-2 font-weight-bold"></span></div> |
269 | 268 | </div> |
270 | 269 | |
@@ -274,20 +273,20 @@ discard block |
||
274 | 273 | <div class="input-group-prepend"> |
275 | 274 | <span class="input-group-text"><i class="fas fa-key"></i></span> |
276 | 275 | </div> |
277 | - <input type="password" id="current-user-password" class="form-control" placeholder="' . langHdl('current_password') . '"> |
|
276 | + <input type="password" id="current-user-password" class="form-control" placeholder="' . langHdl('current_password').'"> |
|
278 | 277 | </div> |
279 | 278 | </div> |
280 | 279 | <div class="input-group has-feedback mb-2 mt-4"> |
281 | 280 | <div class="input-group-prepend"> |
282 | 281 | <span class="input-group-text"><i class="fas fa-key"></i></span> |
283 | 282 | </div> |
284 | - <input type="password" id="new-user-password" class="form-control" placeholder="' . langHdl('index_new_pw') . '"> |
|
283 | + <input type="password" id="new-user-password" class="form-control" placeholder="' . langHdl('index_new_pw').'"> |
|
285 | 284 | </div> |
286 | 285 | <div class="input-group has-feedback mb-2"> |
287 | 286 | <div class="input-group-prepend"> |
288 | 287 | <span class="input-group-text"><i class="fas fa-key"></i></span> |
289 | 288 | </div> |
290 | - <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . langHdl('index_change_pw_confirmation') . '"> |
|
289 | + <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . langHdl('index_change_pw_confirmation').'"> |
|
291 | 290 | </div> |
292 | 291 | <div class="row mb-3"> |
293 | 292 | <div class="col-md-12 offset-sm-4 text-center"> |
@@ -298,7 +297,7 @@ discard block |
||
298 | 297 | </div> |
299 | 298 | <div class="row mb-3"> |
300 | 299 | <div class="col-12"> |
301 | - <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . langHdl('confirm') . '</button> |
|
300 | + <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . langHdl('confirm').'</button> |
|
302 | 301 | </div> |
303 | 302 | </div> |
304 | 303 | </div> |
@@ -306,20 +305,20 @@ discard block |
||
306 | 305 | |
307 | 306 | <div class="card-body hidden" id="card-user-treat-psk"> |
308 | 307 | <div class="alert alert-info"> |
309 | - <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('user_has_psk_info') . '</div> |
|
308 | + <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('user_has_psk_info').'</div> |
|
310 | 309 | </div> |
311 | 310 | <div class="input-group has-feedback mb-2"> |
312 | 311 | <div class="input-group-prepend"> |
313 | 312 | <span class="input-group-text"><i class="fas fa-key"></i></span> |
314 | 313 | </div> |
315 | - <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . langHdl('home_personal_saltkey') . '"> |
|
314 | + <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . langHdl('home_personal_saltkey').'"> |
|
316 | 315 | </div> |
317 | 316 | <div class="row mb-3 mt-4"> |
318 | 317 | <div class="col-12"> |
319 | - <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . langHdl('launch') . '</button> |
|
318 | + <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . langHdl('launch').'</button> |
|
320 | 319 | </div> |
321 | 320 | <div class="col-12 mt-3"> |
322 | - <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . langHdl('i_cannot_remember') . '</button> |
|
321 | + <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . langHdl('i_cannot_remember').'</button> |
|
323 | 322 | </div> |
324 | 323 | </div> |
325 | 324 | </div> |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | WHERE code = %s', |
77 | 77 | filter_input(INPUT_GET, 'code', FILTER_SANITIZE_FULL_SPECIAL_CHARS) |
78 | 78 | ); |
79 | - if (DB::count() > 0 && (int) $data['timestamp'] === (int) filter_input(INPUT_GET, 'stamp', FILTER_VALIDATE_INT)) { |
|
79 | + if (DB::count() > 0 && (int) $data['timestamp'] === (int) filter_input(INPUT_GET, 'stamp', FILTER_VALIDATE_INT)) { |
|
80 | 80 | // otv is too old |
81 | 81 | if ($data['time_limit'] < time() || ($data['views'] + 1) > $data['max_views']) { |
82 | 82 | $html = 'Link is too old!'; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | <tr><th>URL:</th><td>'.$url.'</td></tr> |
180 | 180 | </table></div> |
181 | 181 | <p class="mt-3 text-info"><i class="fas fa-info mr-2"></i>Copy carefully the data you need.<br>This page is visible until <b>'. |
182 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $dataItem['time_limit']).'</b> OR <b>'.($dataItem['max_views'] - ($dataItem['views']+1)).' more time(s)</b>.</div> |
|
182 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $dataItem['time_limit']).'</b> OR <b>'.($dataItem['max_views'] - ($dataItem['views'] + 1)).' more time(s)</b>.</div> |
|
183 | 183 | </div>'; |
184 | 184 | // log |
185 | 185 | logItems( |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | ) { |
67 | 67 | // Not allowed page |
68 | 68 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
69 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
69 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
70 | 70 | exit; |
71 | 71 | } |
72 | 72 | |
@@ -130,21 +130,21 @@ discard block |
||
130 | 130 | // Prepare variables |
131 | 131 | $post_key = filter_var($dataReceived['encryptionKey'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
132 | 132 | |
133 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
133 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
134 | 134 | $return = ''; |
135 | 135 | |
136 | 136 | //Get all tables |
137 | 137 | $tables = array(); |
138 | 138 | $result = DB::query('SHOW TABLES'); |
139 | 139 | foreach ($result as $row) { |
140 | - $tables[] = $row['Tables_in_' . DB_NAME]; |
|
140 | + $tables[] = $row['Tables_in_'.DB_NAME]; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | //cycle through |
144 | 144 | foreach ($tables as $table) { |
145 | 145 | if (empty($pre) || substr_count($table, $pre) > 0) { |
146 | 146 | // Do query |
147 | - $result = DB::queryRaw('SELECT * FROM ' . $table); |
|
147 | + $result = DB::queryRaw('SELECT * FROM '.$table); |
|
148 | 148 | DB::queryRaw( |
149 | 149 | 'SELECT * |
150 | 150 | FROM INFORMATION_SCHEMA.COLUMNS |
@@ -156,19 +156,19 @@ discard block |
||
156 | 156 | $numFields = DB::count(); |
157 | 157 | |
158 | 158 | // prepare a drop table |
159 | - $return .= 'DROP TABLE ' . $table . ';'; |
|
160 | - $row2 = DB::queryfirstrow('SHOW CREATE TABLE ' . $table); |
|
161 | - $return .= "\n\n" . $row2['Create Table'] . ";\n\n"; |
|
159 | + $return .= 'DROP TABLE '.$table.';'; |
|
160 | + $row2 = DB::queryfirstrow('SHOW CREATE TABLE '.$table); |
|
161 | + $return .= "\n\n".$row2['Create Table'].";\n\n"; |
|
162 | 162 | |
163 | 163 | //prepare all fields and datas |
164 | 164 | for ($i = 0; $i < $numFields; ++$i) { |
165 | 165 | while ($row = $result->fetch_row()) { |
166 | - $return .= 'INSERT INTO ' . $table . ' VALUES('; |
|
166 | + $return .= 'INSERT INTO '.$table.' VALUES('; |
|
167 | 167 | for ($j = 0; $j < $numFields; ++$j) { |
168 | 168 | $row[$j] = is_null($row[$j]) === false ? addslashes($row[$j]) : ''; |
169 | 169 | $row[$j] = preg_replace("/\n/", '\\n', $row[$j]); |
170 | 170 | if (isset($row[$j])) { |
171 | - $return .= '"' . $row[$j] . '"'; |
|
171 | + $return .= '"'.$row[$j].'"'; |
|
172 | 172 | } else { |
173 | 173 | $return .= 'NULL'; |
174 | 174 | } |
@@ -188,8 +188,8 @@ discard block |
||
188 | 188 | $token = GenerateCryptKey(20, false, true, true, false, true, $SETTINGS); |
189 | 189 | |
190 | 190 | //save file |
191 | - $filename = time() . '-' . $token . '.sql'; |
|
192 | - $handle = fopen($SETTINGS['path_to_files_folder'] . '/' . $filename, 'w+'); |
|
191 | + $filename = time().'-'.$token.'.sql'; |
|
192 | + $handle = fopen($SETTINGS['path_to_files_folder'].'/'.$filename, 'w+'); |
|
193 | 193 | if ($handle !== false) { |
194 | 194 | //write file |
195 | 195 | fwrite($handle, $return); |
@@ -201,17 +201,17 @@ discard block |
||
201 | 201 | // Encrypt the file |
202 | 202 | prepareFileWithDefuse( |
203 | 203 | 'encrypt', |
204 | - $SETTINGS['path_to_files_folder'] . '/' . $filename, |
|
205 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename, |
|
204 | + $SETTINGS['path_to_files_folder'].'/'.$filename, |
|
205 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename, |
|
206 | 206 | $SETTINGS, |
207 | 207 | $post_key |
208 | 208 | ); |
209 | 209 | |
210 | 210 | // Do clean |
211 | - unlink($SETTINGS['path_to_files_folder'] . '/' . $filename); |
|
211 | + unlink($SETTINGS['path_to_files_folder'].'/'.$filename); |
|
212 | 212 | rename( |
213 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename, |
|
214 | - $SETTINGS['path_to_files_folder'] . '/' . $filename |
|
213 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename, |
|
214 | + $SETTINGS['path_to_files_folder'].'/'.$filename |
|
215 | 215 | ); |
216 | 216 | } |
217 | 217 | |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | array( |
232 | 232 | 'error' => false, |
233 | 233 | 'message' => '', |
234 | - 'download' => 'sources/downloadFile.php?name=' . urlencode($filename) . |
|
235 | - '&sub=files&file=' . $filename . '&type=sql&key=' . $_SESSION['key'] . '&key_tmp=' . |
|
236 | - $_SESSION['key_tmp'] . '&pathIsFiles=1', |
|
234 | + 'download' => 'sources/downloadFile.php?name='.urlencode($filename). |
|
235 | + '&sub=files&file='.$filename.'&type=sql&key='.$_SESSION['key'].'&key_tmp='. |
|
236 | + $_SESSION['key_tmp'].'&pathIsFiles=1', |
|
237 | 237 | ), |
238 | 238 | 'encode' |
239 | 239 | ); |
@@ -282,12 +282,12 @@ discard block |
||
282 | 282 | $post_key = filter_var($dataReceived['encryptionKey'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
283 | 283 | $post_backupFile = filter_var($dataReceived['backupFile'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
284 | 284 | |
285 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
285 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
286 | 286 | |
287 | 287 | // Get filename from database |
288 | 288 | $data = DB::queryFirstRow( |
289 | 289 | 'SELECT valeur |
290 | - FROM ' . prefixTable('misc') . ' |
|
290 | + FROM ' . prefixTable('misc').' |
|
291 | 291 | WHERE increment_id = %i', |
292 | 292 | $post_backupFile |
293 | 293 | ); |
@@ -306,8 +306,8 @@ discard block |
||
306 | 306 | // Decrypt the file |
307 | 307 | $ret = prepareFileWithDefuse( |
308 | 308 | 'decrypt', |
309 | - $SETTINGS['path_to_files_folder'] . '/' . $post_backupFile, |
|
310 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $post_backupFile, |
|
309 | + $SETTINGS['path_to_files_folder'].'/'.$post_backupFile, |
|
310 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$post_backupFile, |
|
311 | 311 | $SETTINGS, |
312 | 312 | $post_key |
313 | 313 | ); |
@@ -324,10 +324,10 @@ discard block |
||
324 | 324 | } |
325 | 325 | |
326 | 326 | // Do clean |
327 | - fileDelete($SETTINGS['path_to_files_folder'] . '/' . $post_backupFile, $SETTINGS); |
|
328 | - $post_backupFile = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $post_backupFile; |
|
327 | + fileDelete($SETTINGS['path_to_files_folder'].'/'.$post_backupFile, $SETTINGS); |
|
328 | + $post_backupFile = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$post_backupFile; |
|
329 | 329 | } else { |
330 | - $post_backupFile = $SETTINGS['path_to_files_folder'] . '/' . $post_backupFile; |
|
330 | + $post_backupFile = $SETTINGS['path_to_files_folder'].'/'.$post_backupFile; |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | //read sql file |
@@ -66,7 +66,7 @@ |
||
66 | 66 | ) { |
67 | 67 | // Not allowed page |
68 | 68 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
69 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
69 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
70 | 70 | exit; |
71 | 71 | } |
72 | 72 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | ) { |
67 | 67 | // Not allowed page |
68 | 68 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
69 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
69 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
70 | 70 | exit; |
71 | 71 | } |
72 | 72 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | ); |
134 | 134 | |
135 | 135 | $lastFolderChange = DB::queryfirstrow( |
136 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' |
|
136 | + 'SELECT valeur FROM '.prefixTable('misc').' |
|
137 | 137 | WHERE type = %s AND intitule = %s', |
138 | 138 | 'timestamp', |
139 | 139 | 'last_folder_change' |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | foreach ($currentNode->children as $child) { |
456 | 456 | recursiveTree( |
457 | 457 | (int) $child, |
458 | - $tree->getNode($child),// get node info for this child |
|
458 | + $tree->getNode($child), // get node info for this child |
|
459 | 459 | /** @scrutinizer ignore-type */ $tree, |
460 | 460 | $listFoldersLimitedKeys, |
461 | 461 | $listRestrictedFoldersForItemsKeys, |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | ): array |
499 | 499 | { |
500 | 500 | // prepare json return for current node |
501 | - $parent = $currentNode->parent_id === '0' ? '#' : 'li_' . $currentNode->parent_id; |
|
501 | + $parent = $currentNode->parent_id === '0' ? '#' : 'li_'.$currentNode->parent_id; |
|
502 | 502 | |
503 | 503 | // handle displaying |
504 | 504 | if (isKeyExistingAndEqual('show_only_accessible_folders', 1, $SETTINGS) === true) { |
@@ -515,17 +515,17 @@ discard block |
||
515 | 515 | array_push( |
516 | 516 | $ret_json, |
517 | 517 | array( |
518 | - 'id' => 'li_' . $nodeId, |
|
518 | + 'id' => 'li_'.$nodeId, |
|
519 | 519 | 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent, |
520 | 520 | 'text' => '<i class="'.$currentNode->fa_icon.' tree-folder mr-2" data-folder="'.$currentNode->fa_icon.'" data-folder-selected="'.$currentNode->fa_icon_selected.'"></i>'.$text.$currentNode->title.$nodeData['html'], |
521 | 521 | 'li_attr' => array( |
522 | 522 | 'class' => 'jstreeopen', |
523 | - 'title' => 'ID [' . $nodeId . '] ' . $nodeData['title'], |
|
523 | + 'title' => 'ID ['.$nodeId.'] '.$nodeData['title'], |
|
524 | 524 | ), |
525 | 525 | 'a_attr' => array( |
526 | - 'id' => 'fld_' . $nodeId, |
|
526 | + 'id' => 'fld_'.$nodeId, |
|
527 | 527 | 'class' => $nodeData['folderClass'], |
528 | - 'onclick' => 'ListerItems(' . $nodeId . ', ' . $nodeData['restricted'] . ', 0, 1)', |
|
528 | + 'onclick' => 'ListerItems('.$nodeId.', '.$nodeData['restricted'].', 0, 1)', |
|
529 | 529 | 'data-title' => $currentNode->title, |
530 | 530 | ), |
531 | 531 | 'is_pf' => in_array($nodeId, $inputData['personalFolders']) === true ? 1 : 0, |
@@ -541,12 +541,12 @@ discard block |
||
541 | 541 | array_push( |
542 | 542 | $ret_json, |
543 | 543 | array( |
544 | - 'id' => 'li_' . $nodeId, |
|
544 | + 'id' => 'li_'.$nodeId, |
|
545 | 545 | 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent, |
546 | 546 | 'text' => '<i class="'.$currentNode->fa_icon.' tree-folder mr-2" data-folder="'.$currentNode->fa_icon.'" data-folder-selected="'.$currentNode->fa_icon_selected.'"></i>'.'<i class="fas fa-times fa-xs text-danger mr-1 ml-1"></i>'.$text.$currentNode->title.$nodeData['html'], |
547 | 547 | 'li_attr' => array( |
548 | 548 | 'class' => '', |
549 | - 'title' => 'ID [' . $nodeId . '] ' . langHdl('no_access'), |
|
549 | + 'title' => 'ID ['.$nodeId.'] '.langHdl('no_access'), |
|
550 | 550 | ), |
551 | 551 | ) |
552 | 552 | ); |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | if (in_array($nodeId, $session_read_only_folders) === true) { |
605 | 605 | return [ |
606 | 606 | 'html' => '<i class="far fa-eye fa-xs mr-1 ml-1"></i>'. |
607 | - ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>' : ''), |
|
607 | + ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''), |
|
608 | 608 | 'title' => langHdl('read_only_account'), |
609 | 609 | 'restricted' => 1, |
610 | 610 | 'folderClass' => 'folder_not_droppable', |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | ) { |
620 | 620 | return [ |
621 | 621 | 'html' => '<i class="far fa-eye fa-xs mr-1"></i>'. |
622 | - ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>' : ''), |
|
622 | + ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''), |
|
623 | 623 | 'title' => langHdl('read_only_account'), |
624 | 624 | 'restricted' => 0, |
625 | 625 | 'folderClass' => 'folder', |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | } |
631 | 631 | |
632 | 632 | return [ |
633 | - 'html' => ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>' : ''), |
|
633 | + 'html' => ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''), |
|
634 | 634 | 'title' => '', |
635 | 635 | 'restricted' => 0, |
636 | 636 | 'folderClass' => 'folder', |
@@ -641,8 +641,8 @@ discard block |
||
641 | 641 | |
642 | 642 | } elseif (in_array($nodeId, $listFoldersLimitedKeys) === true) { |
643 | 643 | return [ |
644 | - 'html' => ($session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '') . |
|
645 | - ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . count($session_list_folders_limited[$nodeId]) . '</span>' : ''), |
|
644 | + 'html' => ($session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : ''). |
|
645 | + ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.count($session_list_folders_limited[$nodeId]).'</span>' : ''), |
|
646 | 646 | 'title' => '', |
647 | 647 | 'restricted' => 1, |
648 | 648 | 'folderClass' => 'folder', |
@@ -653,8 +653,8 @@ discard block |
||
653 | 653 | |
654 | 654 | } elseif (in_array($nodeId, $listRestrictedFoldersForItemsKeys) === true) { |
655 | 655 | return [ |
656 | - 'html' => $session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '' . |
|
657 | - '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . count($session_list_restricted_folders_for_items[$nodeId]) . '</span>', |
|
656 | + 'html' => $session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : ''. |
|
657 | + '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.count($session_list_restricted_folders_for_items[$nodeId]).'</span>', |
|
658 | 658 | 'title' => '', |
659 | 659 | 'restricted' => 1, |
660 | 660 | 'folderClass' => 'folder', |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | // Does this user has a tree cache |
765 | 765 | $userCacheTree = DB::queryfirstrow( |
766 | 766 | 'SELECT data |
767 | - FROM ' . prefixTable('cache_tree') . ' |
|
767 | + FROM ' . prefixTable('cache_tree').' |
|
768 | 768 | WHERE user_id = %i', |
769 | 769 | $userId |
770 | 770 | ); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | ) { |
73 | 73 | // Not allowed page |
74 | 74 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
75 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
75 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
76 | 76 | exit; |
77 | 77 | } |
78 | 78 | |
@@ -97,19 +97,19 @@ discard block |
||
97 | 97 | $get_pathIsFiles = $superGlobal->get('pathIsFiles', 'GET'); |
98 | 98 | |
99 | 99 | // prepare Encryption class calls |
100 | -header('Content-disposition: attachment; filename=' . rawurldecode(basename($get_filename))); |
|
100 | +header('Content-disposition: attachment; filename='.rawurldecode(basename($get_filename))); |
|
101 | 101 | header('Content-Type: application/octet-stream'); |
102 | 102 | header('Cache-Control: must-revalidate, no-cache, no-store'); |
103 | 103 | header('Expires: 0'); |
104 | 104 | if (isset($_GET['pathIsFiles']) && (int) $get_pathIsFiles === 1) { |
105 | - readfile($SETTINGS['path_to_files_folder'] . '/' . basename($get_filename)); |
|
105 | + readfile($SETTINGS['path_to_files_folder'].'/'.basename($get_filename)); |
|
106 | 106 | } else { |
107 | 107 | // get file key |
108 | 108 | $file_info = DB::queryfirstrow( |
109 | 109 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension, |
110 | 110 | s.share_key AS share_key |
111 | - FROM ' . prefixTable('files') . ' AS f |
|
112 | - INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id) |
|
111 | + FROM ' . prefixTable('files').' AS f |
|
112 | + INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id) |
|
113 | 113 | WHERE s.user_id = %i AND s.object_id = %i', |
114 | 114 | $_SESSION['user_id'], |
115 | 115 | $get_fileid |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
129 | 129 | header('Cache-Control: private', false); |
130 | 130 | header('Content-Type: application/octet-stream'); |
131 | - header('Content-Disposition: attachment; filename="' . $filename . '.' . $file_info['extension'] . '";'); |
|
131 | + header('Content-Disposition: attachment; filename="'.$filename.'.'.$file_info['extension'].'";'); |
|
132 | 132 | header('Content-Transfer-Encoding: binary'); |
133 | 133 | // Stream the CSV data |
134 | 134 | exit(base64_decode($fileContent)); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) { |
68 | 68 | // Not allowed page |
69 | 69 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
70 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
70 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
71 | 71 | exit; |
72 | 72 | } |
73 | 73 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | array( |
121 | 121 | 'http' => array( |
122 | 122 | 'ignore_errors' => true, |
123 | - 'proxy' => $SETTINGS['proxy_ip'] . ':' . $SETTINGS['proxy_port'], |
|
123 | + 'proxy' => $SETTINGS['proxy_ip'].':'.$SETTINGS['proxy_port'], |
|
124 | 124 | ), |
125 | 125 | ) |
126 | 126 | ); |
@@ -139,16 +139,16 @@ discard block |
||
139 | 139 | $json_array = json_decode($json, true); |
140 | 140 | |
141 | 141 | // About version |
142 | - $text .= '<li><u>' . $LANG['your_version'] . '</u> : ' . TP_VERSION; |
|
142 | + $text .= '<li><u>'.$LANG['your_version'].'</u> : '.TP_VERSION; |
|
143 | 143 | if (floatval(TP_VERSION) < floatval($json_array['info']['version'])) { |
144 | - $text .= ' <b>' . $LANG['please_update'] . '</b>'; |
|
144 | + $text .= ' <b>'.$LANG['please_update'].'</b>'; |
|
145 | 145 | } |
146 | 146 | $text .= '</li>'; |
147 | 147 | |
148 | 148 | // Libraries |
149 | 149 | $text .= '<li><u>Libraries</u> :</li>'; |
150 | 150 | foreach ($json_array['libraries'] as $key => $val) { |
151 | - $text .= "<li> <span class='fa fa-caret-right'></span> " . $key . " (<a href='" . $val . "' target='_blank'>" . $val . '</a>)</li>'; |
|
151 | + $text .= "<li> <span class='fa fa-caret-right'></span> ".$key." (<a href='".$val."' target='_blank'>".$val.'</a>)</li>'; |
|
152 | 152 | } |
153 | 153 | } |
154 | 154 | } else { |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | } |
160 | 160 | $text .= '</ul>'; |
161 | 161 | |
162 | - echo '[{"error":"' . $error . '" , "output":"' . str_replace(array("\n", "\t", "\r"), '', $text) . '"}]'; |
|
162 | + echo '[{"error":"'.$error.'" , "output":"'.str_replace(array("\n", "\t", "\r"), '', $text).'"}]'; |
|
163 | 163 | break; |
164 | 164 | |
165 | 165 | |
@@ -189,21 +189,21 @@ discard block |
||
189 | 189 | break; |
190 | 190 | } |
191 | 191 | |
192 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
192 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
193 | 193 | $return = ''; |
194 | 194 | |
195 | 195 | //Get all tables |
196 | 196 | $tables = array(); |
197 | 197 | $result = DB::query('SHOW TABLES'); |
198 | 198 | foreach ($result as $row) { |
199 | - $tables[] = $row['Tables_in_' . $database]; |
|
199 | + $tables[] = $row['Tables_in_'.$database]; |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | //cycle through |
203 | 203 | foreach ($tables as $table) { |
204 | 204 | if (defined('DB_PREFIX') || substr_count($table, DB_PREFIX) > 0) { |
205 | 205 | // Do query |
206 | - $result = DB::queryRaw('SELECT * FROM ' . $table); |
|
206 | + $result = DB::queryRaw('SELECT * FROM '.$table); |
|
207 | 207 | DB::queryRaw( |
208 | 208 | 'SELECT * |
209 | 209 | FROM INFORMATION_SCHEMA.COLUMNS |
@@ -215,19 +215,19 @@ discard block |
||
215 | 215 | $numFields = DB::count(); |
216 | 216 | |
217 | 217 | // prepare a drop table |
218 | - $return .= 'DROP TABLE ' . $table . ';'; |
|
219 | - $row2 = DB::queryfirstrow('SHOW CREATE TABLE ' . $table); |
|
220 | - $return .= "\n\n" . $row2['Create Table'] . ";\n\n"; |
|
218 | + $return .= 'DROP TABLE '.$table.';'; |
|
219 | + $row2 = DB::queryfirstrow('SHOW CREATE TABLE '.$table); |
|
220 | + $return .= "\n\n".$row2['Create Table'].";\n\n"; |
|
221 | 221 | |
222 | 222 | //prepare all fields and datas |
223 | 223 | for ($i = 0; $i < $numFields; ++$i) { |
224 | 224 | while ($row = $result->fetch_row()) { |
225 | - $return .= 'INSERT INTO ' . $table . ' VALUES('; |
|
225 | + $return .= 'INSERT INTO '.$table.' VALUES('; |
|
226 | 226 | for ($j = 0; $j < $numFields; ++$j) { |
227 | 227 | $row[$j] = addslashes($row[$j]); |
228 | 228 | $row[$j] = preg_replace("/\n/", '\\n', $row[$j]); |
229 | 229 | if (isset($row[$j])) { |
230 | - $return .= '"' . $row[$j] . '"'; |
|
230 | + $return .= '"'.$row[$j].'"'; |
|
231 | 231 | } else { |
232 | 232 | $return .= 'NULL'; |
233 | 233 | } |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | $token = GenerateCryptKey(20, false, true, true, false, true, $SETTINGS); |
248 | 248 | |
249 | 249 | //save file |
250 | - $filename = time() . '-' . $token . '.sql'; |
|
251 | - $handle = fopen($SETTINGS['path_to_files_folder'] . '/' . $filename, 'w+'); |
|
250 | + $filename = time().'-'.$token.'.sql'; |
|
251 | + $handle = fopen($SETTINGS['path_to_files_folder'].'/'.$filename, 'w+'); |
|
252 | 252 | if ($handle !== false) { |
253 | 253 | //write file |
254 | 254 | fwrite($handle, $return); |
@@ -260,17 +260,17 @@ discard block |
||
260 | 260 | // Encrypt the file |
261 | 261 | prepareFileWithDefuse( |
262 | 262 | 'encrypt', |
263 | - $SETTINGS['path_to_files_folder'] . '/' . $filename, |
|
264 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename, |
|
263 | + $SETTINGS['path_to_files_folder'].'/'.$filename, |
|
264 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename, |
|
265 | 265 | $SETTINGS, |
266 | 266 | $post_option |
267 | 267 | ); |
268 | 268 | |
269 | 269 | // Do clean |
270 | - unlink($SETTINGS['path_to_files_folder'] . '/' . $filename); |
|
270 | + unlink($SETTINGS['path_to_files_folder'].'/'.$filename); |
|
271 | 271 | rename( |
272 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename, |
|
273 | - $SETTINGS['path_to_files_folder'] . '/' . $filename |
|
272 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename, |
|
273 | + $SETTINGS['path_to_files_folder'].'/'.$filename |
|
274 | 274 | ); |
275 | 275 | } |
276 | 276 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | //update LOG |
281 | 281 | logEvents($SETTINGS, 'admin_action', 'dataBase backup', (string) $_SESSION['user_id'], $_SESSION['login']); |
282 | 282 | |
283 | - echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name=' . urlencode($filename) . '&sub=files&file=' . $filename . '&type=sql&key=' . $_SESSION['key'] . '&key_tmp=' . $_SESSION['key_tmp'] . '&pathIsFiles=1"}]'; |
|
283 | + echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name='.urlencode($filename).'&sub=files&file='.$filename.'&type=sql&key='.$_SESSION['key'].'&key_tmp='.$_SESSION['key_tmp'].'&pathIsFiles=1"}]'; |
|
284 | 284 | } |
285 | 285 | break; |
286 | 286 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | ); |
310 | 310 | break; |
311 | 311 | } |
312 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
312 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
313 | 313 | |
314 | 314 | $dataPost = explode('&', $post_option); |
315 | 315 | $file = htmlspecialchars($dataPost[0]); |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | // Get filename from database |
319 | 319 | $data = DB::queryFirstRow( |
320 | 320 | 'SELECT valeur |
321 | - FROM ' . prefixTable('misc') . ' |
|
321 | + FROM ' . prefixTable('misc').' |
|
322 | 322 | WHERE increment_id = %i', |
323 | 323 | $file |
324 | 324 | ); |
@@ -337,22 +337,22 @@ discard block |
||
337 | 337 | // Decrypt the file |
338 | 338 | $ret = prepareFileWithDefuse( |
339 | 339 | 'decrypt', |
340 | - $SETTINGS['path_to_files_folder'] . '/' . $file, |
|
341 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file, |
|
340 | + $SETTINGS['path_to_files_folder'].'/'.$file, |
|
341 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file, |
|
342 | 342 | $SETTINGS, |
343 | 343 | $key |
344 | 344 | ); |
345 | 345 | |
346 | 346 | if (empty($ret) === false) { |
347 | - echo '[{"result":"db_restore" , "message":"' . $ret . '"}]'; |
|
347 | + echo '[{"result":"db_restore" , "message":"'.$ret.'"}]'; |
|
348 | 348 | break; |
349 | 349 | } |
350 | 350 | |
351 | 351 | // Do clean |
352 | - fileDelete($SETTINGS['path_to_files_folder'] . '/' . $file, $SETTINGS); |
|
353 | - $file = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file; |
|
352 | + fileDelete($SETTINGS['path_to_files_folder'].'/'.$file, $SETTINGS); |
|
353 | + $file = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file; |
|
354 | 354 | } else { |
355 | - $file = $SETTINGS['path_to_files_folder'] . '/' . $file; |
|
355 | + $file = $SETTINGS['path_to_files_folder'].'/'.$file; |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | //read sql file |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | fclose($handle); |
370 | 370 | |
371 | 371 | //delete file |
372 | - unlink($SETTINGS['path_to_files_folder'] . '/' . $file); |
|
372 | + unlink($SETTINGS['path_to_files_folder'].'/'.$file); |
|
373 | 373 | |
374 | 374 | //Show done |
375 | 375 | echo '[{"result":"db_restore" , "message":""}]'; |
@@ -407,8 +407,8 @@ discard block |
||
407 | 407 | foreach ($table as $i => $tablename) { |
408 | 408 | if (substr_count($tablename, DB_PREFIX) > 0) { |
409 | 409 | // launch optimization quieries |
410 | - DB::query('ANALYZE TABLE `' . $tablename . '`'); |
|
411 | - DB::query('OPTIMIZE TABLE `' . $tablename . '`'); |
|
410 | + DB::query('ANALYZE TABLE `'.$tablename.'`'); |
|
411 | + DB::query('OPTIMIZE TABLE `'.$tablename.'`'); |
|
412 | 412 | } |
413 | 413 | } |
414 | 414 | } |
@@ -416,12 +416,12 @@ discard block |
||
416 | 416 | //Clean up LOG_ITEMS table |
417 | 417 | $rows = DB::query( |
418 | 418 | 'SELECT id |
419 | - FROM ' . prefixTable('items') . ' |
|
419 | + FROM ' . prefixTable('items').' |
|
420 | 420 | ORDER BY id ASC' |
421 | 421 | ); |
422 | 422 | foreach ($rows as $item) { |
423 | 423 | DB::query( |
424 | - 'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s', |
|
424 | + 'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s', |
|
425 | 425 | $item['id'], |
426 | 426 | 'at_creation' |
427 | 427 | ); |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | if ($counter === 0) { |
430 | 430 | //Create new at_creation entry |
431 | 431 | $rowTmp = DB::queryFirstRow( |
432 | - 'SELECT date, id_user FROM ' . prefixTable('log_items') . ' WHERE id_item=%i ORDER BY date ASC', |
|
432 | + 'SELECT date, id_user FROM '.prefixTable('log_items').' WHERE id_item=%i ORDER BY date ASC', |
|
433 | 433 | $item['id'] |
434 | 434 | ); |
435 | 435 | DB::insert( |
@@ -459,8 +459,8 @@ discard block |
||
459 | 459 | echo prepareExchangedData( |
460 | 460 | array( |
461 | 461 | 'error' => false, |
462 | - 'message' => langHdl('last_execution') . ' ' . |
|
463 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
462 | + 'message' => langHdl('last_execution').' '. |
|
463 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
464 | 464 | '<i class="fas fa-check text-success ml-2"></i>', |
465 | 465 | ), |
466 | 466 | 'encode' |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | break; |
497 | 497 | } |
498 | 498 | |
499 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
499 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
500 | 500 | updateCacheTable('reload', $SETTINGS, NULL); |
501 | 501 | |
502 | 502 | // Log |
@@ -512,8 +512,8 @@ discard block |
||
512 | 512 | echo prepareExchangedData( |
513 | 513 | [ |
514 | 514 | 'error' => false, |
515 | - 'message' => langHdl('last_execution') . ' ' . |
|
516 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
515 | + 'message' => langHdl('last_execution').' '. |
|
516 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
517 | 517 | '<i class="fas fa-check text-success mr-2"></i>', |
518 | 518 | ], |
519 | 519 | 'encode' |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | } |
549 | 549 | |
550 | 550 | // Perform |
551 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
551 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
552 | 552 | $ret = handleConfigFile('rebuild', $SETTINGS); |
553 | 553 | |
554 | 554 | // Log |
@@ -575,8 +575,8 @@ discard block |
||
575 | 575 | echo prepareExchangedData( |
576 | 576 | array( |
577 | 577 | 'error' => false, |
578 | - 'message' => langHdl('last_execution') . ' ' . |
|
579 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
578 | + 'message' => langHdl('last_execution').' '. |
|
579 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
580 | 580 | '<i class="fas fa-check text-success ml-2"></i>', |
581 | 581 | ), |
582 | 582 | 'encode' |
@@ -616,18 +616,18 @@ discard block |
||
616 | 616 | $filename = $post_option; |
617 | 617 | $tp_settings = []; |
618 | 618 | //get backups infos |
619 | - $rows = DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s', 'admin'); |
|
619 | + $rows = DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s', 'admin'); |
|
620 | 620 | foreach ($rows as $record) { |
621 | 621 | $tp_settings[$record['intitule']] = $record['valeur']; |
622 | 622 | } |
623 | 623 | |
624 | 624 | // check if backup file is in DB. |
625 | 625 | // If YES then it is encrypted with DEFUSE |
626 | - $bck = DB::queryFirstRow('SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'backup', 'filename'); |
|
626 | + $bck = DB::queryFirstRow('SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'backup', 'filename'); |
|
627 | 627 | |
628 | 628 | //read file |
629 | 629 | $return = ''; |
630 | - $Fnm = $tp_settings['bck_script_path'] . '/' . $filename . '.sql'; |
|
630 | + $Fnm = $tp_settings['bck_script_path'].'/'.$filename.'.sql'; |
|
631 | 631 | if (file_exists($Fnm)) { |
632 | 632 | if (!empty($bck) && $bck['valeur'] === $filename) { |
633 | 633 | $err = ''; |
@@ -635,8 +635,8 @@ discard block |
||
635 | 635 | // it means that file is DEFUSE encrypted |
636 | 636 | try { |
637 | 637 | File::decryptFileWithPassword( |
638 | - $SETTINGS['bck_script_path'] . '/' . $post_option . '.sql', |
|
639 | - $SETTINGS['bck_script_path'] . '/' . str_replace('encrypted', 'clear', $filename) . '.sql', |
|
638 | + $SETTINGS['bck_script_path'].'/'.$post_option.'.sql', |
|
639 | + $SETTINGS['bck_script_path'].'/'.str_replace('encrypted', 'clear', $filename).'.sql', |
|
640 | 640 | base64_decode($SETTINGS['bck_script_key']) |
641 | 641 | ); |
642 | 642 | } catch (Exception\WrongKeyOrModifiedCiphertextException $ex) { |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | } |
645 | 645 | |
646 | 646 | if (!empty($err)) { |
647 | - echo '[{ "result":"backup_decrypt_fails" , "msg":"' . $err . '"}]'; |
|
647 | + echo '[{ "result":"backup_decrypt_fails" , "msg":"'.$err.'"}]'; |
|
648 | 648 | break; |
649 | 649 | } |
650 | 650 | } else { |
@@ -666,19 +666,19 @@ discard block |
||
666 | 666 | ); |
667 | 667 | |
668 | 668 | //save the file |
669 | - $handle = fopen($tp_settings['bck_script_path'] . '/' . $filename . '.clear.sql', 'w+'); |
|
669 | + $handle = fopen($tp_settings['bck_script_path'].'/'.$filename.'.clear.sql', 'w+'); |
|
670 | 670 | if ($handle !== false) { |
671 | 671 | fwrite($handle, $return); |
672 | 672 | fclose($handle); |
673 | 673 | } |
674 | 674 | } |
675 | 675 | $result = 'backup_decrypt_success'; |
676 | - $msg = $tp_settings['bck_script_path'] . '/' . $filename . '.clear.sql'; |
|
676 | + $msg = $tp_settings['bck_script_path'].'/'.$filename.'.clear.sql'; |
|
677 | 677 | } else { |
678 | 678 | $result = 'backup_decrypt_fails'; |
679 | - $msg = 'File not found: ' . $Fnm; |
|
679 | + $msg = 'File not found: '.$Fnm; |
|
680 | 680 | } |
681 | - echo '[{ "result":"' . $result . '" , "msg":"' . $msg . '"}]'; |
|
681 | + echo '[{ "result":"'.$result.'" , "msg":"'.$msg.'"}]'; |
|
682 | 682 | break; |
683 | 683 | |
684 | 684 | /* |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | $_SESSION['reencrypt_old_salt'] = file_get_contents(SECUREPATH.'/'.SECUREFILE); |
716 | 716 | |
717 | 717 | // generate new saltkey |
718 | - $old_sk_filename = SECUREPATH.'/'.SECUREFILE . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))) . '.' . time(); |
|
718 | + $old_sk_filename = SECUREPATH.'/'.SECUREFILE.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).'.'.time(); |
|
719 | 719 | copy( |
720 | 720 | SECUREPATH.'/'.SECUREFILE, |
721 | 721 | $old_sk_filename |
@@ -743,13 +743,13 @@ discard block |
||
743 | 743 | logEvents($SETTINGS, 'system', 'change_salt_key', (string) $_SESSION['user_id'], $_SESSION['login']); |
744 | 744 | |
745 | 745 | // get number of items to change |
746 | - DB::query('SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', 0); |
|
746 | + DB::query('SELECT id FROM '.prefixTable('items').' WHERE perso = %i', 0); |
|
747 | 747 | $nb_of_items = DB::count(); |
748 | 748 | |
749 | 749 | // create backup table |
750 | - DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup')); |
|
750 | + DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup')); |
|
751 | 751 | DB::query( |
752 | - 'CREATE TABLE `' . prefixTable('sk_reencrypt_backup') . '` ( |
|
752 | + 'CREATE TABLE `'.prefixTable('sk_reencrypt_backup').'` ( |
|
753 | 753 | `id` int(12) NOT null AUTO_INCREMENT, |
754 | 754 | `current_table` varchar(100) NOT NULL, |
755 | 755 | `current_field` varchar(500) NOT NULL, |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | ); |
778 | 778 | |
779 | 779 | // delete previous backup files |
780 | - $files = glob($SETTINGS['path_to_upload_folder'] . '/*'); // get all file names |
|
780 | + $files = glob($SETTINGS['path_to_upload_folder'].'/*'); // get all file names |
|
781 | 781 | foreach ($files as $file) { // iterate files |
782 | 782 | if (is_file($file)) { |
783 | 783 | $file_parts = pathinfo($file); |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | echo prepareExchangedData( |
860 | 860 | array( |
861 | 861 | 'error' => true, |
862 | - 'message' => 'Input `' . $objects[0] . '` is not allowed', |
|
862 | + 'message' => 'Input `'.$objects[0].'` is not allowed', |
|
863 | 863 | 'nbOfItems' => '', |
864 | 864 | 'nextAction' => '', |
865 | 865 | ), |
@@ -872,9 +872,9 @@ discard block |
||
872 | 872 | //change all encrypted data in Items (passwords) |
873 | 873 | $rows = DB::query( |
874 | 874 | 'SELECT id, pw, pw_iv |
875 | - FROM ' . prefixTable('items') . ' |
|
875 | + FROM ' . prefixTable('items').' |
|
876 | 876 | WHERE perso = %s |
877 | - LIMIT ' . $post_start . ', ' . $post_length, |
|
877 | + LIMIT ' . $post_start.', '.$post_length, |
|
878 | 878 | '0' |
879 | 879 | ); |
880 | 880 | foreach ($rows as $record) { |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | 'current_field' => 'pw', |
887 | 887 | 'value_id' => $record['id'], |
888 | 888 | 'value' => $record['pw'], |
889 | - 'current_sql' => 'UPDATE ' . prefixTable('items') . " SET pw = '" . $record['pw'] . "' WHERE id = '" . $record['id'] . "';", |
|
889 | + 'current_sql' => 'UPDATE '.prefixTable('items')." SET pw = '".$record['pw']."' WHERE id = '".$record['id']."';", |
|
890 | 890 | 'value2' => 'none', |
891 | 891 | 'result' => 'none', |
892 | 892 | ) |
@@ -935,9 +935,9 @@ discard block |
||
935 | 935 | //change all encrypted data in Logs (passwords) |
936 | 936 | $rows = DB::query( |
937 | 937 | 'SELECT raison, increment_id |
938 | - FROM ' . prefixTable('log_items') . " |
|
938 | + FROM ' . prefixTable('log_items')." |
|
939 | 939 | WHERE action = %s AND raison LIKE 'at_pw :%' |
940 | - LIMIT " . $post_start . ', ' . $post_length, |
|
940 | + LIMIT " . $post_start.', '.$post_length, |
|
941 | 941 | 'at_modification' |
942 | 942 | ); |
943 | 943 | foreach ($rows as $record) { |
@@ -949,7 +949,7 @@ discard block |
||
949 | 949 | 'current_field' => 'raison', |
950 | 950 | 'value_id' => $record['increment_id'], |
951 | 951 | 'value' => $record['raison'], |
952 | - 'current_sql' => 'UPDATE ' . prefixTable('log_items') . " SET raison = '" . $record['raison'] . "' WHERE increment_id = '" . $record['increment_id'] . "';", |
|
952 | + 'current_sql' => 'UPDATE '.prefixTable('log_items')." SET raison = '".$record['raison']."' WHERE increment_id = '".$record['increment_id']."';", |
|
953 | 953 | 'value2' => 'none', |
954 | 954 | 'result' => 'none', |
955 | 955 | ) |
@@ -977,7 +977,7 @@ discard block |
||
977 | 977 | DB::update( |
978 | 978 | prefixTable('log_items'), |
979 | 979 | array( |
980 | - 'raison' => 'at_pw :' . $encrypt['string'], |
|
980 | + 'raison' => 'at_pw :'.$encrypt['string'], |
|
981 | 981 | 'encryption_type' => 'defuse', |
982 | 982 | ), |
983 | 983 | 'increment_id = %i', |
@@ -1002,8 +1002,8 @@ discard block |
||
1002 | 1002 | //change all encrypted data in CATEGORIES (passwords) |
1003 | 1003 | $rows = DB::query( |
1004 | 1004 | 'SELECT id, data |
1005 | - FROM ' . prefixTable('categories_items') . ' |
|
1006 | - LIMIT ' . $post_start . ', ' . $post_length |
|
1005 | + FROM ' . prefixTable('categories_items').' |
|
1006 | + LIMIT ' . $post_start.', '.$post_length |
|
1007 | 1007 | ); |
1008 | 1008 | foreach ($rows as $record) { |
1009 | 1009 | // backup data |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | 'current_field' => 'data', |
1015 | 1015 | 'value_id' => $record['id'], |
1016 | 1016 | 'value' => $record['data'], |
1017 | - 'current_sql' => 'UPDATE ' . prefixTable('categories_items') . " SET data = '" . $record['data'] . "' WHERE id = '" . $record['id'] . "';", |
|
1017 | + 'current_sql' => 'UPDATE '.prefixTable('categories_items')." SET data = '".$record['data']."' WHERE id = '".$record['id']."';", |
|
1018 | 1018 | 'value2' => 'none', |
1019 | 1019 | 'result' => 'none', |
1020 | 1020 | ) |
@@ -1062,9 +1062,9 @@ discard block |
||
1062 | 1062 | // Change all encrypted data in FILES (passwords) |
1063 | 1063 | $rows = DB::query( |
1064 | 1064 | 'SELECT id, file, status |
1065 | - FROM ' . prefixTable('files') . " |
|
1065 | + FROM ' . prefixTable('files')." |
|
1066 | 1066 | WHERE status = 'encrypted' |
1067 | - LIMIT " . $post_start . ', ' . $post_length |
|
1067 | + LIMIT " . $post_start.', '.$post_length |
|
1068 | 1068 | ); |
1069 | 1069 | foreach ($rows as $record) { |
1070 | 1070 | // backup data |
@@ -1082,20 +1082,20 @@ discard block |
||
1082 | 1082 | ); |
1083 | 1083 | $newID = DB::insertId(); |
1084 | 1084 | |
1085 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) { |
|
1085 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) { |
|
1086 | 1086 | // make a copy of file |
1087 | 1087 | if (!copy( |
1088 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
1089 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '.copy' |
|
1088 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
1089 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'.copy' |
|
1090 | 1090 | )) { |
1091 | 1091 | $error = 'Copy not possible'; |
1092 | 1092 | exit; |
1093 | 1093 | } else { |
1094 | 1094 | // prepare a bck of file (that will not be deleted) |
1095 | - $backup_filename = $record['file'] . '.bck-change-sk.' . time(); |
|
1095 | + $backup_filename = $record['file'].'.bck-change-sk.'.time(); |
|
1096 | 1096 | copy( |
1097 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
1098 | - $SETTINGS['path_to_upload_folder'] . '/' . $backup_filename |
|
1097 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
1098 | + $SETTINGS['path_to_upload_folder'].'/'.$backup_filename |
|
1099 | 1099 | ); |
1100 | 1100 | } |
1101 | 1101 | |
@@ -1103,24 +1103,24 @@ discard block |
||
1103 | 1103 | // STEP1 - Do decryption |
1104 | 1104 | prepareFileWithDefuse( |
1105 | 1105 | 'decrypt', |
1106 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
1107 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted', |
|
1106 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
1107 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted', |
|
1108 | 1108 | $SETTINGS |
1109 | 1109 | ); |
1110 | 1110 | |
1111 | 1111 | // Do cleanup of files |
1112 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file']); |
|
1112 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file']); |
|
1113 | 1113 | |
1114 | 1114 | // STEP2 - Do encryption |
1115 | 1115 | prepareFileWithDefuse( |
1116 | 1116 | 'encryp', |
1117 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted', |
|
1118 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
1117 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted', |
|
1118 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
1119 | 1119 | $SETTINGS |
1120 | 1120 | ); |
1121 | 1121 | |
1122 | 1122 | // Do cleanup of files |
1123 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted'); |
|
1123 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted'); |
|
1124 | 1124 | |
1125 | 1125 | // Update backup table |
1126 | 1126 | DB::update( |
@@ -1146,13 +1146,13 @@ discard block |
||
1146 | 1146 | // do some things for new object |
1147 | 1147 | if (isset($objects[0])) { |
1148 | 1148 | if ($objects[0] === 'logs') { |
1149 | - DB::query('SELECT increment_id FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
1149 | + DB::query('SELECT increment_id FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
1150 | 1150 | } elseif ($objects[0] === 'files') { |
1151 | - DB::query('SELECT id FROM ' . prefixTable('files')); |
|
1151 | + DB::query('SELECT id FROM '.prefixTable('files')); |
|
1152 | 1152 | } elseif ($objects[0] === 'categories') { |
1153 | - DB::query('SELECT id FROM ' . prefixTable('categories_items')); |
|
1153 | + DB::query('SELECT id FROM '.prefixTable('categories_items')); |
|
1154 | 1154 | } elseif ($objects[0] === 'custfields') { |
1155 | - DB::query('SELECT raison FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
1155 | + DB::query('SELECT raison FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
1156 | 1156 | } |
1157 | 1157 | $nb_of_items = DB::count(); |
1158 | 1158 | } else { |
@@ -1271,12 +1271,12 @@ discard block |
||
1271 | 1271 | ); |
1272 | 1272 | } elseif ($record['current_table'] === 'files') { |
1273 | 1273 | // restore backup file |
1274 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value'])) { |
|
1275 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value']); |
|
1276 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) { |
|
1274 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value'])) { |
|
1275 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value']); |
|
1276 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) { |
|
1277 | 1277 | rename( |
1278 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['value2'], |
|
1279 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['value'] |
|
1278 | + $SETTINGS['path_to_upload_folder'].'/'.$record['value2'], |
|
1279 | + $SETTINGS['path_to_upload_folder'].'/'.$record['value'] |
|
1280 | 1280 | ); |
1281 | 1281 | } |
1282 | 1282 | } |
@@ -1295,7 +1295,7 @@ discard block |
||
1295 | 1295 | } |
1296 | 1296 | |
1297 | 1297 | // drop table |
1298 | - DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup')); |
|
1298 | + DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup')); |
|
1299 | 1299 | |
1300 | 1300 | // Send back |
1301 | 1301 | echo prepareExchangedData( |
@@ -1338,17 +1338,17 @@ discard block |
||
1338 | 1338 | // delete files |
1339 | 1339 | $rows = DB::query( |
1340 | 1340 | 'SELECT value, value2 |
1341 | - FROM ' . prefixTable('sk_reencrypt_backup') . " |
|
1341 | + FROM ' . prefixTable('sk_reencrypt_backup')." |
|
1342 | 1342 | WHERE current_table = 'files'" |
1343 | 1343 | ); |
1344 | 1344 | foreach ($rows as $record) { |
1345 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) { |
|
1346 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value2']); |
|
1345 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) { |
|
1346 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value2']); |
|
1347 | 1347 | } |
1348 | 1348 | } |
1349 | 1349 | |
1350 | 1350 | // drop table |
1351 | - DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup')); |
|
1351 | + DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup')); |
|
1352 | 1352 | |
1353 | 1353 | echo '[{"status":"done"}]'; |
1354 | 1354 | break; |
@@ -1380,7 +1380,7 @@ discard block |
||
1380 | 1380 | ); |
1381 | 1381 | break; |
1382 | 1382 | } else { |
1383 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1383 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1384 | 1384 | |
1385 | 1385 | //send email |
1386 | 1386 | sendEmail( |
@@ -1416,11 +1416,11 @@ discard block |
||
1416 | 1416 | break; |
1417 | 1417 | } |
1418 | 1418 | |
1419 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1419 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1420 | 1420 | |
1421 | 1421 | $rows = DB::query( |
1422 | 1422 | 'SELECT * |
1423 | - FROM ' . prefixTable('emails') . ' |
|
1423 | + FROM ' . prefixTable('emails').' |
|
1424 | 1424 | WHERE status = %s OR status = %s', |
1425 | 1425 | 'not_sent', |
1426 | 1426 | '' |
@@ -1505,9 +1505,9 @@ discard block |
||
1505 | 1505 | break; |
1506 | 1506 | } |
1507 | 1507 | |
1508 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1508 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1509 | 1509 | |
1510 | - $rows = DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
1510 | + $rows = DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
1511 | 1511 | foreach ($rows as $record) { |
1512 | 1512 | //send email |
1513 | 1513 | $ret = json_decode( |
@@ -1575,7 +1575,7 @@ discard block |
||
1575 | 1575 | break; |
1576 | 1576 | } |
1577 | 1577 | |
1578 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1578 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1579 | 1579 | |
1580 | 1580 | // init |
1581 | 1581 | $filesList = array(); |
@@ -1588,7 +1588,7 @@ discard block |
||
1588 | 1588 | FROM ' . prefixTable('files') |
1589 | 1589 | ); |
1590 | 1590 | foreach ($rows as $record) { |
1591 | - if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) { |
|
1591 | + if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) { |
|
1592 | 1592 | $addFile = false; |
1593 | 1593 | if (($post_option === 'attachments-decrypt' && $record['status'] === 'encrypted') |
1594 | 1594 | || ($post_option === 'attachments-encrypt' && $record['status'] === 'clear') |
@@ -1653,8 +1653,8 @@ discard block |
||
1653 | 1653 | $post_list = filter_var_array($post_list, FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
1654 | 1654 | $post_counter = filter_var($post_counter, FILTER_SANITIZE_NUMBER_INT); |
1655 | 1655 | |
1656 | - include $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
1657 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1656 | + include $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
1657 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1658 | 1658 | |
1659 | 1659 | $cpt = 0; |
1660 | 1660 | $continu = true; |
@@ -1667,35 +1667,35 @@ discard block |
||
1667 | 1667 | // Get file name |
1668 | 1668 | $file_info = DB::queryfirstrow( |
1669 | 1669 | 'SELECT file |
1670 | - FROM ' . prefixTable('files') . ' |
|
1670 | + FROM ' . prefixTable('files').' |
|
1671 | 1671 | WHERE id = %i', |
1672 | 1672 | $file |
1673 | 1673 | ); |
1674 | 1674 | |
1675 | 1675 | // skip file is Coherancey not respected |
1676 | - if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'])) { |
|
1676 | + if (is_file($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'])) { |
|
1677 | 1677 | // Case where we want to decrypt |
1678 | 1678 | if ($post_option === 'decrypt') { |
1679 | 1679 | prepareFileWithDefuse( |
1680 | 1680 | 'decrypt', |
1681 | - $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], |
|
1682 | - $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'], |
|
1681 | + $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], |
|
1682 | + $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'], |
|
1683 | 1683 | $SETTINGS |
1684 | 1684 | ); |
1685 | 1685 | // Case where we want to encrypt |
1686 | 1686 | } elseif ($post_option === 'encrypt') { |
1687 | 1687 | prepareFileWithDefuse( |
1688 | 1688 | 'encrypt', |
1689 | - $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], |
|
1690 | - $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'], |
|
1689 | + $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], |
|
1690 | + $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'], |
|
1691 | 1691 | $SETTINGS |
1692 | 1692 | ); |
1693 | 1693 | } |
1694 | 1694 | // Do file cleanup |
1695 | - fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], $SETTINGS); |
|
1695 | + fileDelete($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], $SETTINGS); |
|
1696 | 1696 | rename( |
1697 | - $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'], |
|
1698 | - $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'] |
|
1697 | + $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'], |
|
1698 | + $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'] |
|
1699 | 1699 | ); |
1700 | 1700 | |
1701 | 1701 | // store in DB |
@@ -1730,8 +1730,8 @@ discard block |
||
1730 | 1730 | $post_option === 'attachments-decrypt' ? 'clear' : 'encrypted' |
1731 | 1731 | ); |
1732 | 1732 | |
1733 | - $message = langHdl('last_execution') . ' ' . |
|
1734 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
1733 | + $message = langHdl('last_execution').' '. |
|
1734 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
1735 | 1735 | '<i class="fas fa-check text-success ml-2 mr-3"></i>'; |
1736 | 1736 | } |
1737 | 1737 | |
@@ -1825,7 +1825,7 @@ discard block |
||
1825 | 1825 | $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_NUMBER_INT); |
1826 | 1826 | |
1827 | 1827 | DB::query( |
1828 | - 'DELETE FROM ' . prefixTable('api') . ' WHERE increment_id = %i', |
|
1828 | + 'DELETE FROM '.prefixTable('api').' WHERE increment_id = %i', |
|
1829 | 1829 | $post_id |
1830 | 1830 | ); |
1831 | 1831 | } |
@@ -1920,7 +1920,7 @@ discard block |
||
1920 | 1920 | // Delete existing key |
1921 | 1921 | } elseif (null !== $post_action && $post_action === 'delete') { |
1922 | 1922 | $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
1923 | - DB::query('DELETE FROM ' . prefixTable('api') . ' WHERE increment_id=%i', $post_id); |
|
1923 | + DB::query('DELETE FROM '.prefixTable('api').' WHERE increment_id=%i', $post_id); |
|
1924 | 1924 | } |
1925 | 1925 | |
1926 | 1926 | echo prepareExchangedData( |
@@ -1935,7 +1935,7 @@ discard block |
||
1935 | 1935 | |
1936 | 1936 | case 'save_api_status': |
1937 | 1937 | // Do query |
1938 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'api'); |
|
1938 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'api'); |
|
1939 | 1939 | $counter = DB::count(); |
1940 | 1940 | if ($counter === 0) { |
1941 | 1941 | DB::insert( |
@@ -1962,7 +1962,7 @@ discard block |
||
1962 | 1962 | |
1963 | 1963 | case 'run_duo_config_check': |
1964 | 1964 | //Libraries call |
1965 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1965 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1966 | 1966 | // Check KEY |
1967 | 1967 | if ($post_key !== $_SESSION['key']) { |
1968 | 1968 | echo prepareExchangedData( |
@@ -2005,7 +2005,7 @@ discard block |
||
2005 | 2005 | echo prepareExchangedData( |
2006 | 2006 | array( |
2007 | 2007 | 'error' => true, |
2008 | - 'message' => langHdl('duo_config_error') . "<br/>Duo: " . $e->getMessage(), |
|
2008 | + 'message' => langHdl('duo_config_error')."<br/>Duo: ".$e->getMessage(), |
|
2009 | 2009 | ), |
2010 | 2010 | 'encode' |
2011 | 2011 | ); |
@@ -2025,7 +2025,7 @@ discard block |
||
2025 | 2025 | $duo_error = langHdl('duo_error_secure'); |
2026 | 2026 | $data["duo_check"] = "failed"; |
2027 | 2027 | }*/ |
2028 | - $duo_error = langHdl('duo_error_check_config') . "<br/>Duo: " . $e->getMessage(); |
|
2028 | + $duo_error = langHdl('duo_error_check_config')."<br/>Duo: ".$e->getMessage(); |
|
2029 | 2029 | echo prepareExchangedData( |
2030 | 2030 | array( |
2031 | 2031 | 'error' => true, |
@@ -2070,7 +2070,7 @@ discard block |
||
2070 | 2070 | } else { |
2071 | 2071 | $tmp = 1; |
2072 | 2072 | } |
2073 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication'); |
|
2073 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication'); |
|
2074 | 2074 | $counter = DB::count(); |
2075 | 2075 | if ($counter === 0) { |
2076 | 2076 | DB::insert( |
@@ -2096,7 +2096,7 @@ discard block |
||
2096 | 2096 | |
2097 | 2097 | // ga_website_name |
2098 | 2098 | if (is_null($dataReceived['ga_website_name']) === false) { |
2099 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name'); |
|
2099 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name'); |
|
2100 | 2100 | $counter = DB::count(); |
2101 | 2101 | if ($counter === 0) { |
2102 | 2102 | DB::insert( |
@@ -2127,7 +2127,7 @@ discard block |
||
2127 | 2127 | } |
2128 | 2128 | |
2129 | 2129 | // send data |
2130 | - echo '[{"result" : "' . addslashes($LANG['done']) . '" , "error" : ""}]'; |
|
2130 | + echo '[{"result" : "'.addslashes($LANG['done']).'" , "error" : ""}]'; |
|
2131 | 2131 | break; |
2132 | 2132 | |
2133 | 2133 | case 'save_agses_options': |
@@ -2150,7 +2150,7 @@ discard block |
||
2150 | 2150 | |
2151 | 2151 | // agses_hosted_url |
2152 | 2152 | if (!is_null($dataReceived['agses_hosted_url'])) { |
2153 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url'); |
|
2153 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url'); |
|
2154 | 2154 | $counter = DB::count(); |
2155 | 2155 | if ($counter === 0) { |
2156 | 2156 | DB::insert( |
@@ -2179,7 +2179,7 @@ discard block |
||
2179 | 2179 | |
2180 | 2180 | // agses_hosted_id |
2181 | 2181 | if (!is_null($dataReceived['agses_hosted_id'])) { |
2182 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id'); |
|
2182 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id'); |
|
2183 | 2183 | $counter = DB::count(); |
2184 | 2184 | if ($counter === 0) { |
2185 | 2185 | DB::insert( |
@@ -2208,7 +2208,7 @@ discard block |
||
2208 | 2208 | |
2209 | 2209 | // agses_hosted_apikey |
2210 | 2210 | if (!is_null($dataReceived['agses_hosted_apikey'])) { |
2211 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey'); |
|
2211 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey'); |
|
2212 | 2212 | $counter = DB::count(); |
2213 | 2213 | if ($counter === 0) { |
2214 | 2214 | DB::insert( |
@@ -2236,7 +2236,7 @@ discard block |
||
2236 | 2236 | } |
2237 | 2237 | |
2238 | 2238 | // send data |
2239 | - echo '[{"result" : "' . addslashes($LANG['done']) . '" , "error" : ""}]'; |
|
2239 | + echo '[{"result" : "'.addslashes($LANG['done']).'" , "error" : ""}]'; |
|
2240 | 2240 | break; |
2241 | 2241 | |
2242 | 2242 | case 'save_option_change': |
@@ -2276,7 +2276,7 @@ discard block |
||
2276 | 2276 | |
2277 | 2277 | // Check if setting is already in DB. If NO then insert, if YES then update. |
2278 | 2278 | $data = DB::query( |
2279 | - 'SELECT * FROM ' . prefixTable('misc') . ' |
|
2279 | + 'SELECT * FROM '.prefixTable('misc').' |
|
2280 | 2280 | WHERE type = %s AND intitule = %s', |
2281 | 2281 | 'admin', |
2282 | 2282 | $post_field |
@@ -2298,7 +2298,7 @@ discard block |
||
2298 | 2298 | array( |
2299 | 2299 | 'valeur' => time(), |
2300 | 2300 | 'type' => 'admin', |
2301 | - 'intitule' => $post_field . '_time', |
|
2301 | + 'intitule' => $post_field.'_time', |
|
2302 | 2302 | ) |
2303 | 2303 | ); |
2304 | 2304 | } |
@@ -2316,10 +2316,10 @@ discard block |
||
2316 | 2316 | if ($post_field === 'send_stats') { |
2317 | 2317 | // Check if previous time exists, if not them insert this value in DB |
2318 | 2318 | DB::query( |
2319 | - 'SELECT * FROM ' . prefixTable('misc') . ' |
|
2319 | + 'SELECT * FROM '.prefixTable('misc').' |
|
2320 | 2320 | WHERE type = %s AND intitule = %s', |
2321 | 2321 | 'admin', |
2322 | - $post_field . '_time' |
|
2322 | + $post_field.'_time' |
|
2323 | 2323 | ); |
2324 | 2324 | $counter = DB::count(); |
2325 | 2325 | if ($counter === 0) { |
@@ -2328,7 +2328,7 @@ discard block |
||
2328 | 2328 | array( |
2329 | 2329 | 'valeur' => 0, |
2330 | 2330 | 'type' => 'admin', |
2331 | - 'intitule' => $post_field . '_time', |
|
2331 | + 'intitule' => $post_field.'_time', |
|
2332 | 2332 | ) |
2333 | 2333 | ); |
2334 | 2334 | } else { |
@@ -2348,13 +2348,13 @@ discard block |
||
2348 | 2348 | // special Cases |
2349 | 2349 | if ($post_field === 'cpassman_url') { |
2350 | 2350 | // update also jsUrl for CSFP protection |
2351 | - $jsUrl = $post_value . '/includes/libraries/csrfp/js/csrfprotector.js'; |
|
2351 | + $jsUrl = $post_value.'/includes/libraries/csrfp/js/csrfprotector.js'; |
|
2352 | 2352 | $csrfp_file = '../includes/libraries/csrfp/libs/csrfp.config.php'; |
2353 | 2353 | $data = file_get_contents($csrfp_file); |
2354 | 2354 | $posJsUrl = strpos($data, '"jsUrl" => "'); |
2355 | 2355 | $posEndLine = strpos($data, '",', $posJsUrl); |
2356 | 2356 | $line = substr($data, $posJsUrl, ($posEndLine - $posJsUrl + 2)); |
2357 | - $newdata = str_replace($line, '"jsUrl" => "' . filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . '",', $data); |
|
2357 | + $newdata = str_replace($line, '"jsUrl" => "'.filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS).'",', $data); |
|
2358 | 2358 | file_put_contents($csrfp_file, $newdata); |
2359 | 2359 | } elseif ($post_field === 'restricted_to_input' && (int) $post_value === 0) { |
2360 | 2360 | DB::update( |
@@ -2383,7 +2383,7 @@ discard block |
||
2383 | 2383 | echo prepareExchangedData( |
2384 | 2384 | array( |
2385 | 2385 | 'error' => false, |
2386 | - 'misc' => $counter . ' ; ' . $SETTINGS[$post_field], |
|
2386 | + 'misc' => $counter.' ; '.$SETTINGS[$post_field], |
|
2387 | 2387 | 'message' => empty($post_translate) === false ? langHdl($post_translate) : '', |
2388 | 2388 | ), |
2389 | 2389 | 'encode' |
@@ -2426,7 +2426,7 @@ discard block |
||
2426 | 2426 | |
2427 | 2427 | // send statistics |
2428 | 2428 | if (null !== $post_status) { |
2429 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_stats'); |
|
2429 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_stats'); |
|
2430 | 2430 | $counter = DB::count(); |
2431 | 2431 | if ($counter === 0) { |
2432 | 2432 | DB::insert( |
@@ -2458,7 +2458,7 @@ discard block |
||
2458 | 2458 | |
2459 | 2459 | // send statistics items |
2460 | 2460 | if (null !== $post_list) { |
2461 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items'); |
|
2461 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items'); |
|
2462 | 2462 | $counter = DB::count(); |
2463 | 2463 | if ($counter === 0) { |
2464 | 2464 | DB::insert( |
@@ -2505,7 +2505,7 @@ discard block |
||
2505 | 2505 | break; |
2506 | 2506 | } |
2507 | 2507 | |
2508 | - if (DB::query("SHOW TABLES LIKE '" . prefixTable('sk_reencrypt_backup') . "'")) { |
|
2508 | + if (DB::query("SHOW TABLES LIKE '".prefixTable('sk_reencrypt_backup')."'")) { |
|
2509 | 2509 | if (DB::count() === 1) { |
2510 | 2510 | echo 1; |
2511 | 2511 | } else { |
@@ -2543,7 +2543,7 @@ discard block |
||
2543 | 2543 | |
2544 | 2544 | $rows = DB::query( |
2545 | 2545 | 'SELECT id, title |
2546 | - FROM ' . prefixTable('roles_title') . ' |
|
2546 | + FROM ' . prefixTable('roles_title').' |
|
2547 | 2547 | ORDER BY title ASC' |
2548 | 2548 | ); |
2549 | 2549 | foreach ($rows as $record) { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | ) { |
70 | 70 | // Not allowed page |
71 | 71 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
72 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
72 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
73 | 73 | exit; |
74 | 74 | } |
75 | 75 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | echo prepareExchangedData( |
163 | 163 | array( |
164 | 164 | 'error' => true, |
165 | - 'message' => "Error : ".(isset($error) === true ? $error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage() : $e), |
|
165 | + 'message' => "Error : ".(isset($error) === true ? $error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage() : $e), |
|
166 | 166 | ), |
167 | 167 | 'encode' |
168 | 168 | ); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | // We want to isolate attribute ldap_user_attribute |
174 | 174 | try { |
175 | 175 | $user = $connection->query() |
176 | - ->where((isset($SETTINGS['ldap_user_attribute']) ===true && empty($SETTINGS['ldap_user_attribute']) === false) ? $SETTINGS['ldap_user_attribute'] : 'samaccountname', '=', $post_username) |
|
176 | + ->where((isset($SETTINGS['ldap_user_attribute']) === true && empty($SETTINGS['ldap_user_attribute']) === false) ? $SETTINGS['ldap_user_attribute'] : 'samaccountname', '=', $post_username) |
|
177 | 177 | ->firstOrFail(); |
178 | 178 | |
179 | 179 | } catch (\LdapRecord\LdapRecordException $e) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | echo prepareExchangedData( |
183 | 183 | array( |
184 | 184 | 'error' => true, |
185 | - 'message' => langHdl('error')." - ".(isset($error) === true ? $error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage() : $e), |
|
185 | + 'message' => langHdl('error')." - ".(isset($error) === true ? $error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage() : $e), |
|
186 | 186 | ), |
187 | 187 | 'encode' |
188 | 188 | ); |
@@ -192,8 +192,7 @@ discard block |
||
192 | 192 | try { |
193 | 193 | $userAuthAttempt = $connection->auth()->attempt( |
194 | 194 | $SETTINGS['ldap_type'] === 'ActiveDirectory' ? |
195 | - $user['userprincipalname'][0] : |
|
196 | - $user['dn'], |
|
195 | + $user['userprincipalname'][0] : $user['dn'], |
|
197 | 196 | $post_password |
198 | 197 | ); |
199 | 198 | } catch (\LdapRecord\LdapRecordException $e) { |
@@ -202,7 +201,7 @@ discard block |
||
202 | 201 | echo prepareExchangedData( |
203 | 202 | array( |
204 | 203 | 'error' => true, |
205 | - 'message' => langHdl('error').' : '.(isset($error) === true ? $error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage() : $e), |
|
204 | + 'message' => langHdl('error').' : '.(isset($error) === true ? $error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage() : $e), |
|
206 | 205 | ), |
207 | 206 | 'encode' |
208 | 207 | ); |