Completed
Push — master ( 8da2eb...bc09ea )
by Nils
01:25 queued 59s
created
scripts/task_maintenance_purge_old_files.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
 {
73 73
     global $SETTINGS;
74 74
     // Load expected files
75
-    require_once __DIR__. '/../sources/main.functions.php';
75
+    require_once __DIR__.'/../sources/main.functions.php';
76 76
 
77 77
     // $SETTINGS is set then read folder
78 78
     if (is_dir($SETTINGS['path_to_files_folder']) === true) {
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             //delete file FILES
82 82
             while (false !== ($f = readdir($dir))) {
83 83
                 if ($f !== '.' && $f !== '..' && $f !== '.htaccess') {
84
-                    $filePath = $SETTINGS['path_to_files_folder'] . '/' . $f;
84
+                    $filePath = $SETTINGS['path_to_files_folder'].'/'.$f;
85 85
                     if (file_exists($filePath) && ((time() - filectime($filePath)) > 604800)) {
86 86
                         fileDelete($filePath, $SETTINGS);
87 87
                     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             while (false !== ($f = readdir($dir))) {
103 103
                 if ($f !== '.' && $f !== '..') {
104 104
                     if (strpos($f, '_delete.') > 0) {
105
-                        fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $f, $SETTINGS);
105
+                        fileDelete($SETTINGS['path_to_upload_folder'].'/'.$f, $SETTINGS);
106 106
                     }
107 107
                 }
108 108
             }
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 && $SETTINGS['timezone'] === $key ? ' selected' : '', '>' . $zone . '</option>';
325
+                                <option value="' . $key.'"', isset($SETTINGS['timezone']) === true && $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 && $SETTINGS['default_language'] === $teampassLang ? ' selected' : '', '>' . $teampassLang . '</option>';
377
+                                <option value="' . $teampassLang.'"', isset($SETTINGS['default_language']) === true && $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 && $SETTINGS['personal_saltkey_security_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>';
474
+                                <option value="' . $complex[0].'"', isset($SETTINGS['personal_saltkey_security_level']) === true && $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 && $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>';
1078
+                                <option value="' . $complex[0].'"', isset($SETTINGS['offline_key_level']) === true && $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.
pages/favourites.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     || (isset($session_user_admin) && (int) $session_user_admin === 1)) {
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
 
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
                             if (empty($fav) === false) {
126 126
                                 $data = DB::queryFirstRow(
127 127
                                     'SELECT i.label, i.description, i.id, i.id_tree, t.title
128
-                                    FROM ' . prefixTable('items') . ' as i
129
-                                    INNER JOIN ' . prefixTable('nested_tree') . ' as t ON (t.id = i.id_tree)
128
+                                    FROM ' . prefixTable('items').' as i
129
+                                    INNER JOIN ' . prefixTable('nested_tree').' as t ON (t.id = i.id_tree)
130 130
                                     WHERE i.id = %i',
131 131
                                     $fav
132 132
                                 );
133
-                                if (! empty($data['label'])) {
133
+                                if (!empty($data['label'])) {
134 134
                                     ?>
135 135
                                     <tr>
136 136
                                         <td>
Please login to merge, or discard this patch.
includes/core/login.oauth2.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 use TeampassClasses\SessionManager\SessionManager;
34 34
 use TeampassClasses\ConfigManager\ConfigManager;
35 35
 
36
-require_once __DIR__. '/../../includes/config/include.php';
36
+require_once __DIR__.'/../../includes/config/include.php';
37 37
 require_once __DIR__.'/../../sources/main.functions.php';
38 38
 
39 39
 // init
Please login to merge, or discard this patch.
sources/upload.attachments.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 ) {
75 75
     // Not allowed page
76 76
     $session->set('system-error_code', ERR_NOT_ALLOWED);
77
-    include $SETTINGS['cpassman_dir'] . '/error.php';
77
+    include $SETTINGS['cpassman_dir'].'/error.php';
78 78
     exit;
79 79
 }
80 80
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 $post_isNewItem = $request->request->filter('isNewItem', null, FILTER_SANITIZE_NUMBER_INT);
108 108
 $post_randomId = $request->request->filter('randomId', null, FILTER_SANITIZE_NUMBER_INT);
109 109
 $post_isPersonal = $request->request->filter('isPersonal', null, FILTER_SANITIZE_NUMBER_INT);
110
-$post_fileSize= $request->request->filter('file_size', null, FILTER_SANITIZE_NUMBER_INT);
110
+$post_fileSize = $request->request->filter('file_size', null, FILTER_SANITIZE_NUMBER_INT);
111 111
 $chunk = $request->request->filter('chunk', 0, FILTER_SANITIZE_NUMBER_INT);
112 112
 $chunks = $request->request->filter('chunks', 0, FILTER_SANITIZE_NUMBER_INT);
113 113
 $fileName = $request->request->filter('name', '', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
     $unit = strtoupper(substr(trim($POST_MAX_SIZE), -1)); // Assurez-vous de bien gérer les espaces éventuels
123 123
     $units = ['G' => 1073741824, 'M' => 1048576, 'K' => 1024];
124 124
     $multiplier = $units[$unit] ?? 1; // Vérifie si l'unité est dans le tableau, sinon 1
125
-    $maxSize = (int)$POST_MAX_SIZE * $multiplier;
125
+    $maxSize = (int) $POST_MAX_SIZE * $multiplier;
126 126
     
127 127
     // CHeck if the POST is too big
128
-    if (!empty($_SERVER['CONTENT_LENGTH']) && (int)$_SERVER['CONTENT_LENGTH'] > $maxSize && $maxSize > 0) {
128
+    if (!empty($_SERVER['CONTENT_LENGTH']) && (int) $_SERVER['CONTENT_LENGTH'] > $maxSize && $maxSize > 0) {
129 129
         handleAttachmentError('POST exceeded maximum allowed size.', 111, 413);
130 130
     }
131 131
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         handleAttachmentError('File exceeds the maximum allowed size', 120, 413);
135 135
         die();
136 136
     }
137
-    if (WIP === true) error_log('POST_MAX_SIZE: ' . $POST_MAX_SIZE." - CONTENT_LENGTH: ".$_SERVER['CONTENT_LENGTH']." - UNIT: ".$unit." - MAX: ".$maxSize." - MULTIPLIER: ".$multiplier." - FILE_SIZE: ".$post_fileSize);
137
+    if (WIP === true) error_log('POST_MAX_SIZE: '.$POST_MAX_SIZE." - CONTENT_LENGTH: ".$_SERVER['CONTENT_LENGTH']." - UNIT: ".$unit." - MAX: ".$maxSize." - MULTIPLIER: ".$multiplier." - FILE_SIZE: ".$post_fileSize);
138 138
     
139 139
     // delete expired tokens
140 140
     DB::delete(prefixTable('tokens'), 'end_timestamp < %i', time());
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         // check if token is expired
186 186
         $data = DB::queryFirstRow(
187 187
             'SELECT end_timestamp
188
-            FROM ' . prefixTable('tokens') . '
188
+            FROM ' . prefixTable('tokens').'
189 189
             WHERE user_id = %i AND token = %s',
190 190
             $session->get('user-id'),
191 191
             $post_user_token
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
 // HTTP headers for no cache etc
220 220
 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
221
-header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
221
+header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
222 222
 header('Cache-Control: no-store, no-cache, must-revalidate');
223 223
 header('Cache-Control: post-check=0, pre-check=0', false);
224 224
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 // Validate file name (for our purposes we'll just remove invalid characters)
257 257
 $file_name = preg_replace('[^A-Za-z0-9]', '', strtolower(basename($_FILES['file']['name'])));
258 258
 if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) {
259
-    handleAttachmentError('Invalid file name: ' . $file_name . '.', 114);
259
+    handleAttachmentError('Invalid file name: '.$file_name.'.', 114);
260 260
 }
261 261
 
262 262
 // Validate file extension
@@ -266,8 +266,8 @@  discard block
 block discarded – undo
266 266
         $ext,
267 267
         explode(
268 268
             ',',
269
-            $SETTINGS['upload_docext'] . ',' . $SETTINGS['upload_imagesext'] .
270
-                ',' . $SETTINGS['upload_pkgext'] . ',' . $SETTINGS['upload_otherext']
269
+            $SETTINGS['upload_docext'].','.$SETTINGS['upload_imagesext'].
270
+                ','.$SETTINGS['upload_pkgext'].','.$SETTINGS['upload_otherext']
271 271
         )
272 272
     ) === false
273 273
 ) {
@@ -279,24 +279,24 @@  discard block
 block discarded – undo
279 279
 
280 280
 // Clean the fileName for security reasons
281 281
 $fileInfo = pathinfo($fileName);
282
-$fileName = base64_encode($fileInfo['filename']) . '.' . $fileInfo['extension'];
282
+$fileName = base64_encode($fileInfo['filename']).'.'.$fileInfo['extension'];
283 283
 $fileFullSize = 0;
284 284
 
285 285
 // Make sure the fileName is unique but only if chunking is disabled
286
-if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
286
+if ($chunks < 2 && file_exists($targetDir.DIRECTORY_SEPARATOR.$fileName)) {
287 287
     $ext = strrpos($fileName, '.');
288 288
     $fileNameA = substr($fileName, 0, $ext);
289 289
     $fileNameB = substr($fileName, $ext);
290 290
 
291 291
     $count = 1;
292
-    while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileNameA . '_' . $count . $fileNameB)) {
292
+    while (file_exists($targetDir.DIRECTORY_SEPARATOR.$fileNameA.'_'.$count.$fileNameB)) {
293 293
         ++$count;
294 294
     }
295 295
 
296
-    $fileName = $fileNameA . '_' . $count . $fileNameB;
296
+    $fileName = $fileNameA.'_'.$count.$fileNameB;
297 297
 }
298 298
 
299
-$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName;
299
+$filePath = $targetDir.DIRECTORY_SEPARATOR.$fileName;
300 300
 
301 301
 // Create target dir
302 302
 if (file_exists($targetDir) === false) {
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 // Remove old temp files
311 311
 if ($cleanupTargetDir && is_dir($targetDir) && ($dir = opendir($targetDir))) {
312 312
     while (($file = readdir($dir)) !== false) {
313
-        $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $file;
313
+        $tmpfilePath = $targetDir.DIRECTORY_SEPARATOR.$file;
314 314
 
315 315
         // Remove temp file if it is older than the max age and is not the current file
316 316
         if (
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
         // This is a public object
430 430
         $users = DB::query(
431 431
             'SELECT id, public_key
432
-            FROM ' . prefixTable('users') . '
433
-            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '")
432
+            FROM ' . prefixTable('users').'
433
+            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'")
434 434
             AND public_key != ""'
435 435
         );
436 436
         foreach ($users as $user) {
@@ -464,14 +464,14 @@  discard block
 block discarded – undo
464 464
                 'date' => time(),
465 465
                 'id_user' => $session->get('user-id'),
466 466
                 'action' => 'at_modification',
467
-                'raison' => 'at_add_file : ' . $fileName . ':' . $newID,
467
+                'raison' => 'at_add_file : '.$fileName.':'.$newID,
468 468
             )
469 469
         );
470 470
     }
471 471
 }
472 472
 
473 473
 // Return JSON-RPC response
474
-die('{"jsonrpc" : "2.0", "result" : null, "id" : "' . $newID . '"}');
474
+die('{"jsonrpc" : "2.0", "result" : null, "id" : "'.$newID.'"}');
475 475
 
476 476
 /**
477 477
  * Handle errors and kill script.
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,9 @@
 block discarded – undo
134 134
         handleAttachmentError('File exceeds the maximum allowed size', 120, 413);
135 135
         die();
136 136
     }
137
-    if (WIP === true) error_log('POST_MAX_SIZE: ' . $POST_MAX_SIZE." - CONTENT_LENGTH: ".$_SERVER['CONTENT_LENGTH']." - UNIT: ".$unit." - MAX: ".$maxSize." - MULTIPLIER: ".$multiplier." - FILE_SIZE: ".$post_fileSize);
137
+    if (WIP === true) {
138
+        error_log('POST_MAX_SIZE: ' . $POST_MAX_SIZE." - CONTENT_LENGTH: ".$_SERVER['CONTENT_LENGTH']." - UNIT: ".$unit." - MAX: ".$maxSize." - MULTIPLIER: ".$multiplier." - FILE_SIZE: ".$post_fileSize);
139
+    }
138 140
     
139 141
     // delete expired tokens
140 142
     DB::delete(prefixTable('tokens'), 'end_timestamp < %i', time());
Please login to merge, or discard this patch.
sources/roles.queries.php 1 patch
Spacing   +5 added lines, -5 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
 
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
                         );
462 462
 
463 463
                         // add new role to user
464
-                        $tmp = $data_tmp['fonction_id'] . (substr($data_tmp['fonction_id'], -1) == ';' ? $role_id : ';' . $role_id);
464
+                        $tmp = $data_tmp['fonction_id'].(substr($data_tmp['fonction_id'], -1) == ';' ? $role_id : ';'.$role_id);
465 465
                         $session->set('user-roles', str_replace(';;', ';', $tmp));
466 466
 
467 467
                         // store in DB
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
                         $groupsData = $openLdapExtra->getADGroups($ldapConnection, $SETTINGS);
650 650
                         break;
651 651
                     default:
652
-                        throw new Exception("Unsupported LDAP type: " . $SETTINGS['ldap_type']);
652
+                        throw new Exception("Unsupported LDAP type: ".$SETTINGS['ldap_type']);
653 653
                 }
654 654
             } catch (Exception $e) {
655 655
                 if (defined('LOG_TO_SERVER') && LOG_TO_SERVER === true) {
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
             } else {
670 670
                 // Handle successful retrieval of groups
671 671
                 // exists in Teampass
672
-                foreach($groupsData['userGroups'] as $key => $group) {
672
+                foreach ($groupsData['userGroups'] as $key => $group) {
673 673
                     $role_detail = DB::queryFirstRow(
674 674
                         'SELECT a.increment_id as increment_id, a.role_id as role_id, r.title as title
675 675
                         FROM '.prefixTable('ldap_groups_roles').' AS a
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
             
695 695
             // Get all groups in Teampass
696 696
             $teampassRoles = array();
697
-            $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title'));
697
+            $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title'));
698 698
             foreach ($rows as $record) {
699 699
                 array_push(
700 700
                     $teampassRoles,
Please login to merge, or discard this patch.
sources/tree.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 ) {
65 65
     // Not allowed page
66 66
     $session->set('system-error_code', ERR_NOT_ALLOWED);
67
-    include $SETTINGS['cpassman_dir'] . '/error.php';
67
+    include $SETTINGS['cpassman_dir'].'/error.php';
68 68
     exit;
69 69
 }
70 70
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 );
126 126
 
127 127
 $lastFolderChange = DB::queryFirstRow(
128
-    'SELECT valeur FROM ' . prefixTable('misc') . '
128
+    'SELECT valeur FROM '.prefixTable('misc').'
129 129
     WHERE type = %s AND intitule = %s',
130 130
     'timestamp',
131 131
     'last_folder_change'
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         $nbItemsInSubfolders = (int) $node->nb_items_in_subfolders;
347 347
         $nbItemsInFolder = (int) $node->nb_items_in_folder;
348 348
         $nbSubfolders = (int) $node->nb_subfolders;
349
-        break;  // Get out as soon as we find a valid node.
349
+        break; // Get out as soon as we find a valid node.
350 350
     }
351 351
     
352 352
     if ($displayThisNode === true) {
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
         foreach ($currentNode->children as $child) {
459 459
             recursiveTree(
460 460
                 (int) $child,
461
-                $tree->getNode($child),// get node info for this child
461
+                $tree->getNode($child), // get node info for this child
462 462
                 /** @scrutinizer ignore-type */ $tree,
463 463
                 $listFoldersLimitedKeys,
464 464
                 $listRestrictedFoldersForItemsKeys,
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
     $lang = new Language($session->get('user-language') ?? 'english');
506 506
 
507 507
     // prepare json return for current node
508
-    $parent = $currentNode->parent_id === '0' ? '#' : 'li_' . $currentNode->parent_id;
508
+    $parent = $currentNode->parent_id === '0' ? '#' : 'li_'.$currentNode->parent_id;
509 509
 
510 510
     // handle displaying
511 511
     if (isKeyExistingAndEqual('show_only_accessible_folders', 1, $SETTINGS) === true) {
@@ -522,17 +522,17 @@  discard block
 block discarded – undo
522 522
         array_push(
523 523
             $ret_json,
524 524
             array(
525
-                'id' => 'li_' . $nodeId,
525
+                'id' => 'li_'.$nodeId,
526 526
                 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent,
527 527
                 'text' => '<i class="'.$currentNode->fa_icon.' tree-folder mr-2" data-folder="'.$currentNode->fa_icon.'"  data-folder-selected="'.$currentNode->fa_icon_selected.'"></i>'.$text.htmlspecialchars($currentNode->title).$nodeData['html'],
528 528
                 'li_attr' => array(
529 529
                     'class' => 'jstreeopen',
530
-                    'title' => 'ID [' . $nodeId . '] ' . $nodeData['title'],
530
+                    'title' => 'ID ['.$nodeId.'] '.$nodeData['title'],
531 531
                 ),
532 532
                 'a_attr' => array(
533
-                    'id' => 'fld_' . $nodeId,
533
+                    'id' => 'fld_'.$nodeId,
534 534
                     'class' => $nodeData['folderClass'],
535
-                    'onclick' => 'ListerItems(' . $nodeId . ', ' . $nodeData['restricted'] . ', 0, 1)',
535
+                    'onclick' => 'ListerItems('.$nodeId.', '.$nodeData['restricted'].', 0, 1)',
536 536
                     'data-title' => htmlspecialchars($currentNode->title),
537 537
                 ),
538 538
                 'is_pf' => in_array($nodeId, $inputData['personalFolders']) === true ? 1 : 0,
@@ -548,12 +548,12 @@  discard block
 block discarded – undo
548 548
         array_push(
549 549
             $ret_json,
550 550
             array(
551
-                'id' => 'li_' . $nodeId,
551
+                'id' => 'li_'.$nodeId,
552 552
                 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent,
553 553
                 '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.htmlspecialchars($currentNode->title).$nodeData['html'],
554 554
                 'li_attr' => array(
555 555
                     'class' => '',
556
-                    'title' => 'ID [' . $nodeId . '] ' . $lang->get('no_access'),
556
+                    'title' => 'ID ['.$nodeId.'] '.$lang->get('no_access'),
557 557
                 ),
558 558
             )
559 559
         );
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
         if (in_array($nodeId, $session_read_only_folders) === true) {
614 614
             return [
615 615
                 'html' => '<i class="far fa-eye fa-xs mr-1 ml-1"></i>'.
616
-                    ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>'  : ''),
616
+                    ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''),
617 617
                 'title' => $lang->get('read_only_account'),
618 618
                 'restricted' => 1,
619 619
                 'folderClass' => 'folder_not_droppable',
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
         ) {
629 629
             return [
630 630
                 'html' => '<i class="far fa-eye fa-xs mr-1"></i>'.
631
-                    ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>'  : ''),
631
+                    ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''),
632 632
                 'title' => $lang->get('read_only_account'),
633 633
                 'restricted' => 0,
634 634
                 'folderClass' => 'folder',
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
         }
640 640
         
641 641
         return [
642
-            'html' => ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $nbItemsInFolder .'/'.$nbItemsInSubfolders .'/'.$nbSubfolders. '</span>'  : ''),
642
+            'html' => ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$nbItemsInFolder.'/'.$nbItemsInSubfolders.'/'.$nbSubfolders.'</span>' : ''),
643 643
             'title' => '',
644 644
             'restricted' => 0,
645 645
             'folderClass' => 'folder',
@@ -650,8 +650,8 @@  discard block
 block discarded – undo
650 650
 
651 651
     } elseif (in_array($nodeId, $listFoldersLimitedKeys) === true) {
652 652
         return [
653
-            'html' => ($session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '') .
654
-                ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . count($session_list_folders_limited[$nodeId]) . '</span>' : ''),
653
+            'html' => ($session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '').
654
+                ($tree_counters === 1 ? '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.count($session_list_folders_limited[$nodeId]).'</span>' : ''),
655 655
             'title' => '',
656 656
             'restricted' => 1,
657 657
             'folderClass' => 'folder',
@@ -662,8 +662,8 @@  discard block
 block discarded – undo
662 662
 
663 663
     } elseif (in_array($nodeId, $listRestrictedFoldersForItemsKeys) === true) {
664 664
         return [
665
-            'html' => $session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '' .
666
-                '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . count($session_list_restricted_folders_for_items[$nodeId]) . '</span>',
665
+            'html' => $session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : ''.
666
+                '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.count($session_list_restricted_folders_for_items[$nodeId]).'</span>',
667 667
             'title' => '',
668 668
             'restricted' => 1,
669 669
             'folderClass' => 'folder',
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
     // Does this user has a tree cache
774 774
     $userCacheTree = DB::queryFirstRow(
775 775
         'SELECT data
776
-        FROM ' . prefixTable('cache_tree') . '
776
+        FROM ' . prefixTable('cache_tree').'
777 777
         WHERE user_id = %i',
778 778
         $userId
779 779
     );
Please login to merge, or discard this patch.
sources/logs.datatables.php 1 patch
Spacing   +23 added lines, -24 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
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     
169 169
     // Output
170 170
     $sOutput = '{';
171
-    $sOutput .= '"sEcho": '. $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
171
+    $sOutput .= '"sEcho": '.$request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
172 172
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
173 173
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
174 174
     $sOutput .= '"aaData": ';
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
     // Output
243 243
     $sOutput = '{';
244
-    $sOutput .= '"sEcho": '. $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
244
+    $sOutput .= '"sEcho": '.$request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
245 245
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
246 246
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
247 247
     $sOutput .= '"aaData": ';
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
     // Output
316 316
     $sOutput = '{';
317
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
317
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
318 318
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
319 319
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
320 320
     $sOutput .= '"aaData": ';
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
     // Output
389 389
     $sOutput = '{';
390
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
390
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
391 391
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
392 392
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
393 393
     $sOutput .= '"aaData": [ ';
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 
491 491
     // Output
492 492
     $sOutput = '{';
493
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
493
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
494 494
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
495 495
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
496 496
     $sOutput .= '"aaData": [ ';
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
         $iTotal = 0;
573 573
     }
574 574
     $sOutput = '{';
575
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
575
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
576 576
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
577 577
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
578 578
     $sOutput .= '"aaData": ';
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 
649 649
     // Output
650 650
     $sOutput = '{';
651
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
651
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
652 652
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
653 653
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
654 654
     $sOutput .= '"aaData": ';
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 
718 718
     // Output
719 719
     $sOutput = '{';
720
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
720
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
721 721
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
722 722
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
723 723
     $sOutput .= '"aaData": ';
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 
791 791
     // Output
792 792
     $sOutput = '{';
793
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
793
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
794 794
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
795 795
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
796 796
     $sOutput .= '"aaData": ';
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
             FROM '.prefixTable('background_tasks').' AS p 
868 868
             LEFT JOIN '.prefixTable('users').' AS u ON %l
869 869
             WHERE %l ORDER BY %l %l LIMIT %i, %i';
870
-    $params = ['u.id = json_extract(p.arguments, "$[0]")',$sWhere, $orderColumn, $orderDirection, $sLimitStart, $sLimitLength];
870
+    $params = ['u.id = json_extract(p.arguments, "$[0]")', $sWhere, $orderColumn, $orderDirection, $sLimitStart, $sLimitLength];
871 871
 
872 872
     // Get the records
873 873
     $rows = DB::query($sql, ...$params);
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 
876 876
     // Output
877 877
     $sOutput = '{';
878
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
878
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
879 879
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
880 880
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
881 881
     $sOutput .= '"aaData": ';
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
         //col1
891 891
         $sOutput .= '"<span data-done=\"'.$record['is_in_progress'].'\" data-type=\"'.$record['process_type'].'\" data-process-id=\"'.$record['increment_id'].'\"></span>", ';
892 892
         //col2
893
-        $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", ';
893
+        $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", ';
894 894
         //col3
895 895
         //$sOutput .= '"'.($record['updated_at'] === '' ? '-' : date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['updated_at'])).'", ';
896 896
         $sOutput .= '"<div class=\"progress mt-2\"><div class=\"progress-bar\" style=\"width: '.$subtaskProgress.'\">'.$subtaskProgress.'</div></div>", ';
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
         // col5
901 901
         if (in_array($record['process_type'], array('create_user_keys', 'item_copy')) === true) {
902 902
             $data_user = DB::queryFirstRow(
903
-                'SELECT name, lastname FROM ' . prefixTable('users') . '
903
+                'SELECT name, lastname FROM '.prefixTable('users').'
904 904
                 WHERE id = %i',
905 905
                 json_decode($record['arguments'], true)['new_user_id']
906 906
             );
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
     FROM '.prefixTable('background_tasks').' AS p 
957 957
     LEFT JOIN '.prefixTable('users').' AS u ON %l
958 958
     WHERE %l ORDER BY %l %l LIMIT %i, %i';
959
-    $params = ['u.id = json_extract(p.arguments, "$[0]")',$sWhere, $orderColumn, $orderDirection, $sLimitStart, $sLimitLength];
959
+    $params = ['u.id = json_extract(p.arguments, "$[0]")', $sWhere, $orderColumn, $orderDirection, $sLimitStart, $sLimitLength];
960 960
 
961 961
     // Get the records
962 962
     $rows = DB::query($sql, ...$params);
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 
965 965
     // Output
966 966
     $sOutput = '{';
967
-    $sOutput .= '"sEcho": '. (int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
967
+    $sOutput .= '"sEcho": '.(int) $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
968 968
     $sOutput .= '"iTotalRecords": '.$iTotal.', ';
969 969
     $sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
970 970
     $sOutput .= '"aaData": ';
@@ -980,13 +980,12 @@  discard block
 block discarded – undo
980 980
         //col1
981 981
         $sOutput .= '"", ';
982 982
         //col2
983
-        $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", ';
983
+        $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", ';
984 984
         //col3
985 985
         $sOutput .= is_null($record['started_at']) === false ?
986
-            ('"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['started_at']).'", ') :
987
-                ('"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['created_at']).'", ');
986
+            ('"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['started_at']).'", ') : ('"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['created_at']).'", ');
988 987
         //col4
989
-        $sOutput .= '"'.date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['finished_at']).'", ';
988
+        $sOutput .= '"'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['finished_at']).'", ';
990 989
         // col7
991 990
         $sOutput .= '"'.gmdate('H:i:s', (int) $record['finished_at'] - (is_null($record['started_at']) === false ? (int) $record['started_at'] : (int) $record['created_at'])).'",';
992 991
         //col5
@@ -1005,7 +1004,7 @@  discard block
 block discarded – undo
1005 1004
         $newUserId = array_key_exists('new_user_id', $arguments) ? $arguments['new_user_id'] : null;
1006 1005
         if ($record['process_type'] === 'create_user_keys' && is_null($newUserId) === false && empty($newUserId) === false) {
1007 1006
             $data_user = DB::queryFirstRow(
1008
-                'SELECT name, lastname, login FROM ' . prefixTable('users') . '
1007
+                'SELECT name, lastname, login FROM '.prefixTable('users').'
1009 1008
                 WHERE id = %i',
1010 1009
                 $newUserId
1011 1010
             );
@@ -1021,7 +1020,7 @@  discard block
 block discarded – undo
1021 1020
         } elseif ($record['process_type'] === 'user_build_cache_tree') {
1022 1021
             $user = json_decode($record['arguments'], true)['user_id'];
1023 1022
             $data_user = DB::queryFirstRow(
1024
-                'SELECT name, lastname, login FROM ' . prefixTable('users') . '
1023
+                'SELECT name, lastname, login FROM '.prefixTable('users').'
1025 1024
                 WHERE id = %i',
1026 1025
                 $user
1027 1026
             );
@@ -1055,7 +1054,7 @@  discard block
 block discarded – undo
1055 1054
 {
1056 1055
     $subtasks = DB::query(
1057 1056
         'SELECT *
1058
-        FROM ' . prefixTable('background_subtasks') . '
1057
+        FROM ' . prefixTable('background_subtasks').'
1059 1058
         WHERE task_id = %i',
1060 1059
         $id
1061 1060
     );
@@ -1071,5 +1070,5 @@  discard block
 block discarded – undo
1071 1070
         $i++;
1072 1071
     }
1073 1072
 
1074
-    return ($finished_nb !== 0 ? pourcentage($finished_nb, $nb, 100) : 0) .'%';
1073
+    return ($finished_nb !== 0 ? pourcentage($finished_nb, $nb, 100) : 0).'%';
1075 1074
 }
1076 1075
\ No newline at end of file
Please login to merge, or discard this patch.
sources/export.queries.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 ) {
79 79
     // Not allowed page
80 80
     $session->set('system-error_code', ERR_NOT_ALLOWED);
81
-    include $SETTINGS['cpassman_dir'] . '/error.php';
81
+    include $SETTINGS['cpassman_dir'].'/error.php';
82 82
     exit;
83 83
 }
84 84
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 $antiXss = new AntiXSS();
101 101
 
102 102
 // User's language loading
103
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $session->get('user-language') . '.php';
103
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$session->get('user-language').'.php';
104 104
 
105 105
 // Prepare POST variables
106 106
 $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
                         'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso,
152 152
                             i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url,
153 153
                             i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period
154
-                        FROM ' . prefixTable('items') . ' as i
155
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
156
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
154
+                        FROM ' . prefixTable('items').' as i
155
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
156
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
157 157
                         WHERE i.inactif = %i
158 158
                         AND i.id_tree= %i
159 159
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
                                 // Run query
177 177
                                 $dataItem = DB::queryFirstRow(
178 178
                                     'SELECT i.pw AS pw, s.share_key AS share_key
179
-                                    FROM ' . prefixTable('items') . ' AS i
180
-                                    INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
179
+                                    FROM ' . prefixTable('items').' AS i
180
+                                    INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
181 181
                                     WHERE user_id = %i AND i.id = %i',
182 182
                                     $session->get('user-id'),
183 183
                                     $record['id']
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
                                 $arr_kbs = [];
202 202
                                 $rows_kb = DB::query(
203 203
                                     'SELECT b.label, b.id
204
-                                    FROM ' . prefixTable('kb_items') . ' AS a
205
-                                    INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
204
+                                    FROM ' . prefixTable('kb_items').' AS a
205
+                                    INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
206 206
                                     WHERE a.item_id = %i',
207 207
                                     $record['id']
208 208
                                 );
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                                 $arr_tags = [];
215 215
                                 $rows_tag = DB::query(
216 216
                                     'SELECT tag
217
-                                    FROM ' . prefixTable('tags') . '
217
+                                    FROM ' . prefixTable('tags').'
218 218
                                     WHERE item_id = %i',
219 219
                                     $record['id']
220 220
                                 );
@@ -226,18 +226,18 @@  discard block
 block discarded – undo
226 226
                                 $arr_trees = [];
227 227
                                 $rows_child_tree = DB::query(
228 228
                                     'SELECT t.id, t.title
229
-                                    FROM ' . prefixTable('nested_tree') . ' AS t
230
-                                    INNER JOIN ' . prefixTable('items') . ' AS i ON (t.id = i.id_tree)
229
+                                    FROM ' . prefixTable('nested_tree').' AS t
230
+                                    INNER JOIN ' . prefixTable('items').' AS i ON (t.id = i.id_tree)
231 231
                                     WHERE i.id = %i',
232 232
                                     $record['id']
233 233
                                 );
234 234
                                 foreach ($rows_child_tree as $rec_child_tree) {
235 235
                                     $stack = array();
236 236
                                     $parent = $rec_child_tree['id'];
237
-                                    while($parent != 0){
237
+                                    while ($parent != 0) {
238 238
                                         $rows_parent_tree = DB::query(
239 239
                                             'SELECT parent_id, title
240
-                                            FROM ' . prefixTable('nested_tree') . '
240
+                                            FROM ' . prefixTable('nested_tree').'
241 241
                                             WHERE id = %i',
242 242
                                             $parent
243 243
                                         );
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             // Prepare variables
325 325
             $post_export_tag = filter_var($dataReceived['export_tag'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
326 326
             if (empty($post_export_tag) === false) {
327
-                DB::query('DELETE FROM ' . prefixTable('export') . ' WHERE export_tag = %s', $post_export_tag);
327
+                DB::query('DELETE FROM '.prefixTable('export').' WHERE export_tag = %s', $post_export_tag);
328 328
             }
329 329
             break;
330 330
 
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
                         l.date as date, i.pw_iv as pw_iv,
375 375
                         n.renewal_period as renewal_period,
376 376
                         i.id_tree as tree_id
377
-                        FROM ' . prefixTable('items') . ' as i
378
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
379
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
377
+                        FROM ' . prefixTable('items').' as i
378
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
379
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
380 380
                         WHERE i.inactif = %i
381 381
                         AND i.id_tree= %i
382 382
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -402,8 +402,8 @@  discard block
 block discarded – undo
402 402
                             // Run query
403 403
                             $dataItem = DB::queryFirstRow(
404 404
                                 'SELECT i.pw AS pw, s.share_key AS share_key
405
-                                FROM ' . prefixTable('items') . ' AS i
406
-                                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
405
+                                FROM ' . prefixTable('items').' AS i
406
+                                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
407 407
                                 WHERE user_id = %i AND i.id = %i',
408 408
                                 $session->get('user-id'),
409 409
                                 $record['id']
@@ -427,8 +427,8 @@  discard block
 block discarded – undo
427 427
                             $arr_kbs = '';
428 428
                             $rows_kb = DB::query(
429 429
                                 'SELECT b.label, b.id
430
-                                FROM ' . prefixTable('kb_items') . ' AS a
431
-                                INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
430
+                                FROM ' . prefixTable('kb_items').' AS a
431
+                                INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
432 432
                                 WHERE a.item_id = %i',
433 433
                                 $record['id']
434 434
                             );
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
                                 if (empty($arr_kbs)) {
437 437
                                     $arr_kbs = $rec_kb['label'];
438 438
                                 } else {
439
-                                    $arr_kbs .= ' | ' . $rec_kb['label'];
439
+                                    $arr_kbs .= ' | '.$rec_kb['label'];
440 440
                                 }
441 441
                             }
442 442
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
                             $arr_tags = '';
445 445
                             $rows_tag = DB::query(
446 446
                                 'SELECT tag
447
-                                FROM ' . prefixTable('tags') . '
447
+                                FROM ' . prefixTable('tags').'
448 448
                                 WHERE item_id = %i',
449 449
                                 $record['id']
450 450
                             );
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
                                 if (empty($arr_tags)) {
453 453
                                     $arr_tags = $rec_tag['tag'];
454 454
                                 } else {
455
-                                    $arr_tags .= ' ' . $rec_tag['tag'];
455
+                                    $arr_tags .= ' '.$rec_tag['tag'];
456 456
                                 }
457 457
                             }
458 458
 
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
             // query
531 531
             $rows = DB::query(
532 532
                 'SELECT * 
533
-                FROM ' . prefixTable('export') . ' 
533
+                FROM ' . prefixTable('export').' 
534 534
                 WHERE export_tag = %s',
535 535
                 $dataReceived['export_tag']
536 536
             );
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
                 $prev_path = '';
543 543
 
544 544
                 //Prepare the PDF file
545
-                include $SETTINGS['cpassman_dir'] . '/vendor/tecnickcom/tcpdf/tcpdf.php';
545
+                include $SETTINGS['cpassman_dir'].'/vendor/tecnickcom/tcpdf/tcpdf.php';
546 546
 
547 547
                 $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
548 548
                 $pdf->SetProtection(array('print'), $dataReceived['pdf_password'], null);
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 
555 555
                 // set default header data
556 556
                 $pdf->SetHeaderData(
557
-                    $SETTINGS['cpassman_dir'] . '/includes/images/teampass-logo2-home.png',
557
+                    $SETTINGS['cpassman_dir'].'/includes/images/teampass-logo2-home.png',
558 558
                     PDF_HEADER_LOGO_WIDTH,
559 559
                     'Teampass export',
560 560
                     $session->get('user-lastname')." ".$session->get('user-name').' @ '.date($SETTINGS['date_format']." ".$SETTINGS['time_format'], (int) time())
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
                 logEvents($SETTINGS, 'pdf_export', '', (string) $session->get('user-id'), $session->get('user-login'));
665 665
 
666 666
                 //clean table
667
-                DB::query('TRUNCATE TABLE ' . prefixTable('export'));
667
+                DB::query('TRUNCATE TABLE '.prefixTable('export'));
668 668
 
669 669
                 // Clean any content of the output buffer
670 670
                 ob_end_clean();
@@ -702,13 +702,13 @@  discard block
 block discarded – undo
702 702
             // step 1:
703 703
             // - prepare export file
704 704
             // - get full list of objects id to export
705
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
705
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
706 706
             $idsList = array();
707 707
 
708 708
             // query
709 709
             $rows = DB::query(
710 710
                 'SELECT * 
711
-                FROM ' . prefixTable('export') . ' 
711
+                FROM ' . prefixTable('export').' 
712 712
                 WHERE export_tag = %s',
713 713
                 $inputData['export_tag']
714 714
             );
@@ -745,13 +745,13 @@  discard block
 block discarded – undo
745 745
             }
746 746
             // prepare export file
747 747
             //save the file
748
-            $outstream = fopen($SETTINGS['path_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'], 'w');
748
+            $outstream = fopen($SETTINGS['path_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'], 'w');
749 749
             if ($outstream === false) {
750 750
                 echo (string) prepareExchangedData(
751 751
                     [
752 752
                         'error' => true,
753 753
                         'message' => $lang->get('error_while_creating_file'),
754
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
754
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
755 755
                     ],
756 756
                     'encode'
757 757
                 );
@@ -777,12 +777,12 @@  discard block
 block discarded – undo
777 777
     </style>
778 778
     </head>
779 779
     <body>
780
-    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $inputData['password']) . '" />
780
+    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $inputData['password']).'" />
781 781
     <div id="header">
782
-    ' . TP_TOOL_NAME . ' - Off Line mode
782
+    ' . TP_TOOL_NAME.' - Off Line mode
783 783
     </div>
784 784
     <div style="margin:10px; font-size:9px;">
785
-    <i>This page was generated by <b>' . $session->get('user-name') . ' ' . $session->get('user-lastname') . '</b>, the ' . date('Y/m/d H:i:s') . '.</i>
785
+    <i>This page was generated by <b>' . $session->get('user-name').' '.$session->get('user-lastname').'</b>, the '.date('Y/m/d H:i:s').'.</i>
786 786
     <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span>
787 787
     </div>
788 788
     <div id="information"></div>
@@ -793,11 +793,11 @@  discard block
 block discarded – undo
793 793
     <div>
794 794
     <table id="itemsTable">
795 795
         <thead><tr>
796
-            <th style="width:15%;">' . $lang->get('label') . '</th>
797
-            <th style="width:10%;">' . $lang->get('pw') . '</th>
798
-            <th style="width:30%;">' . $lang->get('description') . '</th>
799
-            <th style="width:5%;">' . $lang->get('user_login') . '</th>
800
-            <th style="width:20%;">' . $lang->get('url') . '</th>
796
+            <th style="width:15%;">' . $lang->get('label').'</th>
797
+            <th style="width:10%;">' . $lang->get('pw').'</th>
798
+            <th style="width:30%;">' . $lang->get('description').'</th>
799
+            <th style="width:5%;">' . $lang->get('user_login').'</th>
800
+            <th style="width:20%;">' . $lang->get('url').'</th>
801 801
         </tr></thead>
802 802
         <tbody id="itemsTable_tbody">'
803 803
             );
@@ -811,8 +811,8 @@  discard block
 block discarded – undo
811 811
                     'loop' => true,
812 812
                     'ids_list' => json_encode($idsList),
813 813
                     'ids_count' => count($idsList),
814
-                    'file_path' => $SETTINGS['path_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'],
815
-                    'file_link' => $SETTINGS['url_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'],
814
+                    'file_path' => $SETTINGS['path_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'],
815
+                    'file_link' => $SETTINGS['url_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'],
816 816
                     'export_tag' => $inputData['export_tag'],
817 817
                 ],
818 818
                 'encode'
@@ -851,12 +851,12 @@  discard block
 block discarded – undo
851 851
             $full_listing = array();
852 852
             $items_id_list = array();
853 853
             $outstream = '';
854
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
854
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
855 855
 
856 856
             // query
857 857
             $rows = DB::query(
858 858
                 'SELECT * 
859
-                FROM ' . prefixTable('export') . ' 
859
+                FROM ' . prefixTable('export').' 
860 860
                 WHERE export_tag = %s AND item_id IN %ls',
861 861
                 $inputData['export_tag'],
862 862
                 $inputData['idsList']
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
                         [
871 871
                             'error' => true,
872 872
                             'message' => $lang->get('error_while_creating_file'),
873
-                            'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
873
+                            'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
874 874
                         ],
875 875
                         'encode'
876 876
                     );
@@ -912,13 +912,13 @@  discard block
 block discarded – undo
912 912
                         if (empty($arboHtml)) {
913 913
                             $arboHtml = $arboHtml_tmp;
914 914
                         } else {
915
-                            $arboHtml .= ' » ' . $arboHtml_tmp;
915
+                            $arboHtml .= ' » '.$arboHtml_tmp;
916 916
                         }
917 917
                     }
918 918
                     fputs(
919 919
                         $outstream,
920 920
                         '
921
-        <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>'
921
+        <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>'
922 922
                     );
923 923
                     $idTree = $record['folder_id'];
924 924
 
@@ -926,12 +926,12 @@  discard block
 block discarded – undo
926 926
                     fputs(
927 927
                         $outstream,
928 928
                         '
929
-        <tr class="' . $lineType . '">
930
-            <td>' . addslashes($record['label']) . '</td>
931
-            <td align="center"><span class="span_pw" id="span_' . $record['item_id'] . '"><a href="#" onclick="decryptme(' . $record['item_id'] . ', \'' . $encPw . '\');return false;">Decrypt </a></span><input type="hidden" id="hide_' . $record['item_id'] . '" value="' . $encPw . '" /></td>
932
-            <td>' . (empty($record['description']) === true ? '&nbsp;' : addslashes(str_replace(array(';', '<br />'), array('|', "\n\r"), stripslashes(mb_convert_encoding($record['description'], 'ISO-8859-1', 'UTF-8'))))) . '</td>
933
-            <td align="center">' . (empty($record['login']) === true ? '&nbsp;' : addslashes($record['login'])) . '</td>
934
-            <td align="center">' . (empty($record['url']) === true ? '&nbsp;' : addslashes($record['url'])) . '</td>
929
+        <tr class="' . $lineType.'">
930
+            <td>' . addslashes($record['label']).'</td>
931
+            <td align="center"><span class="span_pw" id="span_' . $record['item_id'].'"><a href="#" onclick="decryptme('.$record['item_id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$record['item_id'].'" value="'.$encPw.'" /></td>
932
+            <td>' . (empty($record['description']) === true ? '&nbsp;' : addslashes(str_replace(array(';', '<br />'), array('|', "\n\r"), stripslashes(mb_convert_encoding($record['description'], 'ISO-8859-1', 'UTF-8'))))).'</td>
933
+            <td align="center">' . (empty($record['login']) === true ? '&nbsp;' : addslashes($record['login'])).'</td>
934
+            <td align="center">' . (empty($record['url']) === true ? '&nbsp;' : addslashes($record['url'])).'</td>
935 935
         </tr>'
936 936
                     );
937 937
                 }
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
             $inputData['password'] = (string) filter_var($dataReceived['password'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
981 981
             
982 982
             // Load includes
983
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
983
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
984 984
 
985 985
             // read the content of the temporary file
986 986
             $handle = fopen($inputData['filename'].'.txt', 'r');
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
                     [
990 990
                         'error' => true,
991 991
                         'message' => $lang->get('error_while_creating_file'),
992
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
992
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
993 993
                     ],
994 994
                     'encode'
995 995
                 );
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
                     [
1002 1002
                         'error' => true,
1003 1003
                         'message' => $lang->get('error_while_creating_file'),
1004
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
1004
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
1005 1005
                     ],
1006 1006
                     'encode'
1007 1007
                 );
@@ -1017,9 +1017,9 @@  discard block
 block discarded – undo
1017 1017
             $chunks = explode('|#|#|', chunk_split($contents, 10000, '|#|#|'));
1018 1018
             foreach ($chunks as $chunk) {
1019 1019
                 if (empty($encrypted_text) === true) {
1020
-                    $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password'] );
1020
+                    $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password']);
1021 1021
                 } else {
1022
-                    $encrypted_text .= '|#|#|' . GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password'] );
1022
+                    $encrypted_text .= '|#|#|'.GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password']);
1023 1023
                 }
1024 1024
             }
1025 1025
 
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
                     [
1031 1031
                         'error' => true,
1032 1032
                         'message' => $lang->get('error_while_creating_file'),
1033
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
1033
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
1034 1034
                     ],
1035 1035
                     'encode'
1036 1036
                 );
@@ -1043,9 +1043,9 @@  discard block
 block discarded – undo
1043 1043
         </table></div>
1044 1044
         <input type="button" value="Hide all" onclick="hideAll()" />
1045 1045
         <div id="footer" style="text-align:center;">
1046
-            <a href="https://teampass.net/about/" target="_blank">' . TP_TOOL_NAME . '&nbsp;' . TP_VERSION . '&nbsp;' . TP_COPYRIGHT . '</a>
1046
+            <a href="https://teampass.net/about/" target="_blank">' . TP_TOOL_NAME.'&nbsp;'.TP_VERSION.'&nbsp;'.TP_COPYRIGHT.'</a>
1047 1047
         </div>
1048
-        <div id="enc_html" style="display:none;">' . $encrypted_text . '</div>
1048
+        <div id="enc_html" style="display:none;">' . $encrypted_text.'</div>
1049 1049
         </body>
1050 1050
     </html>
1051 1051
     <script type="text/javascript">
@@ -1148,12 +1148,12 @@  discard block
 block discarded – undo
1148 1148
             fclose($outstream);
1149 1149
 
1150 1150
             //clean table
1151
-            DB::query('TRUNCATE TABLE ' . prefixTable('export'));
1151
+            DB::query('TRUNCATE TABLE '.prefixTable('export'));
1152 1152
 
1153 1153
             echo (string) prepareExchangedData(
1154 1154
                 [
1155 1155
                     'error' => false,
1156
-                    'filelink' => $inputData['file_link'] ,
1156
+                    'filelink' => $inputData['file_link'],
1157 1157
                 ],
1158 1158
                 'encode'
1159 1159
             );
Please login to merge, or discard this patch.