Passed
Pull Request — master (#4822)
by Nils
05:44
created
sources/users.datatable.php 1 patch
Spacing   +15 added lines, -17 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 ) {
78 78
     // Not allowed page
79 79
     $session->set('system-error_code', ERR_NOT_ALLOWED);
80
-    include $SETTINGS['cpassman_dir'] . '/error.php';
80
+    include $SETTINGS['cpassman_dir'].'/error.php';
81 81
     exit;
82 82
 }
83 83
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     if (isset($order['column']) && preg_match('#^(asc|desc)$#i', $order['dir'])) {
129 129
         $columnIndex = filter_var($order['column'], FILTER_SANITIZE_NUMBER_INT);
130 130
         $dir = filter_var($order['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
131
-        $sOrder .= $aColumns[$columnIndex] . ' ' . $dir . ', ';
131
+        $sOrder .= $aColumns[$columnIndex].' '.$dir.', ';
132 132
     }
133 133
 
134 134
     $sOrder = substr_replace($sOrder, '', -2);
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
 
153 153
 if ($letter !== '' && $letter !== 'None') {
154 154
     $sWhere .= ' AND (';
155
-    $sWhere .= $aColumns[1] . " LIKE '" . $letter . "%' OR ";
156
-    $sWhere .= $aColumns[2] . " LIKE '" . $letter . "%' OR ";
157
-    $sWhere .= $aColumns[3] . " LIKE '" . $letter . "%' ";
155
+    $sWhere .= $aColumns[1]." LIKE '".$letter."%' OR ";
156
+    $sWhere .= $aColumns[2]." LIKE '".$letter."%' OR ";
157
+    $sWhere .= $aColumns[3]." LIKE '".$letter."%' ";
158 158
     $sWhere .= ')';
159 159
 } elseif ($searchValue !== '') {
160 160
     $sWhere .= ' AND (';
161
-    $sWhere .= $aColumns[1] . " LIKE '" . $searchValue . "%' OR ";
162
-    $sWhere .= $aColumns[2] . " LIKE '" . $searchValue . "%' OR ";
163
-    $sWhere .= $aColumns[3] . " LIKE '" . $searchValue . "%' ";
161
+    $sWhere .= $aColumns[1]." LIKE '".$searchValue."%' OR ";
162
+    $sWhere .= $aColumns[2]." LIKE '".$searchValue."%' OR ";
163
+    $sWhere .= $aColumns[3]." LIKE '".$searchValue."%' ";
164 164
     $sWhere .= ')';
165 165
 }
166 166
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         // Check for existing lock
247 247
         $unlock_at = DB::queryFirstField(
248 248
             'SELECT MAX(unlock_at)
249
-             FROM ' . prefixTable('auth_failures') . '
249
+             FROM ' . prefixTable('auth_failures').'
250 250
              WHERE unlock_at > %s AND source = %s AND value = %s',
251 251
             date('Y-m-d H:i:s', time()),
252 252
             'login',
@@ -255,33 +255,31 @@  discard block
 block discarded – undo
255 255
 
256 256
         // Get some infos about user
257 257
         $userDisplayInfos = 
258
-            (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '')
258
+            (isset($userDate['date']) ? '<i class=\"fas fa-calendar-day infotip text-info ml-2\" title=\"'.$lang->get('creation_date').': '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $userDate['date']).'\"></i>' : '')
259 259
             .
260 260
             ((int) $record['last_connexion'] > 0 ? '<i class=\"far fa-clock infotip text-info ml-2\" title=\"'.$lang->get('index_last_seen').": ".
261
-            date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '')
261
+            date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['last_connexion']).'\"></i>' : '')
262 262
             .
263 263
             ((int) $record['user_ip'] > 0 ? '<i class=\"fas fa-street-view infotip text-info ml-1\" title=\"'.$lang->get('ip').": ".($record['user_ip']).'\"></i>' : '')
264 264
             .
265 265
             (($record['auth_type'] === 'ldap' || $record['auth_type'] === 'oauth2') ? '<i class=\"far fa-address-book infotip text-warning ml-1\" title=\"'.$lang->get('managed_through_ad').'\"></i>' : '')
266 266
             .
267 267
             ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && ((int) $SETTINGS['duo'] === 1 || (int) $SETTINGS['google_authentication'] === 1)) ?
268
-                ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') :
269
-                ''
268
+                ((int) $record['mfa_enabled'] === 1 ? '' : '<i class=\"fa-solid fa-fingerprint infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('mfa_disabled_for_user').'\"></i>') : ''
270 269
                 )
271 270
             .
272 271
             (($unlock_at) ? '<i class=\"fas fa-solid text-red fa-lock infotip text-info ml-1\" title=\"'.$lang->get('bruteforce_unlock_at').$unlock_at.'\"></i>' : '');
273 272
         if ($request->query->filter('display_warnings', '', FILTER_VALIDATE_BOOLEAN) === true) {
274 273
             $userDisplayInfos .= '<br>'.
275 274
                 ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['admin'] !== 1 && is_null($record['keys_recovery_time']) === true) ? 
276
-                    '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' :
277
-                    ''
275
+                    '<i class=\"fa-solid fa-download infotip ml-1\" style=\"color:Tomato\" title=\"'.$lang->get('recovery_keys_not_downloaded').'\"></i>' : ''
278 276
                 ).
279 277
                 ((in_array($record['id'], [OTV_USER_ID, TP_USER_ID, SSH_USER_ID, API_USER_ID]) === false && (int) $record['pw_passwordlib'] === 1) ? '<i class=\"fa-solid fa-person-walking-luggage infotip ml-1\" style=\"color:Tomato\" title=\"Old password encryption. Shall login to initialize.\"></i>' : '');
280 278
         }
281 279
 
282 280
         $sOutput .= '["<span data-id=\"'.$record['id'].'\" data-fullname=\"'.
283
-            (empty($record['name']) === false ? htmlentities($record['name'], ENT_QUOTES|ENT_SUBSTITUTE|ENT_DISALLOWED) : '').' '.
284
-            (empty($record['lastname']) === false ? htmlentities($record['lastname'], ENT_QUOTES|ENT_SUBSTITUTE|ENT_DISALLOWED) : '').
281
+            (empty($record['name']) === false ? htmlentities($record['name'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED) : '').' '.
282
+            (empty($record['lastname']) === false ? htmlentities($record['lastname'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED) : '').
285 283
             '\" data-auth-type=\"'.$record['auth_type'].'\" data-special=\"'.$record['special'].'\" data-mfa-enabled=\"'.$record['mfa_enabled'].'\" data-otp-provided=\"'.(isset($record['otp_provided']) === true ? $record['otp_provided'] : '').'\"></span>", ';
286 284
         //col2
287 285
         $sOutput .= '"'.
Please login to merge, or discard this patch.
pages/oauth.js.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('oauth') === false) {
72 72
     // Not allowed page
73 73
     $session->set('system-error_code', ERR_NOT_ALLOWED);
74
-    include $SETTINGS['cpassman_dir'] . '/error.php';
74
+    include $SETTINGS['cpassman_dir'].'/error.php';
75 75
     exit;
76 76
 }
77 77
 ?>
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                     if (data[i].selected_role === 1) {
227 227
                         selected_role = data[i].id;
228 228
                     }
229
-                    html_admin_by += '<option value="' + data[i].id + '"><?php echo $lang->get('managers_of') . ' '; ?>' + data[i].title + '</option>';
229
+                    html_admin_by += '<option value="' + data[i].id + '"><?php echo $lang->get('managers_of').' '; ?>' + data[i].title + '</option>';
230 230
                     html_roles += '<option value="' + data[i].id + '">' + data[i].title + '</option>';
231 231
                 }
232 232
                 $('#oauth_new_user_is_administrated_by')
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             }).fail(function(error) {
256 256
                 toastr.remove();
257 257
                 toastr.error(
258
-                    '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + error,
258
+                    '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + error,
259 259
                     '', {
260 260
                         closeButton: true,
261 261
                         positionClass: 'toast-bottom-right'
Please login to merge, or discard this patch.
pages/admin.js.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) {
69 69
     // Not allowed page
70 70
     $session->set('system-error_code', ERR_NOT_ALLOWED);
71
-    include $SETTINGS['cpassman_dir'] . '/error.php';
71
+    include $SETTINGS['cpassman_dir'].'/error.php';
72 72
     exit;
73 73
 }
74 74
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
                     // error
170 170
                     toastr.remove();
171 171
                     toastr.error(
172
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
172
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
173 173
                         '', {
174 174
                             closeButton: true,
175 175
                             positionClass: 'toast-bottom-right'
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                     // error
249 249
                     toastr.remove();
250 250
                     toastr.error(
251
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
251
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
252 252
                         '', {
253 253
                             closeButton: true,
254 254
                             positionClass: 'toast-bottom-right'
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                     // error
311 311
                     toastr.remove();
312 312
                     toastr.error(
313
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
313
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
314 314
                         '', {
315 315
                             closeButton: true,
316 316
                             positionClass: 'toast-bottom-right'
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                     // error
405 405
                     toastr.remove();
406 406
                     toastr.error(
407
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
407
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
408 408
                         '', {
409 409
                             closeButton: true,
410 410
                             positionClass: 'toast-bottom-right'
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
                     
434 434
                     //const className = result.success ? 'success' : 'error';
435 435
                     const icon = result.success ? '<i class="fa-solid fa-check text-success mr-1"></i>' : '<i class="fa-solid fa-xmark text-danger mr-1"></i>';
436
-                    const message = result.success ? '<?php echo $lang->get('server_returned_data');?>' : 'Error: ' + result.error;
436
+                    const message = result.success ? '<?php echo $lang->get('server_returned_data'); ?>' : 'Error: ' + result.error;
437 437
                     
438 438
                     output += '<li>' + icon + '<b>' + file + '</b><br/>' + message + '</li>';
439 439
                 });
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
                     // error
465 465
                     toastr.remove();
466 466
                     toastr.error(
467
-                        '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error,
467
+                        '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error,
468 468
                         '', {
469 469
                             closeButton: true,
470 470
                             positionClass: 'toast-bottom-right'
Please login to merge, or discard this patch.
pages/items.js.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('items') === false) {
73 73
     // Not allowed page
74 74
     $session->set('system-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
 
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
             //
1057 1057
         } else if ($(this).data('item-action') === 'link') {
1058 1058
             // Add link to clipboard.
1059
-            navigator.clipboard.writeText("<?php echo $SETTINGS['cpassman_url'];?>/index.php?page=items&group="+store.get('teampassItem').folderId+"&id="+store.get('teampassItem').id);
1059
+            navigator.clipboard.writeText("<?php echo $SETTINGS['cpassman_url']; ?>/index.php?page=items&group="+store.get('teampassItem').folderId+"&id="+store.get('teampassItem').id);
1060 1060
 
1061 1061
             // Display message.
1062 1062
             toastr.remove();
@@ -2698,7 +2698,7 @@  discard block
 block discarded – undo
2698 2698
                 progress: "#form-item-password-strength",
2699 2699
                 score: "#form-item-password-strength"
2700 2700
             },
2701
-            scores: [<?php echo TP_PW_STRENGTH_1;?>, <?php echo TP_PW_STRENGTH_2;?>, <?php echo TP_PW_STRENGTH_3;?>, <?php echo TP_PW_STRENGTH_4;?>, <?php echo TP_PW_STRENGTH_5;?>],
2701
+            scores: [<?php echo TP_PW_STRENGTH_1; ?>, <?php echo TP_PW_STRENGTH_2; ?>, <?php echo TP_PW_STRENGTH_3; ?>, <?php echo TP_PW_STRENGTH_4; ?>, <?php echo TP_PW_STRENGTH_5; ?>],
2702 2702
         },
2703 2703
         i18n : {
2704 2704
             t: function (key) {
@@ -2725,7 +2725,7 @@  discard block
 block discarded – undo
2725 2725
     <?php
2726 2726
     $max_file_size = '';
2727 2727
     if (strrpos($SETTINGS['upload_maxfilesize'], 'mb') === false) {
2728
-        $max_file_size = $SETTINGS['upload_maxfilesize'] . 'mb';
2728
+        $max_file_size = $SETTINGS['upload_maxfilesize'].'mb';
2729 2729
     } else {
2730 2730
         $max_file_size = $SETTINGS['upload_maxfilesize'];
2731 2731
     }
@@ -4647,7 +4647,7 @@  discard block
 block discarded – undo
4647 4647
                         (retData.edition_locked_delay === null ? 
4648 4648
                         '' 
4649 4649
                         :
4650
-                        ' : ' + retData.edition_locked_delay + ' <?php echo $lang->get('seconds');?>'),
4650
+                        ' : ' + retData.edition_locked_delay + ' <?php echo $lang->get('seconds'); ?>'),
4651 4651
                     '', {
4652 4652
                         timeOut: 5000,
4653 4653
                         progressBar: true
@@ -4804,7 +4804,7 @@  discard block
 block discarded – undo
4804 4804
 
4805 4805
                             // Show passwords inputs and form
4806 4806
                             $('#dialog-ldap-user-change-password-info')
4807
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
4807
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
4808 4808
                                 .removeClass('hidden');
4809 4809
                             $('#dialog-ldap-user-change-password').removeClass('hidden');
4810 4810
                         } else if (data.error_type !== 'undefined') {
@@ -4823,7 +4823,7 @@  discard block
 block discarded – undo
4823 4823
 
4824 4824
                                 // Show passwords inputs and form
4825 4825
                                 $('#dialog-ldap-user-change-password-info')
4826
-                                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
4826
+                                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
4827 4827
                                     .removeClass('hidden');
4828 4828
                                 $('#dialog-ldap-user-change-password').removeClass('hidden');
4829 4829
                             });
Please login to merge, or discard this patch.
pages/options.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('options') === false) {
70 70
     // Not allowed page
71 71
     $session->set('system-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
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
                                     // get list of all timezones
323 323
                                     foreach ($zones as $key => $zone) {
324 324
                                         echo '
325
-                                <option value="' . $key . '"', isset($SETTINGS['timezone']) === true && (int) $SETTINGS['timezone'] === $key ? ' selected' : '', '>' . $zone . '</option>';
325
+                                <option value="' . $key.'"', isset($SETTINGS['timezone']) === true && (int) $SETTINGS['timezone'] === $key ? ' selected' : '', '>'.$zone.'</option>';
326 326
                                     }
327 327
                                     ?>
328 328
                                 </select>
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
                                     $languagesList = $languagesList ?? [];
375 375
                                     foreach ($languagesList as $teampassLang) {
376 376
                                         echo '
377
-                                <option value="' . $teampassLang . '"', isset($SETTINGS['default_language']) === true && (int) $SETTINGS['default_language'] === $teampassLang ? ' selected' : '', '>' . $teampassLang . '</option>';
377
+                                <option value="' . $teampassLang.'"', isset($SETTINGS['default_language']) === true && (int) $SETTINGS['default_language'] === $teampassLang ? ' selected' : '', '>'.$teampassLang.'</option>';
378 378
                                     }
379 379
                                     ?>
380 380
                                 </select>
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
                                 <?php
472 472
                                 foreach (TP_PW_COMPLEXITY as $complex) {
473 473
                                     echo '
474
-                                <option value="' . $complex[0] . '"', isset($SETTINGS['personal_saltkey_security_level']) === true && (int) $SETTINGS['personal_saltkey_security_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>';
474
+                                <option value="' . $complex[0].'"', isset($SETTINGS['personal_saltkey_security_level']) === true && (int) $SETTINGS['personal_saltkey_security_level'] === $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>';
475 475
                                 }
476 476
                                 ?>
477 477
                             </select>
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
                                         $roles = getRolesTitles();
849 849
                                         foreach ($roles as $role) {
850 850
                                             echo '
851
-                                    <option value="' . htmlspecialchars($role['id']) . '"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>' . htmlspecialchars(addslashes($role['title'])) . '</option>';
851
+                                    <option value="' . htmlspecialchars($role['id']).'"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>'.htmlspecialchars(addslashes($role['title'])).'</option>';
852 852
                                         }
853 853
                                     }
854 854
                                     ?>
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
                                     <?php
1076 1076
                                     foreach (TP_PW_COMPLEXITY as $complex) {
1077 1077
                                         echo '
1078
-                                <option value="' . $complex[0] . '"', isset($SETTINGS['offline_key_level']) === true && (int) $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>';
1078
+                                <option value="' . $complex[0].'"', isset($SETTINGS['offline_key_level']) === true && (int) $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>';
1079 1079
                                     }
1080 1080
                                     ?>
1081 1081
                                 </select>
Please login to merge, or discard this patch.
sources/upload.files.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 ) {
77 77
     // Not allowed page
78 78
     $session->set('system-error_code', ERR_NOT_ALLOWED);
79
-    include $SETTINGS['cpassman_dir'] . '/error.php';
79
+    include $SETTINGS['cpassman_dir'].'/error.php';
80 80
     exit;
81 81
 }
82 82
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     } else {
131 131
         // check if token is expired
132 132
         $data = DB::queryFirstRow(
133
-            'SELECT end_timestamp FROM ' . prefixTable('tokens') . ' WHERE user_id = %i AND token = %s',
133
+            'SELECT end_timestamp FROM '.prefixTable('tokens').' WHERE user_id = %i AND token = %s',
134 134
             $session->get('user-id'),
135 135
             $post_user_token
136 136
         );
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
 // HTTP headers for no cache etc
156 156
 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
157
-header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
157
+header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
158 158
 header('Cache-Control: no-store, no-cache, must-revalidate');
159 159
 header('Cache-Control: post-check=0, pre-check=0', false);
160 160
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     }
167 167
 
168 168
     // Set directory used to store file
169
-    $targetDir = realpath($SETTINGS['cpassman_dir'] . '/includes/avatars');
169
+    $targetDir = realpath($SETTINGS['cpassman_dir'].'/includes/avatars');
170 170
 } else {
171 171
     $targetDir = realpath($SETTINGS['path_to_files_folder']);
172 172
 }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     $file_name = preg_replace('/[^a-zA-Z0-9-_\.]/', '', strtolower(basename($file->getClientOriginalName())));
220 220
     
221 221
     if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) {
222
-        error_log('Invalid file name: ' . $file_name . '.');
222
+        error_log('Invalid file name: '.$file_name.'.');
223 223
         echo handleUploadError('Invalid file name provided.');
224 224
         return false;
225 225
     }
@@ -233,13 +233,13 @@  discard block
 block discarded – undo
233 233
             $ext = strtolower($ext);
234 234
         } else {
235 235
             // Case where the file extension is not a string
236
-            error_log('Invalid file name: ' . $file_name . '.');
236
+            error_log('Invalid file name: '.$file_name.'.');
237 237
             echo handleUploadError('Invalid file extension.');
238 238
             return false;
239 239
         }
240 240
     } else {
241 241
         // Case where the file name is not a string
242
-        error_log('Invalid file name: ' . $file_name . '.');
242
+        error_log('Invalid file name: '.$file_name.'.');
243 243
         echo handleUploadError('Invalid file.');
244 244
         return false;
245 245
     }
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
     // Validate against a list of allowed extensions
248 248
     $allowed_extensions = explode(
249 249
         ',',
250
-        $SETTINGS['upload_docext'] . ',' . $SETTINGS['upload_imagesext'] .
251
-            ',' . $SETTINGS['upload_pkgext'] . ',' . $SETTINGS['upload_otherext']
250
+        $SETTINGS['upload_docext'].','.$SETTINGS['upload_imagesext'].
251
+            ','.$SETTINGS['upload_pkgext'].','.$SETTINGS['upload_otherext']
252 252
     );
253 253
 
254 254
     // Check if we should enforce extensions
@@ -271,25 +271,25 @@  discard block
 block discarded – undo
271 271
 
272 272
 // is destination folder writable
273 273
 if (is_writable($SETTINGS['path_to_files_folder']) === false) {
274
-    echo handleUploadError('Not enough permissions on folder ' . $SETTINGS['path_to_files_folder'] . '.');
274
+    echo handleUploadError('Not enough permissions on folder '.$SETTINGS['path_to_files_folder'].'.');
275 275
     return false;
276 276
 }
277 277
 
278 278
 // Make sure the fileName is unique but only if chunking is disabled
279
-if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
279
+if ($chunks < 2 && file_exists($targetDir.DIRECTORY_SEPARATOR.$fileName)) {
280 280
     // $ext is guaranteed to be a string due to prior checks
281 281
     $fileNameA = substr($fileName, 0, strlen(/** @scrutinizer ignore-type */$ext));
282 282
     $fileNameB = substr($fileName, strlen(/** @scrutinizer ignore-type */$ext));
283 283
 
284 284
     $count = 1;
285
-    while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileNameA . '_' . $count . $fileNameB)) {
285
+    while (file_exists($targetDir.DIRECTORY_SEPARATOR.$fileNameA.'_'.$count.$fileNameB)) {
286 286
         ++$count;
287 287
     }
288 288
 
289
-    $fileName = $fileNameA . '_' . $count . $fileNameB;
289
+    $fileName = $fileNameA.'_'.$count.$fileNameB;
290 290
 }
291 291
 
292
-$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName;
292
+$filePath = $targetDir.DIRECTORY_SEPARATOR.$fileName;
293 293
 
294 294
 // Create target dir
295 295
 if (!file_exists($targetDir)) {
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 // Remove old temp files
304 304
 if ($cleanupTargetDir && is_dir($targetDir) && ($dir = opendir($targetDir))) {
305 305
     while (($fileClean = readdir($dir)) !== false) {
306
-        $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $fileClean;
306
+        $tmpfilePath = $targetDir.DIRECTORY_SEPARATOR.$fileClean;
307 307
 
308 308
         // Remove temp file if it is older than the max age and is not the current file
309 309
         if (
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 
318 318
     closedir($dir);
319 319
 } else {
320
-    echo handleUploadError('Not enough permissions on folder ' . $SETTINGS['path_to_files_folder'] . '.');
320
+    echo handleUploadError('Not enough permissions on folder '.$SETTINGS['path_to_files_folder'].'.');
321 321
     return false;
322 322
 }
323 323
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 
354 354
                 // Safe destination folder
355 355
                 $uploadDir = realpath($SETTINGS['path_to_upload_folder']);
356
-                $destinationPath = $uploadDir . DIRECTORY_SEPARATOR . $fileName;
356
+                $destinationPath = $uploadDir.DIRECTORY_SEPARATOR.$fileName;
357 357
                 
358 358
                 if (move_uploaded_file($tmpFilePath, $destinationPath)) {
359 359
                     // Open the moved file in read mode
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             return false;
395 395
         }
396 396
     } else {
397
-        echo handleUploadError('Failed to move uploaded file to ' . $SETTINGS['path_to_files_folder'] . '.');
397
+        echo handleUploadError('Failed to move uploaded file to '.$SETTINGS['path_to_files_folder'].'.');
398 398
         return false;
399 399
     }
400 400
 } else {
@@ -410,14 +410,14 @@  discard block
 block discarded – undo
410 410
                 fwrite($out, $buff);
411 411
             }
412 412
         } else {
413
-            echo handleUploadError('Failed to open input stream ' . $SETTINGS['path_to_files_folder'] . '.');
413
+            echo handleUploadError('Failed to open input stream '.$SETTINGS['path_to_files_folder'].'.');
414 414
             return false;
415 415
         }
416 416
 
417 417
         fclose($in);
418 418
         fclose($out);
419 419
     } else {
420
-        echo handleUploadError('Failed to open output stream ' . $SETTINGS['path_to_files_folder'] . '.');
420
+        echo handleUploadError('Failed to open output stream '.$SETTINGS['path_to_files_folder'].'.');
421 421
         return false;
422 422
     }
423 423
 }
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 ) {
451 451
     rename(
452 452
         $filePath,
453
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName
453
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName
454 454
     );
455 455
 
456 456
     // Add in DB
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 ) {
480 480
     rename(
481 481
         $filePath,
482
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName
482
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName
483 483
     );
484 484
 
485 485
     // Add in DB
@@ -512,13 +512,13 @@  discard block
 block discarded – undo
512 512
     // rename the file
513 513
     rename(
514 514
         $filePath,
515
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName . '.' . $ext
515
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName.'.'.$ext
516 516
     );
517 517
 
518 518
     // make thumbnail
519 519
     $ret = makeThumbnail(
520
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName . '.' . $ext,
521
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName . '_thumb' . '.' . $ext,
520
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName.'.'.$ext,
521
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName.'_thumb'.'.'.$ext,
522 522
         40
523 523
     );
524 524
 
@@ -530,21 +530,21 @@  discard block
 block discarded – undo
530 530
     }
531 531
 
532 532
     // get current avatar and delete it
533
-    $data = DB::queryFirstRow('SELECT avatar, avatar_thumb FROM ' . prefixTable('users') . ' WHERE id=%i', $session->get('user-id'));
534
-    fileDelete($targetDir . DIRECTORY_SEPARATOR . $data['avatar'], $SETTINGS);
535
-    fileDelete($targetDir . DIRECTORY_SEPARATOR . $data['avatar_thumb'], $SETTINGS);
533
+    $data = DB::queryFirstRow('SELECT avatar, avatar_thumb FROM '.prefixTable('users').' WHERE id=%i', $session->get('user-id'));
534
+    fileDelete($targetDir.DIRECTORY_SEPARATOR.$data['avatar'], $SETTINGS);
535
+    fileDelete($targetDir.DIRECTORY_SEPARATOR.$data['avatar_thumb'], $SETTINGS);
536 536
 
537 537
     // store in DB the new avatar
538 538
     DB::query(
539
-        'UPDATE ' . prefixTable('users') . "
540
-        SET avatar='" . $newFileName . '.' . $ext . "', avatar_thumb='" . $newFileName . '_thumb' . '.' . $ext . "'
539
+        'UPDATE '.prefixTable('users')."
540
+        SET avatar='" . $newFileName.'.'.$ext."', avatar_thumb='".$newFileName.'_thumb'.'.'.$ext."'
541 541
         WHERE id=%i",
542 542
         $session->get('user-id')
543 543
     );
544 544
 
545 545
     // store in session
546
-    $session->set('user-avatar', $newFileName . '.' . $ext);
547
-    $session->set('user-avatar_thumb', $newFileName . '_thumb' . '.' . $ext);
546
+    $session->set('user-avatar', $newFileName.'.'.$ext);
547
+    $session->set('user-avatar_thumb', $newFileName.'_thumb'.'.'.$ext);
548 548
 
549 549
     // return info
550 550
     echo prepareExchangedData(
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 ) {
564 564
     rename(
565 565
         $filePath,
566
-        $targetDir . DIRECTORY_SEPARATOR . $newFileName
566
+        $targetDir.DIRECTORY_SEPARATOR.$newFileName
567 567
     );
568 568
 
569 569
     // Add in DB
Please login to merge, or discard this patch.
includes/language/english.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
  * @see       https://www.teampass.net
29 29
  */
30 30
 
31
- // TO REMOVE
32
- // - selected_items_to_be_imported
31
+    // TO REMOVE
32
+    // - selected_items_to_be_imported
33 33
 
34 34
 return array(
35 35
     'import_error_folder_creation' => 'Error while creating folder',
Please login to merge, or discard this patch.
pages/import.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     || isset($SETTINGS['allow_import']) === false || (int) $SETTINGS['allow_import'] !== 1) {
71 71
     // Not allowed page
72 72
     $session->set('system-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
 
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
  
86 86
 if ((int) $session->get('user-admin') === 1) {
87 87
     $folderOptions = '';
88
-    $rows = DB::query('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0);
88
+    $rows = DB::query('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0);
89 89
     foreach ($rows as $record) {
90
-        $folderOptions .= '<option value="' . $record['id'] . '">' . htmlspecialchars($record['title'], ENT_QUOTES, 'UTF-8') . '</option>';
90
+        $folderOptions .= '<option value="'.$record['id'].'">'.htmlspecialchars($record['title'], ENT_QUOTES, 'UTF-8').'</option>';
91 91
     }
92 92
 }
93 93
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                                         <?php
190 190
 $complexitySelect = '';
191 191
 foreach (TP_PW_COMPLEXITY as $level) {
192
-    $complexitySelect .= '<option value="' . $level[0] . '">' . $level[1] . '</option>';
192
+    $complexitySelect .= '<option value="'.$level[0].'">'.$level[1].'</option>';
193 193
 }
194 194
 echo $complexitySelect;
195 195
                                         ?>
Please login to merge, or discard this patch.
pages/import.js.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('import') === false) {
73 73
     // Not allowed page
74 74
     $session->set('system-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
 ?>
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
                     const errorMessages = JSON.parse(response.message);
512 512
                     let errorHtml = '<ul>';
513 513
                     errorMessages.forEach(function(error) {
514
-                        errorHtml += '<li><?php echo $lang->get('import_error_folder_creation');?> "<b>'+error.errorPath+'</b>": '+error.errorMessage+'</li>';
514
+                        errorHtml += '<li><?php echo $lang->get('import_error_folder_creation'); ?> "<b>'+error.errorPath+'</b>": '+error.errorMessage+'</li>';
515 515
                     });
516 516
 
517 517
                     $('#import-feedback-progress-text').html(
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
                                     // Isolate first item
998 998
                                     if (itemsList.length > 0) {
999 999
                                         $('#import-feedback-progress-text')
1000
-                                            .html('<i class="fa-solid fa-cog fa-spin ml-4 mr-2"></i><?php echo $lang->get('operation_progress');?> ('+((counter*100)/itemsNumber).toFixed(0)+'%)');
1000
+                                            .html('<i class="fa-solid fa-cog fa-spin ml-4 mr-2"></i><?php echo $lang->get('operation_progress'); ?> ('+((counter*100)/itemsNumber).toFixed(0)+'%)');
1001 1001
 
1002 1002
                                         data = {
1003 1003
                                             'edit-all': $('#import-keepass-edit-all-checkbox').prop('checked') === true ? 1 : 0,
Please login to merge, or discard this patch.