Passed
Branch — 3.1.3-preparation (56a0b7)
by Nils
12:02
created
sources/import.queries.php 1 patch
Spacing   +5 added lines, -5 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
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             $lexer = new Lexer($config);
167 167
             $config->setIgnoreHeaderLine('true');
168 168
             $interpreter = new Interpreter();
169
-            $interpreter->addObserver(function (array $row) use (&$valuesToImport) {
169
+            $interpreter->addObserver(function(array $row) use (&$valuesToImport) {
170 170
                 $valuesToImport[] = array(
171 171
                     'Label' => $row[0],
172 172
                     'Login' => $row[1],
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
         ];
707 707
         $startPathLevel = 1;
708 708
 
709
-        foreach($post_folders as $folder) {
709
+        foreach ($post_folders as $folder) {
710 710
             // get parent id
711 711
             $parentId = $arrFolders[$folder['parentFolderId']];
712 712
 
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
         DB::startTransaction();
778 778
 
779 779
         // Import all items
780
-        foreach($post_items as $item) {
780
+        foreach ($post_items as $item) {
781 781
             // get info about this folder
782 782
             $destinationFolderMore = DB::queryFirstRow(
783 783
                 'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i',
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
     ];
1019 1019
 }
1020 1020
 
1021
-spl_autoload_register(function ($class) {
1021
+spl_autoload_register(function($class) {
1022 1022
     $prefix = 'League\\Csv\\';
1023 1023
     $base_dir = __DIR__.'/src/';
1024 1024
     $len = strlen($prefix);
Please login to merge, or discard this patch.
sources/admin.queries.php 1 patch
Spacing   +124 added lines, -124 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('admin') === 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
 
@@ -133,21 +133,21 @@  discard block
 block discarded – undo
133 133
             break;
134 134
         }
135 135
 
136
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
136
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
137 137
         $return = '';
138 138
 
139 139
         //Get all tables
140 140
         $tables = array();
141 141
         $result = DB::query('SHOW TABLES');
142 142
         foreach ($result as $row) {
143
-            $tables[] = $row['Tables_in_' . $database];
143
+            $tables[] = $row['Tables_in_'.$database];
144 144
         }
145 145
 
146 146
         //cycle through
147 147
         foreach ($tables as $table) {
148 148
             if (defined('DB_PREFIX') || substr_count($table, DB_PREFIX) > 0) {
149 149
                 // Do query
150
-                $result = DB::queryRaw('SELECT * FROM ' . $table);
150
+                $result = DB::queryRaw('SELECT * FROM '.$table);
151 151
                 DB::queryRaw(
152 152
                     'SELECT *
153 153
                     FROM INFORMATION_SCHEMA.COLUMNS
@@ -159,19 +159,19 @@  discard block
 block discarded – undo
159 159
                 $numFields = DB::count();
160 160
 
161 161
                 // prepare a drop table
162
-                $return .= 'DROP TABLE ' . $table . ';';
163
-                $row2 = DB::queryfirstrow('SHOW CREATE TABLE ' . $table);
164
-                $return .= "\n\n" . $row2['Create Table'] . ";\n\n";
162
+                $return .= 'DROP TABLE '.$table.';';
163
+                $row2 = DB::queryfirstrow('SHOW CREATE TABLE '.$table);
164
+                $return .= "\n\n".$row2['Create Table'].";\n\n";
165 165
 
166 166
                 //prepare all fields and datas
167 167
                 for ($i = 0; $i < $numFields; ++$i) {
168 168
                     while ($row = $result->fetch_row()) {
169
-                        $return .= 'INSERT INTO ' . $table . ' VALUES(';
169
+                        $return .= 'INSERT INTO '.$table.' VALUES(';
170 170
                         for ($j = 0; $j < $numFields; ++$j) {
171 171
                             $row[$j] = addslashes($row[$j]);
172 172
                             $row[$j] = preg_replace("/\n/", '\\n', $row[$j]);
173 173
                             if (isset($row[$j])) {
174
-                                $return .= '"' . $row[$j] . '"';
174
+                                $return .= '"'.$row[$j].'"';
175 175
                             } else {
176 176
                                 $return .= 'NULL';
177 177
                             }
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
             $token = GenerateCryptKey(20, false, true, true, false, true);
192 192
 
193 193
             //save file
194
-            $filename = time() . '-' . $token . '.sql';
195
-            $handle = fopen($SETTINGS['path_to_files_folder'] . '/' . $filename, 'w+');
194
+            $filename = time().'-'.$token.'.sql';
195
+            $handle = fopen($SETTINGS['path_to_files_folder'].'/'.$filename, 'w+');
196 196
             if ($handle !== false) {
197 197
                 //write file
198 198
                 fwrite($handle, $return);
@@ -204,17 +204,17 @@  discard block
 block discarded – undo
204 204
                 // Encrypt the file
205 205
                 prepareFileWithDefuse(
206 206
                     'encrypt',
207
-                    $SETTINGS['path_to_files_folder'] . '/' . $filename,
208
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
207
+                    $SETTINGS['path_to_files_folder'].'/'.$filename,
208
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
209 209
                     $SETTINGS,
210 210
                     $post_option
211 211
                 );
212 212
 
213 213
                 // Do clean
214
-                unlink($SETTINGS['path_to_files_folder'] . '/' . $filename);
214
+                unlink($SETTINGS['path_to_files_folder'].'/'.$filename);
215 215
                 rename(
216
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
217
-                    $SETTINGS['path_to_files_folder'] . '/' . $filename
216
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
217
+                    $SETTINGS['path_to_files_folder'].'/'.$filename
218 218
                 );
219 219
             }
220 220
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             //update LOG
225 225
             logEvents($SETTINGS, 'admin_action', 'dataBase backup', (string) $session->get('user-id'), $session->get('user-login'));
226 226
 
227
-            echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name=' . urlencode($filename) . '&sub=files&file=' . $filename . '&type=sql&key=' . $session->get('key') . '&key_tmp=' . $session->get('user-key_tmp') . '&pathIsFiles=1"}]';
227
+            echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name='.urlencode($filename).'&sub=files&file='.$filename.'&type=sql&key='.$session->get('key').'&key_tmp='.$session->get('user-key_tmp').'&pathIsFiles=1"}]';
228 228
         }
229 229
         break;
230 230
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
             );
254 254
             break;
255 255
         }
256
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
256
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
257 257
 
258 258
         $dataPost = explode('&', $post_option);
259 259
         $file = htmlspecialchars($dataPost[0]);
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         // Get filename from database
263 263
         $data = DB::queryFirstRow(
264 264
             'SELECT valeur
265
-            FROM ' . prefixTable('misc') . '
265
+            FROM ' . prefixTable('misc').'
266 266
             WHERE increment_id = %i',
267 267
             $file
268 268
         );
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
             // Decrypt the file
282 282
             $ret = prepareFileWithDefuse(
283 283
                 'decrypt',
284
-                $SETTINGS['path_to_files_folder'] . '/' . $file,
285
-                $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file,
284
+                $SETTINGS['path_to_files_folder'].'/'.$file,
285
+                $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file,
286 286
                 $SETTINGS,
287 287
                 $key
288 288
             );
@@ -294,10 +294,10 @@  discard block
 block discarded – undo
294 294
             }
295 295
 
296 296
             // Do clean
297
-            fileDelete($SETTINGS['path_to_files_folder'] . '/' . $file, $SETTINGS);
298
-            $file = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file;
297
+            fileDelete($SETTINGS['path_to_files_folder'].'/'.$file, $SETTINGS);
298
+            $file = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file;
299 299
         } else {
300
-            $file = $SETTINGS['path_to_files_folder'] . '/' . $file;
300
+            $file = $SETTINGS['path_to_files_folder'].'/'.$file;
301 301
         }
302 302
 
303 303
         //read sql file
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
         fclose($handle);
315 315
 
316 316
         //delete file
317
-        unlink($SETTINGS['path_to_files_folder'] . '/' . $file);
317
+        unlink($SETTINGS['path_to_files_folder'].'/'.$file);
318 318
 
319 319
         //Show done
320 320
         echo '[{"result":"db_restore" , "message":""}]';
@@ -352,8 +352,8 @@  discard block
 block discarded – undo
352 352
             foreach ($table as $i => $tablename) {
353 353
                 if (substr_count($tablename, DB_PREFIX) > 0) {
354 354
                     // launch optimization quieries
355
-                    DB::query('ANALYZE TABLE `' . $tablename . '`');
356
-                    DB::query('OPTIMIZE TABLE `' . $tablename . '`');
355
+                    DB::query('ANALYZE TABLE `'.$tablename.'`');
356
+                    DB::query('OPTIMIZE TABLE `'.$tablename.'`');
357 357
                 }
358 358
             }
359 359
         }
@@ -361,12 +361,12 @@  discard block
 block discarded – undo
361 361
         //Clean up LOG_ITEMS table
362 362
         $rows = DB::query(
363 363
             'SELECT id
364
-            FROM ' . prefixTable('items') . '
364
+            FROM ' . prefixTable('items').'
365 365
             ORDER BY id ASC'
366 366
         );
367 367
         foreach ($rows as $item) {
368 368
             DB::query(
369
-                'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s',
369
+                'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s',
370 370
                 $item['id'],
371 371
                 'at_creation'
372 372
             );
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
             if ($counter === 0) {
375 375
                 //Create new at_creation entry
376 376
                 $rowTmp = DB::queryFirstRow(
377
-                    'SELECT date, id_user FROM ' . prefixTable('log_items') . ' WHERE id_item=%i ORDER BY date ASC',
377
+                    'SELECT date, id_user FROM '.prefixTable('log_items').' WHERE id_item=%i ORDER BY date ASC',
378 378
                     $item['id']
379 379
                 );
380 380
                 DB::insert(
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
         echo prepareExchangedData(
405 405
             array(
406 406
                 'error' => false,
407
-                'message' => $lang->get('last_execution') . ' ' .
408
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
407
+                'message' => $lang->get('last_execution').' '.
408
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
409 409
                     '<i class="fas fa-check text-success ml-2"></i>',
410 410
             ),
411 411
             'encode'
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
             break;
442 442
         }
443 443
 
444
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
444
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
445 445
         updateCacheTable('reload', NULL);
446 446
 
447 447
         // Log
@@ -457,8 +457,8 @@  discard block
 block discarded – undo
457 457
         echo prepareExchangedData(
458 458
             [
459 459
                 'error' => false,
460
-                'message' => $lang->get('last_execution') . ' ' .
461
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
460
+                'message' => $lang->get('last_execution').' '.
461
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
462 462
                     '<i class="fas fa-check text-success mr-2"></i>',
463 463
             ],
464 464
             'encode'
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
         $session->set('user-reencrypt_old_salt', file_get_contents(SECUREPATH.'/'.SECUREFILE));
501 501
 
502 502
         // generate new saltkey
503
-        $old_sk_filename = SECUREPATH.'/'.SECUREFILE . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))) . '.' . time();
503
+        $old_sk_filename = SECUREPATH.'/'.SECUREFILE.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).'.'.time();
504 504
         copy(
505 505
             SECUREPATH.'/'.SECUREFILE,
506 506
             $old_sk_filename
@@ -529,13 +529,13 @@  discard block
 block discarded – undo
529 529
         logEvents($SETTINGS, 'system', 'change_salt_key', (string) $session->get('user-id'), $session->get('user-login'));
530 530
 
531 531
         // get number of items to change
532
-        DB::query('SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', 0);
532
+        DB::query('SELECT id FROM '.prefixTable('items').' WHERE perso = %i', 0);
533 533
         $nb_of_items = DB::count();
534 534
 
535 535
         // create backup table
536
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
536
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
537 537
         DB::query(
538
-            'CREATE TABLE `' . prefixTable('sk_reencrypt_backup') . '` (
538
+            'CREATE TABLE `'.prefixTable('sk_reencrypt_backup').'` (
539 539
             `id` int(12) NOT null AUTO_INCREMENT,
540 540
             `current_table` varchar(100) NOT NULL,
541 541
             `current_field` varchar(500) NOT NULL,
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
         );
564 564
 
565 565
         // delete previous backup files
566
-        $files = glob($SETTINGS['path_to_upload_folder'] . '/*'); // get all file names
566
+        $files = glob($SETTINGS['path_to_upload_folder'].'/*'); // get all file names
567 567
         foreach ($files as $file) { // iterate files
568 568
             if (is_file($file)) {
569 569
                 $file_parts = pathinfo($file);
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
                 echo prepareExchangedData(
646 646
                     array(
647 647
                         'error' => true,
648
-                        'message' => 'Input `' . $objects[0] . '` is not allowed',
648
+                        'message' => 'Input `'.$objects[0].'` is not allowed',
649 649
                         'nbOfItems' => '',
650 650
                         'nextAction' => '',
651 651
                     ),
@@ -658,9 +658,9 @@  discard block
 block discarded – undo
658 658
                 //change all encrypted data in Items (passwords)
659 659
                 $rows = DB::query(
660 660
                     'SELECT id, pw, pw_iv
661
-                    FROM ' . prefixTable('items') . '
661
+                    FROM ' . prefixTable('items').'
662 662
                     WHERE perso = %s
663
-                    LIMIT ' . $post_start . ', ' . $post_length,
663
+                    LIMIT ' . $post_start.', '.$post_length,
664 664
                     '0'
665 665
                 );
666 666
                 foreach ($rows as $record) {
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
                             'current_field' => 'pw',
673 673
                             'value_id' => $record['id'],
674 674
                             'value' => $record['pw'],
675
-                            'current_sql' => 'UPDATE ' . prefixTable('items') . " SET pw = '" . $record['pw'] . "' WHERE id = '" . $record['id'] . "';",
675
+                            'current_sql' => 'UPDATE '.prefixTable('items')." SET pw = '".$record['pw']."' WHERE id = '".$record['id']."';",
676 676
                             'value2' => 'none',
677 677
                             'result' => 'none',
678 678
                         )
@@ -721,9 +721,9 @@  discard block
 block discarded – undo
721 721
                 //change all encrypted data in Logs (passwords)
722 722
                 $rows = DB::query(
723 723
                     'SELECT raison, increment_id
724
-                    FROM ' . prefixTable('log_items') . "
724
+                    FROM ' . prefixTable('log_items')."
725 725
                     WHERE action = %s AND raison LIKE 'at_pw :%'
726
-                    LIMIT " . $post_start . ', ' . $post_length,
726
+                    LIMIT " . $post_start.', '.$post_length,
727 727
                     'at_modification'
728 728
                 );
729 729
                 foreach ($rows as $record) {
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
                             'current_field' => 'raison',
736 736
                             'value_id' => $record['increment_id'],
737 737
                             'value' => $record['raison'],
738
-                            'current_sql' => 'UPDATE ' . prefixTable('log_items') . " SET raison = '" . $record['raison'] . "' WHERE increment_id = '" . $record['increment_id'] . "';",
738
+                            'current_sql' => 'UPDATE '.prefixTable('log_items')." SET raison = '".$record['raison']."' WHERE increment_id = '".$record['increment_id']."';",
739 739
                             'value2' => 'none',
740 740
                             'result' => 'none',
741 741
                         )
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
                         DB::update(
764 764
                             prefixTable('log_items'),
765 765
                             array(
766
-                                'raison' => 'at_pw :' . $encrypt['string'],
766
+                                'raison' => 'at_pw :'.$encrypt['string'],
767 767
                                 'encryption_type' => 'defuse',
768 768
                             ),
769 769
                             'increment_id = %i',
@@ -788,8 +788,8 @@  discard block
 block discarded – undo
788 788
                 //change all encrypted data in CATEGORIES (passwords)
789 789
                 $rows = DB::query(
790 790
                     'SELECT id, data
791
-                    FROM ' . prefixTable('categories_items') . '
792
-                    LIMIT ' . $post_start . ', ' . $post_length
791
+                    FROM ' . prefixTable('categories_items').'
792
+                    LIMIT ' . $post_start.', '.$post_length
793 793
                 );
794 794
                 foreach ($rows as $record) {
795 795
                     // backup data
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
                             'current_field' => 'data',
801 801
                             'value_id' => $record['id'],
802 802
                             'value' => $record['data'],
803
-                            'current_sql' => 'UPDATE ' . prefixTable('categories_items') . " SET data = '" . $record['data'] . "' WHERE id = '" . $record['id'] . "';",
803
+                            'current_sql' => 'UPDATE '.prefixTable('categories_items')." SET data = '".$record['data']."' WHERE id = '".$record['id']."';",
804 804
                             'value2' => 'none',
805 805
                             'result' => 'none',
806 806
                         )
@@ -848,9 +848,9 @@  discard block
 block discarded – undo
848 848
                 // Change all encrypted data in FILES (passwords)
849 849
                 $rows = DB::query(
850 850
                     'SELECT id, file, status
851
-                    FROM ' . prefixTable('files') . "
851
+                    FROM ' . prefixTable('files')."
852 852
                     WHERE status = 'encrypted'
853
-                    LIMIT " . $post_start . ', ' . $post_length
853
+                    LIMIT " . $post_start.', '.$post_length
854 854
                 );
855 855
                 foreach ($rows as $record) {
856 856
                     // backup data
@@ -868,20 +868,20 @@  discard block
 block discarded – undo
868 868
                     );
869 869
                     $newID = DB::insertId();
870 870
 
871
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) {
871
+                    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
872 872
                         // make a copy of file
873 873
                         if (!copy(
874
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
875
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '.copy'
874
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
875
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'.copy'
876 876
                         )) {
877 877
                             $error = 'Copy not possible';
878 878
                             exit;
879 879
                         } else {
880 880
                             // prepare a bck of file (that will not be deleted)
881
-                            $backup_filename = $record['file'] . '.bck-change-sk.' . time();
881
+                            $backup_filename = $record['file'].'.bck-change-sk.'.time();
882 882
                             copy(
883
-                                $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
884
-                                $SETTINGS['path_to_upload_folder'] . '/' . $backup_filename
883
+                                $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
884
+                                $SETTINGS['path_to_upload_folder'].'/'.$backup_filename
885 885
                             );
886 886
                         }
887 887
 
@@ -889,24 +889,24 @@  discard block
 block discarded – undo
889 889
                         // STEP1 - Do decryption
890 890
                         prepareFileWithDefuse(
891 891
                             'decrypt',
892
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
893
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted',
892
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
893
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted',
894 894
                             $SETTINGS
895 895
                         );
896 896
 
897 897
                         // Do cleanup of files
898
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file']);
898
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file']);
899 899
 
900 900
                         // STEP2 - Do encryption
901 901
                         prepareFileWithDefuse(
902 902
                             'encryp',
903
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted',
904
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
903
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted',
904
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
905 905
                             $SETTINGS
906 906
                         );
907 907
 
908 908
                         // Do cleanup of files
909
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted');
909
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted');
910 910
 
911 911
                         // Update backup table
912 912
                         DB::update(
@@ -932,13 +932,13 @@  discard block
 block discarded – undo
932 932
                 // do some things for new object
933 933
                 if (isset($objects[0])) {
934 934
                     if ($objects[0] === 'logs') {
935
-                        DB::query('SELECT increment_id FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
935
+                        DB::query('SELECT increment_id FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
936 936
                     } elseif ($objects[0] === 'files') {
937
-                        DB::query('SELECT id FROM ' . prefixTable('files'));
937
+                        DB::query('SELECT id FROM '.prefixTable('files'));
938 938
                     } elseif ($objects[0] === 'categories') {
939
-                        DB::query('SELECT id FROM ' . prefixTable('categories_items'));
939
+                        DB::query('SELECT id FROM '.prefixTable('categories_items'));
940 940
                     } elseif ($objects[0] === 'custfields') {
941
-                        DB::query('SELECT raison FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
941
+                        DB::query('SELECT raison FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
942 942
                     }
943 943
                     $nb_of_items = DB::count();
944 944
                 } else {
@@ -1058,12 +1058,12 @@  discard block
 block discarded – undo
1058 1058
                 );
1059 1059
             } elseif ($record['current_table'] === 'files') {
1060 1060
                 // restore backup file
1061
-                if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value'])) {
1062
-                    unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value']);
1063
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) {
1061
+                if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value'])) {
1062
+                    unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value']);
1063
+                    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) {
1064 1064
                         rename(
1065
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['value2'],
1066
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['value']
1065
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['value2'],
1066
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['value']
1067 1067
                         );
1068 1068
                     }
1069 1069
                 }
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
         }
1083 1083
 
1084 1084
         // drop table
1085
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1085
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1086 1086
 
1087 1087
         // Send back
1088 1088
         echo prepareExchangedData(
@@ -1125,17 +1125,17 @@  discard block
 block discarded – undo
1125 1125
         // delete files
1126 1126
         $rows = DB::query(
1127 1127
             'SELECT value, value2
1128
-            FROM ' . prefixTable('sk_reencrypt_backup') . "
1128
+            FROM ' . prefixTable('sk_reencrypt_backup')."
1129 1129
             WHERE current_table = 'files'"
1130 1130
         );
1131 1131
         foreach ($rows as $record) {
1132
-            if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) {
1133
-                unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value2']);
1132
+            if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) {
1133
+                unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value2']);
1134 1134
             }
1135 1135
         }
1136 1136
 
1137 1137
         // drop table
1138
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1138
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1139 1139
 
1140 1140
         echo '[{"status":"done"}]';
1141 1141
         break;
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
                 'encode'
1167 1167
             );
1168 1168
         } else {
1169
-            require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1169
+            require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1170 1170
 
1171 1171
             //send email
1172 1172
             $emailSettings = new EmailSettings($SETTINGS);
@@ -1204,13 +1204,13 @@  discard block
 block discarded – undo
1204 1204
             break;
1205 1205
         }
1206 1206
 
1207
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1207
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1208 1208
         $emailSettings = new EmailSettings($SETTINGS);
1209 1209
         $emailService = new EmailService();
1210 1210
 
1211 1211
         $rows = DB::query(
1212 1212
             'SELECT *
1213
-            FROM ' . prefixTable('emails') . '
1213
+            FROM ' . prefixTable('emails').'
1214 1214
             WHERE status = %s OR status = %s',
1215 1215
             'not_sent',
1216 1216
             ''
@@ -1296,13 +1296,13 @@  discard block
 block discarded – undo
1296 1296
             break;
1297 1297
         }
1298 1298
 
1299
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1299
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1300 1300
 
1301 1301
         // Instatiate email settings and service
1302 1302
         $emailSettings = new EmailSettings($SETTINGS);
1303 1303
         $emailService = new EmailService();
1304 1304
 
1305
-        $rows = DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', '');
1305
+        $rows = DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', '');
1306 1306
         foreach ($rows as $record) {
1307 1307
             //send email
1308 1308
             $email = $emailService->sendMail(
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
             break;
1372 1372
         }
1373 1373
 
1374
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1374
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1375 1375
 
1376 1376
         // init
1377 1377
         $filesList = array();
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
                 FROM ' . prefixTable('files')
1385 1385
             );
1386 1386
             foreach ($rows as $record) {
1387
-                if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) {
1387
+                if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
1388 1388
                     $addFile = false;
1389 1389
                     if (($post_option === 'attachments-decrypt' && $record['status'] === 'encrypted')
1390 1390
                         || ($post_option === 'attachments-encrypt' && $record['status'] === 'clear')
@@ -1449,8 +1449,8 @@  discard block
 block discarded – undo
1449 1449
         $post_list = filter_var_array($post_list, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
1450 1450
         $post_counter = filter_var($post_counter, FILTER_SANITIZE_NUMBER_INT);
1451 1451
 
1452
-        include $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1453
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1452
+        include $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1453
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1454 1454
 
1455 1455
         $cpt = 0;
1456 1456
         $continu = true;
@@ -1463,35 +1463,35 @@  discard block
 block discarded – undo
1463 1463
                 // Get file name
1464 1464
                 $file_info = DB::queryfirstrow(
1465 1465
                     'SELECT file
1466
-                    FROM ' . prefixTable('files') . '
1466
+                    FROM ' . prefixTable('files').'
1467 1467
                     WHERE id = %i',
1468 1468
                     $file
1469 1469
                 );
1470 1470
 
1471 1471
                 // skip file is Coherancey not respected
1472
-                if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'])) {
1472
+                if (is_file($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'])) {
1473 1473
                     // Case where we want to decrypt
1474 1474
                     if ($post_option === 'decrypt') {
1475 1475
                         prepareFileWithDefuse(
1476 1476
                             'decrypt',
1477
-                            $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'],
1478
-                            $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1477
+                            $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'],
1478
+                            $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1479 1479
                             $SETTINGS
1480 1480
                         );
1481 1481
                         // Case where we want to encrypt
1482 1482
                     } elseif ($post_option === 'encrypt') {
1483 1483
                         prepareFileWithDefuse(
1484 1484
                             'encrypt',
1485
-                            $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'],
1486
-                            $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1485
+                            $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'],
1486
+                            $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1487 1487
                             $SETTINGS
1488 1488
                         );
1489 1489
                     }
1490 1490
                     // Do file cleanup
1491
-                    fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], $SETTINGS);
1491
+                    fileDelete($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], $SETTINGS);
1492 1492
                     rename(
1493
-                        $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1494
-                        $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file']
1493
+                        $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1494
+                        $SETTINGS['path_to_upload_folder'].'/'.$file_info['file']
1495 1495
                     );
1496 1496
 
1497 1497
                     // store in DB
@@ -1526,8 +1526,8 @@  discard block
 block discarded – undo
1526 1526
                 $post_option === 'attachments-decrypt' ? 'clear' : 'encrypted'
1527 1527
             );
1528 1528
 
1529
-            $message = $lang->get('last_execution') . ' ' .
1530
-                date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
1529
+            $message = $lang->get('last_execution').' '.
1530
+                date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
1531 1531
                 '<i class="fas fa-check text-success ml-2 mr-3"></i>';
1532 1532
         }
1533 1533
 
@@ -1621,7 +1621,7 @@  discard block
 block discarded – undo
1621 1621
             $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_NUMBER_INT);
1622 1622
 
1623 1623
             DB::query(
1624
-                'DELETE FROM ' . prefixTable('api') . ' WHERE increment_id = %i',
1624
+                'DELETE FROM '.prefixTable('api').' WHERE increment_id = %i',
1625 1625
                 $post_id
1626 1626
             );
1627 1627
         }
@@ -1716,7 +1716,7 @@  discard block
 block discarded – undo
1716 1716
             // Delete existing key
1717 1717
         } elseif (null !== $post_action && $post_action === 'delete') {
1718 1718
             $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
1719
-            DB::query('DELETE FROM ' . prefixTable('api') . ' WHERE increment_id=%i', $post_id);
1719
+            DB::query('DELETE FROM '.prefixTable('api').' WHERE increment_id=%i', $post_id);
1720 1720
         }
1721 1721
 
1722 1722
         echo prepareExchangedData(
@@ -1731,7 +1731,7 @@  discard block
 block discarded – undo
1731 1731
 
1732 1732
     case 'save_api_status':
1733 1733
         // Do query
1734
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'api');
1734
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'api');
1735 1735
         $counter = DB::count();
1736 1736
         if ($counter === 0) {
1737 1737
             DB::insert(
@@ -1760,7 +1760,7 @@  discard block
 block discarded – undo
1760 1760
 
1761 1761
     case 'run_duo_config_check':
1762 1762
         //Libraries call
1763
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1763
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1764 1764
         // Check KEY
1765 1765
         if ($post_key !== $session->get('key')) {
1766 1766
             echo prepareExchangedData(
@@ -1871,7 +1871,7 @@  discard block
 block discarded – undo
1871 1871
         } else {
1872 1872
             $tmp = 1;
1873 1873
         }
1874
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication');
1874
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication');
1875 1875
         $counter = DB::count();
1876 1876
         if ($counter === 0) {
1877 1877
             DB::insert(
@@ -1899,7 +1899,7 @@  discard block
 block discarded – undo
1899 1899
 
1900 1900
         // ga_website_name
1901 1901
         if (is_null($dataReceived['ga_website_name']) === false) {
1902
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name');
1902
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name');
1903 1903
             $counter = DB::count();
1904 1904
             if ($counter === 0) {
1905 1905
                 DB::insert(
@@ -1932,7 +1932,7 @@  discard block
 block discarded – undo
1932 1932
         }
1933 1933
 
1934 1934
         // send data
1935
-        echo '[{"result" : "' . addslashes($LANG['done']) . '" , "error" : ""}]';
1935
+        echo '[{"result" : "'.addslashes($LANG['done']).'" , "error" : ""}]';
1936 1936
         break;
1937 1937
 
1938 1938
     case 'save_agses_options':
@@ -1955,7 +1955,7 @@  discard block
 block discarded – undo
1955 1955
 
1956 1956
         // agses_hosted_url
1957 1957
         if (!is_null($dataReceived['agses_hosted_url'])) {
1958
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url');
1958
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url');
1959 1959
             $counter = DB::count();
1960 1960
             if ($counter === 0) {
1961 1961
                 DB::insert(
@@ -1986,7 +1986,7 @@  discard block
 block discarded – undo
1986 1986
 
1987 1987
         // agses_hosted_id
1988 1988
         if (!is_null($dataReceived['agses_hosted_id'])) {
1989
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id');
1989
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id');
1990 1990
             $counter = DB::count();
1991 1991
             if ($counter === 0) {
1992 1992
                 DB::insert(
@@ -2017,7 +2017,7 @@  discard block
 block discarded – undo
2017 2017
 
2018 2018
         // agses_hosted_apikey
2019 2019
         if (!is_null($dataReceived['agses_hosted_apikey'])) {
2020
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey');
2020
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey');
2021 2021
             $counter = DB::count();
2022 2022
             if ($counter === 0) {
2023 2023
                 DB::insert(
@@ -2047,7 +2047,7 @@  discard block
 block discarded – undo
2047 2047
         }
2048 2048
 
2049 2049
         // send data
2050
-        echo '[{"result" : "' . addslashes($LANG['done']) . '" , "error" : ""}]';
2050
+        echo '[{"result" : "'.addslashes($LANG['done']).'" , "error" : ""}]';
2051 2051
         break;
2052 2052
 
2053 2053
     case 'save_option_change':
@@ -2087,7 +2087,7 @@  discard block
 block discarded – undo
2087 2087
 
2088 2088
         // Check if setting is already in DB. If NO then insert, if YES then update.
2089 2089
         $data = DB::query(
2090
-            'SELECT * FROM ' . prefixTable('misc') . '
2090
+            'SELECT * FROM '.prefixTable('misc').'
2091 2091
             WHERE type = %s AND intitule = %s',
2092 2092
             'admin',
2093 2093
             $post_field
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
                     array(
2111 2111
                         'valeur' => time(),
2112 2112
                         'type' => 'admin',
2113
-                        'intitule' => $post_field . '_time',
2113
+                        'intitule' => $post_field.'_time',
2114 2114
                         'updated_at' => time(),
2115 2115
                     )
2116 2116
                 );
@@ -2130,10 +2130,10 @@  discard block
 block discarded – undo
2130 2130
             if ($post_field === 'send_stats') {
2131 2131
                 // Check if previous time exists, if not them insert this value in DB
2132 2132
                 DB::query(
2133
-                    'SELECT * FROM ' . prefixTable('misc') . '
2133
+                    'SELECT * FROM '.prefixTable('misc').'
2134 2134
                     WHERE type = %s AND intitule = %s',
2135 2135
                     'admin',
2136
-                    $post_field . '_time'
2136
+                    $post_field.'_time'
2137 2137
                 );
2138 2138
                 $counter = DB::count();
2139 2139
                 if ($counter === 0) {
@@ -2142,7 +2142,7 @@  discard block
 block discarded – undo
2142 2142
                         array(
2143 2143
                             'valeur' => 0,
2144 2144
                             'type' => 'admin',
2145
-                            'intitule' => $post_field . '_time',
2145
+                            'intitule' => $post_field.'_time',
2146 2146
                             'created_at' => time(),
2147 2147
                         )
2148 2148
                     );
@@ -2164,13 +2164,13 @@  discard block
 block discarded – undo
2164 2164
         // special Cases
2165 2165
         if ($post_field === 'cpassman_url') {
2166 2166
             // update also jsUrl for CSFP protection
2167
-            $jsUrl = $post_value . '/includes/libraries/csrfp/js/csrfprotector.js';
2167
+            $jsUrl = $post_value.'/includes/libraries/csrfp/js/csrfprotector.js';
2168 2168
             $csrfp_file = '../includes/libraries/csrfp/libs/csrfp.config.php';
2169 2169
             $data = file_get_contents($csrfp_file);
2170 2170
             $posJsUrl = strpos($data, '"jsUrl" => "');
2171 2171
             $posEndLine = strpos($data, '",', $posJsUrl);
2172 2172
             $line = substr($data, $posJsUrl, ($posEndLine - $posJsUrl + 2));
2173
-            $newdata = str_replace($line, '"jsUrl" => "' . filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . '",', $data);
2173
+            $newdata = str_replace($line, '"jsUrl" => "'.filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS).'",', $data);
2174 2174
             file_put_contents($csrfp_file, $newdata);
2175 2175
         } elseif ($post_field === 'restricted_to_input' && (int) $post_value === 0) {
2176 2176
             DB::update(
@@ -2205,7 +2205,7 @@  discard block
 block discarded – undo
2205 2205
         echo prepareExchangedData(
2206 2206
             array(
2207 2207
                 'error' => false,
2208
-                'misc' => $counter . ' ; ' . $SETTINGS[$post_field],
2208
+                'misc' => $counter.' ; '.$SETTINGS[$post_field],
2209 2209
                 'message' => empty($post_translate) === false ? $lang->get($post_translate) : '',
2210 2210
             ),
2211 2211
             'encode'
@@ -2248,7 +2248,7 @@  discard block
 block discarded – undo
2248 2248
 
2249 2249
         // send statistics
2250 2250
         if (null !== $post_status) {
2251
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_stats');
2251
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_stats');
2252 2252
             $counter = DB::count();
2253 2253
             if ($counter === 0) {
2254 2254
                 DB::insert(
@@ -2282,7 +2282,7 @@  discard block
 block discarded – undo
2282 2282
 
2283 2283
         // send statistics items
2284 2284
         if (null !== $post_list) {
2285
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items');
2285
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items');
2286 2286
             $counter = DB::count();
2287 2287
             if ($counter === 0) {
2288 2288
                 DB::insert(
@@ -2331,7 +2331,7 @@  discard block
 block discarded – undo
2331 2331
             break;
2332 2332
         }
2333 2333
 
2334
-        if (DB::query("SHOW TABLES LIKE '" . prefixTable('sk_reencrypt_backup') . "'")) {
2334
+        if (DB::query("SHOW TABLES LIKE '".prefixTable('sk_reencrypt_backup')."'")) {
2335 2335
             if (DB::count() === 1) {
2336 2336
                 echo 1;
2337 2337
             } else {
@@ -2369,7 +2369,7 @@  discard block
 block discarded – undo
2369 2369
 
2370 2370
         $rows = DB::query(
2371 2371
             'SELECT id, title
2372
-                FROM ' . prefixTable('roles_title') . '
2372
+                FROM ' . prefixTable('roles_title').'
2373 2373
                 ORDER BY title ASC'
2374 2374
         );
2375 2375
         foreach ($rows as $record) {
@@ -2485,7 +2485,7 @@  discard block
 block discarded – undo
2485 2485
 function tablesIntegrityCheck(): array
2486 2486
 {
2487 2487
     // Get integrity tables file
2488
-    $integrityTablesFile = TEAMPASS_ROOT_PATH . '/includes/tables_integrity.json';
2488
+    $integrityTablesFile = TEAMPASS_ROOT_PATH.'/includes/tables_integrity.json';
2489 2489
     if (file_exists($integrityTablesFile) === false) {
2490 2490
         return [
2491 2491
             'error' => true,
@@ -2503,7 +2503,7 @@  discard block
 block discarded – undo
2503 2503
     // Get all tables
2504 2504
     $tables = [];
2505 2505
     foreach (DB::queryFirstColumn("SHOW TABLES") as $table) {
2506
-        $tables[] = str_replace(DB_PREFIX, "", $table);;
2506
+        $tables[] = str_replace(DB_PREFIX, "", $table); ;
2507 2507
     }
2508 2508
     // Prepare the integrity check
2509 2509
     $tablesInError = [];
Please login to merge, or discard this patch.
sources/main.queries.php 1 patch
Spacing   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 ) {
82 82
     // Not allowed page
83 83
     $session->set('system-error_code', ERR_NOT_ALLOWED);
84
-    include $SETTINGS['cpassman_dir'] . '/error.php';
84
+    include $SETTINGS['cpassman_dir'].'/error.php';
85 85
     exit;
86 86
 }
87 87
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
  * @param string $post_key
306 306
  * @return string
307 307
  */
308
-function userHandler(string $post_type, array|null|string $dataReceived, array $SETTINGS, string $post_key): string
308
+function userHandler(string $post_type, array | null | string $dataReceived, array $SETTINGS, string $post_key): string
309 309
 {
310 310
     $session = SessionManager::getSession();
311 311
 
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
  * @param array $SETTINGS
599 599
  * @return string
600 600
  */
601
-function systemHandler(string $post_type, array|null|string $dataReceived, array $SETTINGS): string
601
+function systemHandler(string $post_type, array | null | string $dataReceived, array $SETTINGS): string
602 602
 {
603 603
     $session = SessionManager::getSession();
604 604
     switch ($post_type) {
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
                 )
702 702
             );
703 703
 
704
-            return '[{"token" : "' . $token . '"}]';
704
+            return '[{"token" : "'.$token.'"}]';
705 705
 
706 706
         /*
707 707
         * Default case
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 }
718 718
 
719 719
 
720
-function utilsHandler(string $post_type, array|null|string $dataReceived, array $SETTINGS): string
720
+function utilsHandler(string $post_type, array | null | string $dataReceived, array $SETTINGS): string
721 721
 {
722 722
     switch ($post_type) {
723 723
         /*
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
         array(
787 787
             'error' => false,
788 788
             'timestamp' => $session->get('user-session_duration'),
789
-            'max_time_to_add' => intdiv((($maximum_session_expiration_time*60) - ((int) $session->get('user-session_duration') - time())), 60),
789
+            'max_time_to_add' => intdiv((($maximum_session_expiration_time * 60) - ((int) $session->get('user-session_duration') - time())), 60),
790 790
             'max_session_duration' => $maximum_session_expiration_time,
791 791
         ),
792 792
         'encode'
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
     // get number of items
839 839
     DB::queryFirstRow(
840 840
         'SELECT increment_id
841
-        FROM ' . prefixTable('sharekeys_items') .
841
+        FROM ' . prefixTable('sharekeys_items').
842 842
         ' WHERE user_id = %i',
843 843
         $userId
844 844
     );
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
         // check if expected security level is reached
894 894
         $dataUser = DB::queryfirstrow(
895 895
             'SELECT *
896
-            FROM ' . prefixTable('users') . ' WHERE id = %i',
896
+            FROM ' . prefixTable('users').' WHERE id = %i',
897 897
             $post_user_id
898 898
         );
899 899
 
@@ -914,8 +914,8 @@  discard block
 block discarded – undo
914 914
         if (empty($dataUser['fonction_id']) === false) {
915 915
             $data = DB::queryFirstRow(
916 916
                 'SELECT complexity
917
-                FROM ' . prefixTable('roles_title') . '
918
-                WHERE id IN (' . $dataUser['fonction_id'] . ')
917
+                FROM ' . prefixTable('roles_title').'
918
+                WHERE id IN (' . $dataUser['fonction_id'].')
919 919
                 ORDER BY complexity DESC'
920 920
             );
921 921
         } else {
@@ -928,8 +928,8 @@  discard block
 block discarded – undo
928 928
             return prepareExchangedData(
929 929
                 array(
930 930
                     'error' => true,
931
-                    'message' => '<div style="margin:10px 0 10px 15px;">' . $lang->get('complexity_level_not_reached') . '.<br>' .
932
-                        $lang->get('expected_complexity_level') . ': <b>' . TP_PW_COMPLEXITY[$data['complexity']][1] . '</b></div>',
931
+                    'message' => '<div style="margin:10px 0 10px 15px;">'.$lang->get('complexity_level_not_reached').'.<br>'.
932
+                        $lang->get('expected_complexity_level').': <b>'.TP_PW_COMPLEXITY[$data['complexity']][1].'</b></div>',
933 933
                 ),
934 934
                 'encode'
935 935
             );
@@ -1033,14 +1033,14 @@  discard block
 block discarded – undo
1033 1033
         // Get data about user
1034 1034
         $dataUser = DB::queryfirstrow(
1035 1035
             'SELECT id, email, pw
1036
-            FROM ' . prefixTable('users') . '
1036
+            FROM ' . prefixTable('users').'
1037 1037
             WHERE login = %s',
1038 1038
             $post_login
1039 1039
         );
1040 1040
     } else {
1041 1041
         $dataUser = DB::queryfirstrow(
1042 1042
             'SELECT id, login, email, pw
1043
-            FROM ' . prefixTable('users') . '
1043
+            FROM ' . prefixTable('users').'
1044 1044
             WHERE id = %i',
1045 1045
             $post_id
1046 1046
         );
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
     // Check if token already used
1095 1095
     $dataToken = DB::queryfirstrow(
1096 1096
         'SELECT end_timestamp, reason
1097
-        FROM ' . prefixTable('tokens') . '
1097
+        FROM ' . prefixTable('tokens').'
1098 1098
         WHERE token = %s AND user_id = %i',
1099 1099
         $post_token,
1100 1100
         $dataUser['id']
@@ -1105,11 +1105,11 @@  discard block
 block discarded – undo
1105 1105
         return prepareExchangedData(
1106 1106
             array(
1107 1107
                 'error' => true,
1108
-                'message' => 'TOKEN already used',//$lang->get('no_email_set'),
1108
+                'message' => 'TOKEN already used', //$lang->get('no_email_set'),
1109 1109
             ),
1110 1110
             'encode'
1111 1111
         );
1112
-    } elseif(DB::count() === 0) {
1112
+    } elseif (DB::count() === 0) {
1113 1113
         // Store token for this action
1114 1114
         DB::insert(
1115 1115
             prefixTable('tokens'),
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
                 'email' => $dataUser['email'],
1172 1172
                 'email_result' => str_replace(
1173 1173
                     '#email#',
1174
-                    '<b>' . obfuscateEmail($dataUser['email']) . '</b>',
1174
+                    '<b>'.obfuscateEmail($dataUser['email']).'</b>',
1175 1175
                     addslashes($lang->get('admin_email_result_ok'))
1176 1176
                 ),
1177 1177
             ),
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
             'email' => $dataUser['email'],
1188 1188
             'email_result' => str_replace(
1189 1189
                 '#email#',
1190
-                '<b>' . obfuscateEmail($dataUser['email']) . '</b>',
1190
+                '<b>'.obfuscateEmail($dataUser['email']).'</b>',
1191 1191
                 addslashes($lang->get('admin_email_result_ok'))
1192 1192
             ),
1193 1193
         ),
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 
1205 1205
     if (isKeyExistingAndEqual('enable_send_email_on_user_login', 1, $SETTINGS) === true) {
1206 1206
         $row = DB::queryFirstRow(
1207
-            'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s',
1207
+            'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s',
1208 1208
             'cron',
1209 1209
             'sending_emails'
1210 1210
         );
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
         if ((int) (time() - $row['valeur']) >= 300 || (int) $row['valeur'] === 0) {
1213 1213
             $rows = DB::query(
1214 1214
                 'SELECT *
1215
-                FROM ' . prefixTable('emails') .
1215
+                FROM ' . prefixTable('emails').
1216 1216
                 ' WHERE status != %s',
1217 1217
                 'sent'
1218 1218
             );
@@ -1264,8 +1264,8 @@  discard block
 block discarded – undo
1264 1264
     $arr_html = array();
1265 1265
     $rows = DB::query(
1266 1266
         'SELECT i.id AS id, i.label AS label, i.id_tree AS id_tree, l.date, i.perso AS perso, i.restricted_to AS restricted
1267
-        FROM ' . prefixTable('log_items') . ' AS l
1268
-        RIGHT JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id)
1267
+        FROM ' . prefixTable('log_items').' AS l
1268
+        RIGHT JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id)
1269 1269
         WHERE l.action = %s AND l.id_user = %i
1270 1270
         ORDER BY l.date DESC
1271 1271
         LIMIT 0, 100',
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
     if (isKeyExistingAndEqual('enable_suggestion', 1, $SETTINGS) === true
1298 1298
         && ((int) $session->get('user-admin') === 1 || (int) $session->get('user-manager') === 1)
1299 1299
     ) {
1300
-        DB::query('SELECT * FROM ' . prefixTable('suggestion'));
1300
+        DB::query('SELECT * FROM '.prefixTable('suggestion'));
1301 1301
         $nb_suggestions_waiting = DB::count();
1302 1302
     }
1303 1303
 
@@ -1332,13 +1332,13 @@  discard block
 block discarded – undo
1332 1332
             if ($data === 'stat_languages') {
1333 1333
                 $tmp = '';
1334 1334
                 foreach ($stats_data[$data] as $key => $value) {
1335
-                    $tmp .= $tmp === '' ? $key . '-' . $value : ',' . $key . '-' . $value;
1335
+                    $tmp .= $tmp === '' ? $key.'-'.$value : ','.$key.'-'.$value;
1336 1336
                 }
1337 1337
                 $statsToSend[$data] = $tmp;
1338 1338
             } elseif ($data === 'stat_country') {
1339 1339
                 $tmp = '';
1340 1340
                 foreach ($stats_data[$data] as $key => $value) {
1341
-                    $tmp .= $tmp === '' ? $key . '-' . $value : ',' . $key . '-' . $value;
1341
+                    $tmp .= $tmp === '' ? $key.'-'.$value : ','.$key.'-'.$value;
1342 1342
                 }
1343 1343
                 $statsToSend[$data] = $tmp;
1344 1344
             } else {
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
             $url_found = $value;
1433 1433
             if (empty($url_found) === false) {
1434 1434
                 $tmp = parse_url($url_found);
1435
-                $anonym_url = $tmp['scheme'] . '://<anonym_url>' . (isset($tmp['path']) === true ? $tmp['path'] : '');
1435
+                $anonym_url = $tmp['scheme'].'://<anonym_url>'.(isset($tmp['path']) === true ? $tmp['path'] : '');
1436 1436
                 $value = $anonym_url;
1437 1437
             } else {
1438 1438
                 $value = '';
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
     $teampass_errors = '';
1463 1463
     $rows = DB::query(
1464 1464
         'SELECT label, date AS error_date
1465
-        FROM ' . prefixTable('log_system') . "
1465
+        FROM ' . prefixTable('log_system')."
1466 1466
         WHERE `type` LIKE 'error'
1467 1467
         ORDER BY `date` DESC
1468 1468
         LIMIT 0, 10"
@@ -1470,9 +1470,9 @@  discard block
 block discarded – undo
1470 1470
     if (DB::count() > 0) {
1471 1471
         foreach ($rows as $record) {
1472 1472
             if (empty($teampass_errors) === true) {
1473
-                $teampass_errors = ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label'];
1473
+                $teampass_errors = ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label'];
1474 1474
             } else {
1475
-                $teampass_errors .= ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label'];
1475
+                $teampass_errors .= ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label'];
1476 1476
             }
1477 1477
         }
1478 1478
     }
@@ -1481,7 +1481,7 @@  discard block
 block discarded – undo
1481 1481
 
1482 1482
     // Now prepare text
1483 1483
     $txt = '### Page on which it happened
1484
-' . $data['current_page'] . '
1484
+' . $data['current_page'].'
1485 1485
 
1486 1486
 ### Steps to reproduce
1487 1487
 1.
@@ -1496,39 +1496,39 @@  discard block
 block discarded – undo
1496 1496
 Tell us what happens instead
1497 1497
 
1498 1498
 ### Server configuration
1499
-**Operating system**: ' . php_uname() . '
1499
+**Operating system**: ' . php_uname().'
1500 1500
 
1501
-**Web server:** ' . $_SERVER['SERVER_SOFTWARE'] . '
1501
+**Web server:** ' . $_SERVER['SERVER_SOFTWARE'].'
1502 1502
 
1503
-**Database:** ' . ($link === false ? $lang->get('undefined') : mysqli_get_server_info($link)) . '
1503
+**Database:** ' . ($link === false ? $lang->get('undefined') : mysqli_get_server_info($link)).'
1504 1504
 
1505
-**PHP version:** ' . PHP_VERSION . '
1505
+**PHP version:** ' . PHP_VERSION.'
1506 1506
 
1507
-**Teampass version:** ' . TP_VERSION . '
1507
+**Teampass version:** ' . TP_VERSION.'
1508 1508
 
1509 1509
 **Teampass configuration file:**
1510 1510
 ```
1511
-' . $list_of_options . '
1511
+' . $list_of_options.'
1512 1512
 ```
1513 1513
 
1514 1514
 **Updated from an older Teampass or fresh install:**
1515 1515
 
1516 1516
 ### Client configuration
1517 1517
 
1518
-**Browser:** ' . $data['browser_name'] . ' - ' . $data['browser_version'] . '
1518
+**Browser:** ' . $data['browser_name'].' - '.$data['browser_version'].'
1519 1519
 
1520
-**Operating system:** ' . $data['os'] . ' - ' . $data['os_archi'] . 'bits
1520
+**Operating system:** ' . $data['os'].' - '.$data['os_archi'].'bits
1521 1521
 
1522 1522
 ### Logs
1523 1523
 
1524 1524
 #### Web server error log
1525 1525
 ```
1526
-' . $err['message'] . ' - ' . $err['file'] . ' (' . $err['line'] . ')
1526
+' . $err['message'].' - '.$err['file'].' ('.$err['line'].')
1527 1527
 ```
1528 1528
 
1529 1529
 #### Teampass 10 last system errors
1530 1530
 ```
1531
-' . $teampass_errors . '
1531
+' . $teampass_errors.'
1532 1532
 ```
1533 1533
 
1534 1534
 #### Log from the web-browser developer console (CTRL + SHIFT + i)
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
         // Check if user exists
1569 1569
         $userInfo = DB::queryFirstRow(
1570 1570
             'SELECT public_key, private_key, pw, auth_type
1571
-            FROM ' . prefixTable('users') . '
1571
+            FROM ' . prefixTable('users').'
1572 1572
             WHERE id = %i',
1573 1573
             $post_user_id
1574 1574
         );
@@ -1577,9 +1577,9 @@  discard block
 block discarded – undo
1577 1577
             // Get one item
1578 1578
             $currentUserKey = DB::queryFirstRow(
1579 1579
                 'SELECT object_id, share_key, increment_id
1580
-                FROM ' . prefixTable('sharekeys_items') . ' AS si
1581
-                INNER JOIN ' . prefixTable('items') . ' AS i ON  (i.id = si.object_id)
1582
-                INNER JOIN ' . prefixTable('nested_tree') . ' AS nt ON  (i.id_tree = nt.id)
1580
+                FROM ' . prefixTable('sharekeys_items').' AS si
1581
+                INNER JOIN ' . prefixTable('items').' AS i ON  (i.id = si.object_id)
1582
+                INNER JOIN ' . prefixTable('nested_tree').' AS nt ON  (i.id_tree = nt.id)
1583 1583
                 WHERE user_id = %i AND nt.personal_folder = %i',
1584 1584
                 $post_user_id,
1585 1585
                 0
@@ -1677,7 +1677,7 @@  discard block
 block discarded – undo
1677 1677
         // Get user info
1678 1678
         $userData = DB::queryFirstRow(
1679 1679
             'SELECT private_key
1680
-            FROM ' . prefixTable('users') . '
1680
+            FROM ' . prefixTable('users').'
1681 1681
             WHERE id = %i',
1682 1682
             $post_user_id
1683 1683
         );
@@ -1756,7 +1756,7 @@  discard block
 block discarded – undo
1756 1756
         // Get user info
1757 1757
         $userData = DB::queryFirstRow(
1758 1758
             'SELECT email, auth_type, login
1759
-            FROM ' . prefixTable('users') . '
1759
+            FROM ' . prefixTable('users').'
1760 1760
             WHERE id = %i',
1761 1761
             $post_user_id
1762 1762
         );
@@ -1854,7 +1854,7 @@  discard block
 block discarded – undo
1854 1854
         // Get user info
1855 1855
         $userData = DB::queryFirstRow(
1856 1856
             'SELECT email, auth_type, login
1857
-            FROM ' . prefixTable('users') . '
1857
+            FROM ' . prefixTable('users').'
1858 1858
             WHERE id = %i',
1859 1859
             $post_user_id
1860 1860
         );
@@ -1920,7 +1920,7 @@  discard block
 block discarded – undo
1920 1920
         // Check if user exists
1921 1921
         DB::queryFirstRow(
1922 1922
             'SELECT *
1923
-            FROM ' . prefixTable('users') . '
1923
+            FROM ' . prefixTable('users').'
1924 1924
             WHERE id = %i',
1925 1925
             $post_user_id
1926 1926
         );
@@ -1990,7 +1990,7 @@  discard block
 block discarded – undo
1990 1990
         // Check if user exists
1991 1991
         $userInfo = DB::queryFirstRow(
1992 1992
             'SELECT public_key
1993
-            FROM ' . prefixTable('users') . '
1993
+            FROM ' . prefixTable('users').'
1994 1994
             WHERE id = %i',
1995 1995
             $post_user_id
1996 1996
         );
@@ -2138,15 +2138,15 @@  discard block
 block discarded – undo
2138 2138
     // Loop on items
2139 2139
     $rows = DB::query(
2140 2140
         'SELECT id, pw
2141
-        FROM ' . prefixTable('items') . '
2141
+        FROM ' . prefixTable('items').'
2142 2142
         WHERE perso = 0
2143
-        LIMIT ' . $post_start . ', ' . $post_length
2143
+        LIMIT ' . $post_start.', '.$post_length
2144 2144
     );
2145 2145
     foreach ($rows as $record) {
2146 2146
         // Get itemKey from current user
2147 2147
         $currentUserKey = DB::queryFirstRow(
2148 2148
             'SELECT share_key, increment_id
2149
-            FROM ' . prefixTable('sharekeys_items') . '
2149
+            FROM ' . prefixTable('sharekeys_items').'
2150 2150
             WHERE object_id = %i AND user_id = %i',
2151 2151
             $record['id'],
2152 2152
             $session->get('user-id')
@@ -2178,7 +2178,7 @@  discard block
 block discarded – undo
2178 2178
             if ((int) $post_user_id !== (int) $session->get('user-id')) {
2179 2179
                 $currentUserKey = DB::queryFirstRow(
2180 2180
                     'SELECT increment_id
2181
-                    FROM ' . prefixTable('sharekeys_items') . '
2181
+                    FROM ' . prefixTable('sharekeys_items').'
2182 2182
                     WHERE object_id = %i AND user_id = %i',
2183 2183
                     $record['id'],
2184 2184
                     $post_user_id
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
     // SHould we change step?
2212 2212
     DB::query(
2213 2213
         'SELECT *
2214
-        FROM ' . prefixTable('items') . '
2214
+        FROM ' . prefixTable('items').'
2215 2215
         WHERE perso = 0'
2216 2216
     );
2217 2217
 
@@ -2236,15 +2236,15 @@  discard block
 block discarded – undo
2236 2236
     // Loop on logs
2237 2237
     $rows = DB::query(
2238 2238
         'SELECT increment_id
2239
-        FROM ' . prefixTable('log_items') . '
2239
+        FROM ' . prefixTable('log_items').'
2240 2240
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"
2241
-        LIMIT ' . $post_start . ', ' . $post_length
2241
+        LIMIT ' . $post_start.', '.$post_length
2242 2242
     );
2243 2243
     foreach ($rows as $record) {
2244 2244
         // Get itemKey from current user
2245 2245
         $currentUserKey = DB::queryFirstRow(
2246 2246
             'SELECT share_key
2247
-            FROM ' . prefixTable('sharekeys_logs') . '
2247
+            FROM ' . prefixTable('sharekeys_logs').'
2248 2248
             WHERE object_id = %i AND user_id = %i',
2249 2249
             $record['increment_id'],
2250 2250
             $session->get('user-id')
@@ -2276,7 +2276,7 @@  discard block
 block discarded – undo
2276 2276
             if ((int) $post_user_id !== (int) $session->get('user-id')) {
2277 2277
                 $currentUserKey = DB::queryFirstRow(
2278 2278
                     'SELECT increment_id
2279
-                    FROM ' . prefixTable('sharekeys_items') . '
2279
+                    FROM ' . prefixTable('sharekeys_items').'
2280 2280
                     WHERE object_id = %i AND user_id = %i',
2281 2281
                     $record['id'],
2282 2282
                     $post_user_id
@@ -2298,7 +2298,7 @@  discard block
 block discarded – undo
2298 2298
     // SHould we change step?
2299 2299
     DB::query(
2300 2300
         'SELECT increment_id
2301
-        FROM ' . prefixTable('log_items') . '
2301
+        FROM ' . prefixTable('log_items').'
2302 2302
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"'
2303 2303
     );
2304 2304
 
@@ -2323,15 +2323,15 @@  discard block
 block discarded – undo
2323 2323
     // Loop on fields
2324 2324
     $rows = DB::query(
2325 2325
         'SELECT id
2326
-        FROM ' . prefixTable('categories_items') . '
2326
+        FROM ' . prefixTable('categories_items').'
2327 2327
         WHERE encryption_type = "teampass_aes"
2328
-        LIMIT ' . $post_start . ', ' . $post_length
2328
+        LIMIT ' . $post_start.', '.$post_length
2329 2329
     );
2330 2330
     foreach ($rows as $record) {
2331 2331
         // Get itemKey from current user
2332 2332
         $currentUserKey = DB::queryFirstRow(
2333 2333
             'SELECT share_key
2334
-            FROM ' . prefixTable('sharekeys_fields') . '
2334
+            FROM ' . prefixTable('sharekeys_fields').'
2335 2335
             WHERE object_id = %i AND user_id = %i',
2336 2336
             $record['id'],
2337 2337
             $session->get('user-id')
@@ -2363,7 +2363,7 @@  discard block
 block discarded – undo
2363 2363
             if ((int) $post_user_id !== (int) $session->get('user-id')) {
2364 2364
                 $currentUserKey = DB::queryFirstRow(
2365 2365
                     'SELECT increment_id
2366
-                    FROM ' . prefixTable('sharekeys_items') . '
2366
+                    FROM ' . prefixTable('sharekeys_items').'
2367 2367
                     WHERE object_id = %i AND user_id = %i',
2368 2368
                     $record['id'],
2369 2369
                     $post_user_id
@@ -2385,7 +2385,7 @@  discard block
 block discarded – undo
2385 2385
     // SHould we change step?
2386 2386
     DB::query(
2387 2387
         'SELECT *
2388
-        FROM ' . prefixTable('categories_items') . '
2388
+        FROM ' . prefixTable('categories_items').'
2389 2389
         WHERE encryption_type = "teampass_aes"'
2390 2390
     );
2391 2391
 
@@ -2410,14 +2410,14 @@  discard block
 block discarded – undo
2410 2410
     // Loop on suggestions
2411 2411
     $rows = DB::query(
2412 2412
         'SELECT id
2413
-        FROM ' . prefixTable('suggestion') . '
2414
-        LIMIT ' . $post_start . ', ' . $post_length
2413
+        FROM ' . prefixTable('suggestion').'
2414
+        LIMIT ' . $post_start.', '.$post_length
2415 2415
     );
2416 2416
     foreach ($rows as $record) {
2417 2417
         // Get itemKey from current user
2418 2418
         $currentUserKey = DB::queryFirstRow(
2419 2419
             'SELECT share_key
2420
-            FROM ' . prefixTable('sharekeys_suggestions') . '
2420
+            FROM ' . prefixTable('sharekeys_suggestions').'
2421 2421
             WHERE object_id = %i AND user_id = %i',
2422 2422
             $record['id'],
2423 2423
             $session->get('user-id')
@@ -2449,7 +2449,7 @@  discard block
 block discarded – undo
2449 2449
             if ((int) $post_user_id !== (int) $session->get('user-id')) {
2450 2450
                 $currentUserKey = DB::queryFirstRow(
2451 2451
                     'SELECT increment_id
2452
-                    FROM ' . prefixTable('sharekeys_items') . '
2452
+                    FROM ' . prefixTable('sharekeys_items').'
2453 2453
                     WHERE object_id = %i AND user_id = %i',
2454 2454
                     $record['id'],
2455 2455
                     $post_user_id
@@ -2495,15 +2495,15 @@  discard block
 block discarded – undo
2495 2495
     // Loop on files
2496 2496
     $rows = DB::query(
2497 2497
         'SELECT id
2498
-        FROM ' . prefixTable('files') . '
2499
-        WHERE status = "' . TP_ENCRYPTION_NAME . '"
2500
-        LIMIT ' . $post_start . ', ' . $post_length
2498
+        FROM ' . prefixTable('files').'
2499
+        WHERE status = "' . TP_ENCRYPTION_NAME.'"
2500
+        LIMIT ' . $post_start.', '.$post_length
2501 2501
     ); //aes_encryption
2502 2502
     foreach ($rows as $record) {
2503 2503
         // Get itemKey from current user
2504 2504
         $currentUserKey = DB::queryFirstRow(
2505 2505
             'SELECT share_key
2506
-            FROM ' . prefixTable('sharekeys_files') . '
2506
+            FROM ' . prefixTable('sharekeys_files').'
2507 2507
             WHERE object_id = %i AND user_id = %i',
2508 2508
             $record['id'],
2509 2509
             $session->get('user-id')
@@ -2535,7 +2535,7 @@  discard block
 block discarded – undo
2535 2535
             if ((int) $post_user_id !== (int) $session->get('user-id')) {
2536 2536
                 $currentUserKey = DB::queryFirstRow(
2537 2537
                     'SELECT increment_id
2538
-                    FROM ' . prefixTable('sharekeys_items') . '
2538
+                    FROM ' . prefixTable('sharekeys_items').'
2539 2539
                     WHERE object_id = %i AND user_id = %i',
2540 2540
                     $record['id'],
2541 2541
                     $post_user_id
@@ -2557,8 +2557,8 @@  discard block
 block discarded – undo
2557 2557
     // SHould we change step?
2558 2558
     DB::query(
2559 2559
         'SELECT *
2560
-        FROM ' . prefixTable('files') . '
2561
-        WHERE status = "' . TP_ENCRYPTION_NAME . '"'
2560
+        FROM ' . prefixTable('files').'
2561
+        WHERE status = "' . TP_ENCRYPTION_NAME.'"'
2562 2562
     );
2563 2563
 
2564 2564
     $next_start = (int) $post_start + (int) $post_length;
@@ -2591,9 +2591,9 @@  discard block
 block discarded – undo
2591 2591
     if (count($session->get('user-personal_folders')) > 0) {
2592 2592
         $rows = DB::query(
2593 2593
             'SELECT id, pw
2594
-            FROM ' . prefixTable('items') . '
2594
+            FROM ' . prefixTable('items').'
2595 2595
             WHERE perso = 1 AND id_tree IN %ls AND encryption_type = %s
2596
-            LIMIT ' . $post_start . ', ' . $post_length,
2596
+            LIMIT ' . $post_start.', '.$post_length,
2597 2597
             $session->get('user-personal_folders'),
2598 2598
             "defuse"
2599 2599
         );
@@ -2601,7 +2601,7 @@  discard block
 block discarded – undo
2601 2601
             // Get itemKey from current user
2602 2602
             $currentUserKey = DB::queryFirstRow(
2603 2603
                 'SELECT share_key, increment_id
2604
-                FROM ' . prefixTable('sharekeys_items') . '
2604
+                FROM ' . prefixTable('sharekeys_items').'
2605 2605
                 WHERE object_id = %i AND user_id = %i',
2606 2606
                 $record['id'],
2607 2607
                 $session->get('user-id')
@@ -2628,7 +2628,7 @@  discard block
 block discarded – undo
2628 2628
                 if ((int) $post_user_id !== (int) $session->get('user-id')) {
2629 2629
                     $currentUserKey = DB::queryFirstRow(
2630 2630
                         'SELECT increment_id
2631
-                        FROM ' . prefixTable('sharekeys_items') . '
2631
+                        FROM ' . prefixTable('sharekeys_items').'
2632 2632
                         WHERE object_id = %i AND user_id = %i',
2633 2633
                         $record['id'],
2634 2634
                         $post_user_id
@@ -2651,7 +2651,7 @@  discard block
 block discarded – undo
2651 2651
     // SHould we change step?
2652 2652
     DB::query(
2653 2653
         'SELECT *
2654
-        FROM ' . prefixTable('items') . '
2654
+        FROM ' . prefixTable('items').'
2655 2655
         WHERE perso = 0'
2656 2656
     );
2657 2657
 
@@ -2679,7 +2679,7 @@  discard block
 block discarded – undo
2679 2679
         // Check if user exists
2680 2680
         $userInfo = DB::queryFirstRow(
2681 2681
             'SELECT public_key, encrypted_psk
2682
-            FROM ' . prefixTable('users') . '
2682
+            FROM ' . prefixTable('users').'
2683 2683
             WHERE id = %i',
2684 2684
             $post_user_id
2685 2685
         );
@@ -2705,7 +2705,7 @@  discard block
 block discarded – undo
2705 2705
                 if ($post_counterItemsToTreat === -1) {
2706 2706
                     DB::query(
2707 2707
                         'SELECT id
2708
-                        FROM ' . prefixTable('items') . '
2708
+                        FROM ' . prefixTable('items').'
2709 2709
                         WHERE perso = 1 AND id_tree IN %ls AND encryption_type != %s',
2710 2710
                         $session->get('user-personal_folders'),
2711 2711
                         'teampass_aes'
@@ -2718,7 +2718,7 @@  discard block
 block discarded – undo
2718 2718
                 // Loop on persoanl items
2719 2719
                 $rows = DB::query(
2720 2720
                     'SELECT id, pw
2721
-                    FROM ' . prefixTable('items') . '
2721
+                    FROM ' . prefixTable('items').'
2722 2722
                     WHERE perso = 1 AND id_tree IN %ls AND encryption_type != %s
2723 2723
                     LIMIT ' . $post_length,
2724 2724
                     $session->get('user-personal_folders'),
@@ -2762,7 +2762,7 @@  discard block
 block discarded – undo
2762 2762
                     // Loop on files
2763 2763
                     $rows = DB::query(
2764 2764
                         'SELECT id, file
2765
-                        FROM ' . prefixTable('files') . '
2765
+                        FROM ' . prefixTable('files').'
2766 2766
                         WHERE status != %s
2767 2767
                         AND id_item = %i',
2768 2768
                         TP_ENCRYPTION_NAME,
@@ -2773,14 +2773,14 @@  discard block
 block discarded – undo
2773 2773
                         // Now decrypt the file
2774 2774
                         prepareFileWithDefuse(
2775 2775
                             'decrypt',
2776
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'],
2777
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'] . '.delete',
2776
+                            $SETTINGS['path_to_upload_folder'].'/'.$record2['file'],
2777
+                            $SETTINGS['path_to_upload_folder'].'/'.$record2['file'].'.delete',
2778 2778
                             $SETTINGS,
2779 2779
                             $post_user_psk
2780 2780
                         );
2781 2781
 
2782 2782
                         // Encrypt the file
2783
-                        $encryptedFile = encryptFile($record2['file'] . '.delete', $SETTINGS['path_to_upload_folder']);
2783
+                        $encryptedFile = encryptFile($record2['file'].'.delete', $SETTINGS['path_to_upload_folder']);
2784 2784
 
2785 2785
                         DB::update(
2786 2786
                             prefixTable('files'),
@@ -2803,7 +2803,7 @@  discard block
 block discarded – undo
2803 2803
                         );
2804 2804
 
2805 2805
                         // Unlink original file
2806
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record2['file']);
2806
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record2['file']);
2807 2807
                     }
2808 2808
                 }
2809 2809
 
@@ -2811,7 +2811,7 @@  discard block
 block discarded – undo
2811 2811
                 $next_start = (int) $post_start + (int) $post_length;
2812 2812
                 DB::query(
2813 2813
                     'SELECT id
2814
-                    FROM ' . prefixTable('items') . '
2814
+                    FROM ' . prefixTable('items').'
2815 2815
                     WHERE perso = 1 AND id_tree IN %ls AND encryption_type != %s',
2816 2816
                     $session->get('user-personal_folders'),
2817 2817
                     'teampass_aes'
@@ -2882,7 +2882,7 @@  discard block
 block discarded – undo
2882 2882
         // Get user info
2883 2883
         $userData = DB::queryFirstRow(
2884 2884
             'SELECT '.$post_fields.'
2885
-            FROM ' . prefixTable('users') . '
2885
+            FROM ' . prefixTable('users').'
2886 2886
             WHERE id = %i',
2887 2887
             $post_user_id
2888 2888
         );
@@ -2929,7 +2929,7 @@  discard block
 block discarded – undo
2929 2929
         // Get user info
2930 2930
         $userData = DB::queryFirstRow(
2931 2931
             'SELECT auth_type, login, private_key
2932
-            FROM ' . prefixTable('users') . '
2932
+            FROM ' . prefixTable('users').'
2933 2933
             WHERE id = %i',
2934 2934
             $post_user_id
2935 2935
         );
@@ -2978,7 +2978,7 @@  discard block
 block discarded – undo
2978 2978
                 return prepareExchangedData(
2979 2979
                     array(
2980 2980
                         'error' => false,
2981
-                        'message' => $lang->get('done'),'',
2981
+                        'message' => $lang->get('done'), '',
2982 2982
                     ),
2983 2983
                     'encode'
2984 2984
                 );
@@ -3028,7 +3028,7 @@  discard block
 block discarded – undo
3028 3028
         // Get user info
3029 3029
         $userData = DB::queryFirstRow(
3030 3030
             'SELECT auth_type, login, private_key, special
3031
-            FROM ' . prefixTable('users') . '
3031
+            FROM ' . prefixTable('users').'
3032 3032
             WHERE id = %i',
3033 3033
             $post_user_id
3034 3034
         );
@@ -3062,7 +3062,7 @@  discard block
 block discarded – undo
3062 3062
                 return prepareExchangedData(
3063 3063
                     array(
3064 3064
                         'error' => false,
3065
-                        'message' => $lang->get('done'),'',
3065
+                        'message' => $lang->get('done'), '',
3066 3066
                     ),
3067 3067
                     'encode'
3068 3068
                 );
@@ -3085,7 +3085,7 @@  discard block
 block discarded – undo
3085 3085
             // Get one itemKey from current user
3086 3086
             $currentUserKey = DB::queryFirstRow(
3087 3087
                 'SELECT share_key, increment_id
3088
-                FROM ' . prefixTable('sharekeys_items') . '
3088
+                FROM ' . prefixTable('sharekeys_items').'
3089 3089
                 WHERE user_id = %i
3090 3090
                 LIMIT 1',
3091 3091
                 $post_user_id
@@ -3174,7 +3174,7 @@  discard block
 block discarded – undo
3174 3174
             $session->get('user-id')
3175 3175
         );
3176 3176
         // Return data
3177
-        return '[{"new_value":"' . $session->get('user-session_duration') . '"}]';
3177
+        return '[{"new_value":"'.$session->get('user-session_duration').'"}]';
3178 3178
     }
3179 3179
     
3180 3180
     return '[{"new_value":"expired"}]';
Please login to merge, or discard this patch.
scripts/task_maintenance_reload_cache_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 function reloadCacheTable(): void
72 72
 {
73 73
     // Load expected files
74
-    require_once __DIR__. '/../sources/main.functions.php';
74
+    require_once __DIR__.'/../sources/main.functions.php';
75 75
 
76 76
     updateCacheTable('reload', NULL);
77 77
 }
78 78
\ No newline at end of file
Please login to merge, or discard this patch.
scripts/background_tasks___user_task.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
 DB::debugmode(false);
67 67
 $rows = DB::query(
68 68
     'SELECT *
69
-    FROM ' . prefixTable('background_tasks') . '
69
+    FROM ' . prefixTable('background_tasks').'
70 70
     WHERE is_in_progress = %i AND process_type = %s
71 71
     ORDER BY increment_id ASC LIMIT 0,' . $number_users_build_cache_tree,
72 72
     0,
Please login to merge, or discard this patch.
sources/folders.queries.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
                     && $t->personal_folder == 0
138 138
                 ) {
139 139
                     // get $t->parent_id
140
-                    $data = DB::queryFirstRow('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', $t->parent_id);
140
+                    $data = DB::queryFirstRow('SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', $t->parent_id);
141 141
                     if ($t->nlevel == 1) {
142 142
                         $data['title'] = $lang->get('root');
143 143
                     }
144 144
 
145 145
                     // get rights on this folder
146 146
                     $arrayRights = array();
147
-                    $rows = DB::query('SELECT fonction_id  FROM ' . prefixTable('rights') . ' WHERE authorized=%i AND tree_id = %i', 1, $t->id);
147
+                    $rows = DB::query('SELECT fonction_id  FROM '.prefixTable('rights').' WHERE authorized=%i AND tree_id = %i', 1, $t->id);
148 148
                     foreach ($rows as $record) {
149 149
                         array_push($arrayRights, $record['fonction_id']);
150 150
                     }
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
                         'SELECT m.valeur AS valeur, n.renewal_period AS renewal_period,
163 163
                         n.bloquer_creation AS bloquer_creation, n.bloquer_modification AS bloquer_modification,
164 164
                         n.fa_icon, n.fa_icon_selected
165
-                        FROM ' . prefixTable('misc') . ' AS m,
166
-                        ' . prefixTable('nested_tree') . ' AS n
165
+                        FROM ' . prefixTable('misc').' AS m,
166
+                        ' . prefixTable('nested_tree').' AS n
167 167
                         WHERE m.type=%s AND m.intitule = n.id AND m.intitule = %i',
168 168
                         'complex',
169 169
                         $t->id
@@ -191,16 +191,16 @@  discard block
 block discarded – undo
191 191
                         $arrayColumns['folderComplexity'] = '';
192 192
                     }
193 193
 
194
-                    if (is_null($node_data)=== false) {
194
+                    if (is_null($node_data) === false) {
195 195
                         $arrayColumns['renewalPeriod'] = (int) $node_data['renewal_period'];
196 196
                     } else {
197
-                        $arrayColumns['renewalPeriod']=0;
197
+                        $arrayColumns['renewalPeriod'] = 0;
198 198
                     }
199 199
 
200 200
                     //col7
201 201
                     $data7 = DB::queryFirstRow(
202 202
                         'SELECT bloquer_creation,bloquer_modification
203
-                        FROM ' . prefixTable('nested_tree') . '
203
+                        FROM ' . prefixTable('nested_tree').'
204 204
                         WHERE id = %i',
205 205
                         intval($t->id)
206 206
                     );
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
             // Get info about this folder
360 360
             $dataFolder = DB::queryfirstrow(
361 361
                 'SELECT *
362
-                FROM ' . prefixTable('nested_tree') . '
362
+                FROM ' . prefixTable('nested_tree').'
363 363
                 WHERE id = %i',
364 364
                 $inputData['id']
365 365
             );
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
             //check if parent folder is personal
396 396
             $dataParent = DB::queryfirstrow(
397 397
                 'SELECT personal_folder, bloquer_creation, bloquer_modification
398
-                FROM ' . prefixTable('nested_tree') . '
398
+                FROM ' . prefixTable('nested_tree').'
399 399
                 WHERE id = %i',
400 400
                 $inputData['parentId']
401 401
             );
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
                     // get complexity level for this folder
425 425
                     $data = DB::queryfirstrow(
426 426
                         'SELECT valeur
427
-                        FROM ' . prefixTable('misc') . '
427
+                        FROM ' . prefixTable('misc').'
428 428
                         WHERE intitule = %i AND type = %s',
429 429
                         $inputData['parentId'],
430 430
                         'complex'
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                             array(
436 436
                                 'error' => true,
437 437
                                 'message' => $lang->get('error_folder_complexity_lower_than_top_folder')
438
-                                    . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]',
438
+                                    . ' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]',
439 439
                             ),
440 440
                             'encode'
441 441
                         );
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
             // Check if parent folder is personal
597 597
             $dataParent = DB::queryfirstrow(
598 598
                 'SELECT personal_folder
599
-                FROM ' . prefixTable('nested_tree') . '
599
+                FROM ' . prefixTable('nested_tree').'
600 600
                 WHERE id = %i',
601 601
                 $inputData['parentId']
602 602
             );
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
             echo prepareExchangedData(
637 637
                 array(
638 638
                     'error' => $creationStatus['error'],
639
-                    'message' => $creationStatus['error'] === true ? $lang->get('error_not_allowed_to') : $lang->get('folder_created') ,
639
+                    'message' => $creationStatus['error'] === true ? $lang->get('error_not_allowed_to') : $lang->get('folder_created'),
640 640
                     'newId' => $creationStatus['newId'],
641 641
                 ),
642 642
                 'encode'
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
                 echo prepareExchangedData(
685 685
                     array(
686 686
                         'error' => true,
687
-                        'message' => $lang->get('error_not_allowed_to'). " (You can't delete the root folder)",
687
+                        'message' => $lang->get('error_not_allowed_to')." (You can't delete the root folder)",
688 688
                     ),
689 689
                     'encode'
690 690
                 );
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
             // Ensure that user has access to all folders
695 695
             $foldersAccessible = DB::query(
696 696
                 'SELECT id
697
-                FROM ' . prefixTable('nested_tree') . '
697
+                FROM ' . prefixTable('nested_tree').'
698 698
                 WHERE id IN %li AND id IN %li',
699 699
                 $post_folders,
700 700
                 $session->get('user-accessible_folders')
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
                 echo prepareExchangedData(
709 709
                     array(
710 710
                         'error' => true,
711
-                        'message' => $lang->get('error_not_allowed_to') . ' (The following folders are not accessible or do not exist: ' . implode(', ', $missingFolders) . ')',
711
+                        'message' => $lang->get('error_not_allowed_to').' (The following folders are not accessible or do not exist: '.implode(', ', $missingFolders).')',
712 712
                     ),
713 713
                     'encode'
714 714
                 );
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
                 // Check if parent folder is personal
726 726
                 $dataParent = DB::queryfirstrow(
727 727
                     'SELECT personal_folder
728
-                    FROM ' . prefixTable('nested_tree') . '
728
+                    FROM ' . prefixTable('nested_tree').'
729 729
                     WHERE id = %i',
730 730
                     $folderId
731 731
                 );
@@ -771,10 +771,10 @@  discard block
 block discarded – undo
771 771
                                 prefixTable('misc'),
772 772
                                 array(
773 773
                                     'type' => 'folder_deleted',
774
-                                    'intitule' => 'f' . $thisSubFolders->id,
775
-                                    'valeur' => $thisSubFolders->id . ', ' . $thisSubFolders->parent_id . ', ' .
776
-                                        $thisSubFolders->title . ', ' . $thisSubFolders->nleft . ', ' . $thisSubFolders->nright . ', ' .
777
-                                        $thisSubFolders->nlevel . ', 0, 0, 0, 0',
774
+                                    'intitule' => 'f'.$thisSubFolders->id,
775
+                                    'valeur' => $thisSubFolders->id.', '.$thisSubFolders->parent_id.', '.
776
+                                        $thisSubFolders->title.', '.$thisSubFolders->nleft.', '.$thisSubFolders->nright.', '.
777
+                                        $thisSubFolders->nlevel.', 0, 0, 0, 0',
778 778
                                     'created_at' => time(),
779 779
                                 )
780 780
                             );
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 
784 784
                             //delete items & logs
785 785
                             $itemsInSubFolder = DB::query(
786
-                                'SELECT id FROM ' . prefixTable('items') . ' 
786
+                                'SELECT id FROM '.prefixTable('items').' 
787 787
                                 WHERE id_tree=%i', 
788 788
                                 $thisSubFolders->id
789 789
                             );
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
                                 }
814 814
 
815 815
                                 //Update CACHE table
816
-                                updateCacheTable('delete_value',(int) $item['id']);
816
+                                updateCacheTable('delete_value', (int) $item['id']);
817 817
                             }
818 818
 
819 819
                             //Actualize the variable
@@ -923,7 +923,7 @@  discard block
 block discarded – undo
923 923
             // Check if target parent folder is personal
924 924
             $dataParent = DB::queryfirstrow(
925 925
                 'SELECT personal_folder
926
-                FROM ' . prefixTable('nested_tree') . '
926
+                FROM ' . prefixTable('nested_tree').'
927 927
                 WHERE id = %i',
928 928
                 $post_target_folder_id
929 929
             );
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
                 // get complexity of current node
978 978
                 $nodeComplexity = DB::queryfirstrow(
979 979
                     'SELECT valeur
980
-                    FROM ' . prefixTable('misc') . '
980
+                    FROM ' . prefixTable('misc').'
981 981
                     WHERE intitule = %i AND type= %s',
982 982
                     $nodeInfo->id,
983 983
                     'complex'
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
                 // If it is a subfolder, then give access to it for all roles that allows the parent folder
1055 1055
                 $rows = DB::query(
1056 1056
                     'SELECT role_id, type
1057
-                    FROM ' . prefixTable('roles_values') . '
1057
+                    FROM ' . prefixTable('roles_values').'
1058 1058
                     WHERE folder_id = %i',
1059 1059
                     $parentId
1060 1060
                 );
@@ -1062,7 +1062,7 @@  discard block
 block discarded – undo
1062 1062
                     // Add access to this subfolder after checking that it is not already set
1063 1063
                     DB::query(
1064 1064
                         'SELECT *
1065
-                        FROM ' . prefixTable('roles_values') . '
1065
+                        FROM ' . prefixTable('roles_values').'
1066 1066
                         WHERE folder_id = %i AND role_id = %i',
1067 1067
                         $newFolderId,
1068 1068
                         $record['role_id']
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
                 // if parent folder has Custom Fields Categories then add to this child one too
1083 1083
                 $rows = DB::query(
1084 1084
                     'SELECT id_category
1085
-                    FROM ' . prefixTable('categories_folders') . '
1085
+                    FROM ' . prefixTable('categories_folders').'
1086 1086
                     WHERE id_folder = %i',
1087 1087
                     $nodeInfo->id
1088 1088
                 );
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
 
1102 1102
                 $rows = DB::query(
1103 1103
                     'SELECT *
1104
-                    FROM ' . prefixTable('items') . '
1104
+                    FROM ' . prefixTable('items').'
1105 1105
                     WHERE id_tree = %i',
1106 1106
                     $nodeInfo->id
1107 1107
                 );
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
                     // if it is then don't copy it
1111 1111
                     $item_deleted = DB::queryFirstRow(
1112 1112
                         'SELECT *
1113
-                        FROM ' . prefixTable('log_items') . '
1113
+                        FROM ' . prefixTable('log_items').'
1114 1114
                         WHERE id_item = %i AND action = %s
1115 1115
                         ORDER BY date DESC
1116 1116
                         LIMIT 0, 1',
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 
1122 1122
                     $item_restored = DB::queryFirstRow(
1123 1123
                         'SELECT *
1124
-                        FROM ' . prefixTable('log_items') . '
1124
+                        FROM ' . prefixTable('log_items').'
1125 1125
                         WHERE id_item = %i AND action = %s
1126 1126
                         ORDER BY date DESC
1127 1127
                         LIMIT 0, 1',
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
                         // Get the ITEM object key for the user
1137 1137
                         $userKey = DB::queryFirstRow(
1138 1138
                             'SELECT share_key
1139
-                            FROM ' . prefixTable('sharekeys_items') . '
1139
+                            FROM ' . prefixTable('sharekeys_items').'
1140 1140
                             WHERE user_id = %i AND object_id = %i',
1141 1141
                             $session->get('user-id'),
1142 1142
                             $record['id']
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
                         // Manage Custom Fields
1210 1210
                         $categories = DB::query(
1211 1211
                             'SELECT *
1212
-                            FROM ' . prefixTable('categories_items') . '
1212
+                            FROM ' . prefixTable('categories_items').'
1213 1213
                             WHERE item_id = %i',
1214 1214
                             $record['id']
1215 1215
                         );
@@ -1256,15 +1256,15 @@  discard block
 block discarded – undo
1256 1256
                         $files = DB::query(
1257 1257
                             'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension,
1258 1258
                             f.size AS size, f.type AS type, s.share_key AS share_key
1259
-                            FROM ' . prefixTable('files') . ' AS f
1260
-                            INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
1259
+                            FROM ' . prefixTable('files').' AS f
1260
+                            INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
1261 1261
                             WHERE s.user_id = %i AND f.id_item = %i',
1262 1262
                             $session->get('user-id'),
1263 1263
                             $record['id']
1264 1264
                         );
1265 1265
                         foreach ($files as $file) {
1266 1266
                             // Check if file still exists
1267
-                            if (file_exists($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . TP_FILE_PREFIX . base64_decode($file['file'])) === true) {
1267
+                            if (file_exists($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.TP_FILE_PREFIX.base64_decode($file['file'])) === true) {
1268 1268
                                 // Step1 - decrypt the file
1269 1269
                                 $fileContent = decryptFile(
1270 1270
                                     $file['file'],
@@ -1274,9 +1274,9 @@  discard block
 block discarded – undo
1274 1274
 
1275 1275
                                 // Step2 - create file
1276 1276
                                 // deepcode ignore InsecureHash: Is not a password, just a random string for a file name
1277
-                                $newFileName = md5(time() . '_' . $file['id']) . '.' . $file['extension'];
1277
+                                $newFileName = md5(time().'_'.$file['id']).'.'.$file['extension'];
1278 1278
 
1279
-                                $outstream = fopen($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . $newFileName, 'ab');
1279
+                                $outstream = fopen($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.$newFileName, 'ab');
1280 1280
                                 if ($outstream === false) {
1281 1281
                                     echo prepareExchangedData(
1282 1282
                                         array(
@@ -1425,7 +1425,7 @@  discard block
 block discarded – undo
1425 1425
                     // Get path
1426 1426
                     $text = '';
1427 1427
                     foreach ($tree->getPath($folder->id, false) as $fld) {
1428
-                        $text .= empty($text) === true ? '     [<i>' . $fld->title : ' > ' . $fld->title;
1428
+                        $text .= empty($text) === true ? '     [<i>'.$fld->title : ' > '.$fld->title;
1429 1429
                     }
1430 1430
 
1431 1431
                     // Save array
@@ -1435,7 +1435,7 @@  discard block
 block discarded – undo
1435 1435
                             'id' => (int) $folder->id,
1436 1436
                             'label' => $folder->title,
1437 1437
                             'level' => $folder->nlevel,
1438
-                            'path' => empty($text) === true ? '' : $text . '</i>]'
1438
+                            'path' => empty($text) === true ? '' : $text.'</i>]'
1439 1439
                         )
1440 1440
                     );
1441 1441
                 }
Please login to merge, or discard this patch.
sources/items.logs.php 1 patch
Spacing   +2 added lines, -2 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
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             
131 131
             if (
132 132
                 is_array($dataReceived) && // check if the data is an array
133
-                array_diff_key(array_flip($requiredKeys), $dataReceived) === [] &&  // check if all required keys have a valuekeys are present
133
+                array_diff_key(array_flip($requiredKeys), $dataReceived) === [] && // check if all required keys have a valuekeys are present
134 134
                 count(array_filter($dataReceived)) === count($requiredKeys) && // check if all required 
135 135
                 in_array($dataReceived['action'], ['at_password_shown', 'at_password_copied'], true) && // only log these actions
136 136
                 $session->get('user-id') === (int) filter_var($dataReceived['user_id'], FILTER_SANITIZE_NUMBER_INT) // only log actions of the current user
Please login to merge, or discard this patch.
includes/core/load.js.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
                             // Show passwords inputs and form
177 177
                             $('#dialog-user-change-password-info')
178
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('user_has_to_change_password_info');?>')
178
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('user_has_to_change_password_info'); ?>')
179 179
                                 .removeClass('hidden');
180 180
                             $('#dialog-user-change-password').removeClass('hidden');
181 181
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
                             // Show passwords inputs and form
190 190
                             $('#dialog-ldap-user-change-password-info')
191
-                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
191
+                                .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
192 192
                                 .removeClass('hidden');
193 193
                             $('#dialog-ldap-user-change-password').removeClass('hidden');
194 194
                             
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
                             if (data.queryResults.auth_type === 'oauth2') {
218 218
                                 // LDAP or local account to OAuth2 account
219
-                                var info_message = '<?php echo $lang->get('oauth2_need_user_old_password');?>';
219
+                                var info_message = '<?php echo $lang->get('oauth2_need_user_old_password'); ?>';
220 220
 
221 221
                                 // Hide the "new password" field that users can't fill in manually
222 222
                                 $('#new-password-field').hide();
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
                                 $('#dialog-ldap-user-change-password-current').val(oauth2_encryption_hash);
229 229
                             } else {
230 230
                                 // LDAP password updated
231
-                                var info_message = '<?php echo $lang->get('ldap_user_has_changed_his_password');?>';
231
+                                var info_message = '<?php echo $lang->get('ldap_user_has_changed_his_password'); ?>';
232 232
                             }
233 233
 
234 234
                             // Display info tip
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         /*console.log('User has to regenerate keys')
340 340
         // HIde
341 341
         $('.content-header, .content').addClass('hidden');
342
-        $('#dialog-user-temporary-code-info').html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('renecyption_expected');?>');
342
+        $('#dialog-user-temporary-code-info').html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('renecyption_expected'); ?>');
343 343
 
344 344
         // Show passwords inputs and form
345 345
         $('#dialog-user-temporary-code').removeClass('hidden');
@@ -421,13 +421,13 @@  discard block
 block discarded – undo
421 421
             {
422 422
                 if (step === 'psk') {
423 423
                     // Inform user
424
-                    $("#user-current-defuse-psk-progress").html('<b><?php echo $lang->get('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + '] ' +
424
+                    $("#user-current-defuse-psk-progress").html('<b><?php echo $lang->get('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + '] ' +
425 425
                         '... <?php echo $lang->get('please_wait'); ?><i class="fa-solid fa-spinner fa-pulse ml-3 text-primary"></i>');
426 426
 
427 427
                     var data = {
428 428
                         'userPsk' : $('#user-current-defuse-psk').val(),
429 429
                         'start': start,
430
-                        'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>,
430
+                        'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>,
431 431
                         'user_id': userId,
432 432
                         'counterItemsToTreat': counterItemsToTreat
433 433
                     };
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 
504 504
                 // Show passwords inputs and form
505 505
                 $('#dialog-ldap-user-change-password-info')
506
-                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password');?>')
506
+                    .html('<i class="icon fa-solid fa-info mr-2"></i><?php echo $lang->get('ldap_user_has_changed_his_password'); ?>')
507 507
                     .removeClass('hidden');
508 508
                 $('#dialog-ldap-user-change-password').removeClass('hidden');
509 509
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
                                 '</div>' +
594 594
                             '</div>' +
595 595
                         '</div>' +
596
-                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1  ? '' : ' hidden'; ?>">' +
596
+                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1 ? '' : ' hidden'; ?>">' +
597 597
                             '<h6><?php echo $lang->get('provide_recovery_keys'); ?></h6>' +
598 598
                             '<div class="input-group mb-2">' +
599 599
                                 '<div class="input-group-prepend">' +
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
                                 '<textarea rows="2" id="recovery-private-key" class="form-control form-item-control"></textarea>' +
609 609
                             '</div>' +
610 610
                         '</div>' +
611
-                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1  ? '' : ' hidden'; ?>">' +
611
+                        '<div class="row mt-2<?php echo isset($SETTINGS['enable_pf_feature']) === true && (int) $SETTINGS['enable_pf_feature'] === 1 ? '' : ' hidden'; ?>">' +
612 612
                             '<div class="alert" id="confirm-no-recovery-keys-div">' +
613 613
                                 '<div class="form-check">' +
614 614
                                     '<input type="checkbox" class="form-check-input" id="confirm-no-recovery-keys">' +
@@ -1172,15 +1172,15 @@  discard block
 block discarded – undo
1172 1172
             // Prepare data
1173 1173
             var data = {
1174 1174
                 'receipt': $('#temp-user-email').val(),
1175
-                'subject': '[Teampass] <?php echo $lang->get('your_new_password');?>',
1176
-                'body': '<?php echo $lang->get('email_body_temporary_login_password');?>',
1175
+                'subject': '[Teampass] <?php echo $lang->get('your_new_password'); ?>',
1176
+                'body': '<?php echo $lang->get('email_body_temporary_login_password'); ?>',
1177 1177
                 'pre_replace' : {
1178 1178
                     '#enc_code#' : $('#temp-user-pwd').val(),
1179 1179
                 }
1180 1180
             }
1181 1181
             if (debugJavascript === true) console.log(data);
1182 1182
             // Prepare form
1183
-            $('#dialog-admin-change-user-password-info').html('<?php echo $lang->get('sending_email_message');?>');
1183
+            $('#dialog-admin-change-user-password-info').html('<?php echo $lang->get('sending_email_message'); ?>');
1184 1184
             toastr.remove();
1185 1185
             toastr.info(
1186 1186
                 '<?php echo $lang->get('in_progress'); ?><i class="fa-solid fa-circle-notch fa-spin fa-2x ml-3"></i>'
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
                         '#warningModal',
1703 1703
                         '<i class="fa-solid fa-clock fa-lg warning mr-2"></i><?php echo $lang->get('index_add_one_hour'); ?>',
1704 1704
                         '<div class="form-group">' +
1705
-                        '<label for="warningModal-input" class="col-form-label"><?php echo $lang->get('extend_session_duration_by') . ' (' . $lang->get('minutes') . ')'; ?>:</label>' +
1705
+                        '<label for="warningModal-input" class="col-form-label"><?php echo $lang->get('extend_session_duration_by').' ('.$lang->get('minutes').')'; ?>:</label>' +
1706 1706
                         '<input type="number" max="'+(60*60*24)+'" class="form-control" id="warningModal-input" value="60">' +
1707 1707
                         '</div>' +
1708 1708
                         '<div class="form-text text-muted"><i class=\"fa-solid fa-info-circle mr-2\"></i><?php echo $lang->get('maximum_session_expiration_time'); ?>: '+data.max_session_duration+'</div>',
Please login to merge, or discard this patch.
scripts/background_tasks___userKeysCreation_subtaskHdl.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 DB::update(
112 112
     prefixTable('background_subtasks'),
113 113
     array(
114
-        'sub_task_in_progress' => 0,    // flag sub task is no more in prgoress
114
+        'sub_task_in_progress' => 0, // flag sub task is no more in prgoress
115 115
         'is_in_progress' => 0,
116 116
         'finished_at' => time(),
117 117
         'updated_at' => time(),
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         // Check if user exists
148 148
         $userInfo = DB::queryFirstRow(
149 149
             'SELECT public_key, private_key
150
-            FROM ' . prefixTable('users') . '
150
+            FROM ' . prefixTable('users').'
151 151
             WHERE id = %i',
152 152
             $post_user_id
153 153
         );
@@ -260,13 +260,13 @@  discard block
 block discarded – undo
260 260
 {
261 261
     $userInfo = DB::queryFirstRow(
262 262
         'SELECT pw, public_key, private_key, login, name
263
-        FROM ' . prefixTable('users') . '
263
+        FROM ' . prefixTable('users').'
264 264
         WHERE id = %i',
265 265
         $owner_id
266 266
     );
267 267
     
268 268
     // decrypt owner password
269
-    $pwd = cryption($owner_pwd, '','decrypt', $SETTINGS)['string'];
269
+    $pwd = cryption($owner_pwd, '', 'decrypt', $SETTINGS)['string'];
270 270
     // decrypt private key and send back
271 271
     return [
272 272
         'private_key' => decryptPrivateKey($pwd, $userInfo['private_key']),
@@ -306,17 +306,17 @@  discard block
 block discarded – undo
306 306
     // Loop on items
307 307
     $rows = DB::query(
308 308
         'SELECT id, pw, perso
309
-        FROM ' . prefixTable('items') . '
309
+        FROM ' . prefixTable('items').'
310 310
         '.(isset($extra_arguments['only_personal_items']) === true && $extra_arguments['only_personal_items'] === 1 ? 'WHERE perso = 1' : '').'
311 311
         ORDER BY id ASC
312
-        LIMIT ' . $post_start . ', ' . $post_length
312
+        LIMIT ' . $post_start.', '.$post_length
313 313
     );
314 314
     //    WHERE perso = 0
315 315
     foreach ($rows as $record) {
316 316
         // Get itemKey from current user
317 317
         $currentUserKey = DB::queryFirstRow(
318 318
             'SELECT share_key, increment_id
319
-            FROM ' . prefixTable('sharekeys_items') . '
319
+            FROM ' . prefixTable('sharekeys_items').'
320 320
             WHERE object_id = %i AND user_id = %i',
321 321
             $record['id'],
322 322
             //$extra_arguments['owner_id']
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
         
346 346
         $currentUserKey = DB::queryFirstRow(
347 347
             'SELECT increment_id
348
-            FROM ' . prefixTable('sharekeys_items') . '
348
+            FROM ' . prefixTable('sharekeys_items').'
349 349
             WHERE object_id = %i AND user_id = %i',
350 350
             $record['id'],
351 351
             $post_user_id
@@ -419,15 +419,15 @@  discard block
 block discarded – undo
419 419
     // Loop on logs
420 420
     $rows = DB::query(
421 421
         'SELECT increment_id
422
-        FROM ' . prefixTable('log_items') . '
422
+        FROM ' . prefixTable('log_items').'
423 423
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"
424
-        LIMIT ' . $post_start . ', ' . $post_length
424
+        LIMIT ' . $post_start.', '.$post_length
425 425
     );
426 426
     foreach ($rows as $record) {
427 427
         // Get itemKey from current user
428 428
         $currentUserKey = DB::queryFirstRow(
429 429
             'SELECT share_key
430
-            FROM ' . prefixTable('sharekeys_logs') . '
430
+            FROM ' . prefixTable('sharekeys_logs').'
431 431
             WHERE object_id = %i AND user_id = %i',
432 432
             $record['increment_id'],
433 433
             $extra_arguments['owner_id']
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
             if ((int) $post_user_id !== (int) $extra_arguments['owner_id']) {
460 460
                 $currentUserKey = DB::queryFirstRow(
461 461
                     'SELECT increment_id
462
-                    FROM ' . prefixTable('sharekeys_items') . '
462
+                    FROM ' . prefixTable('sharekeys_items').'
463 463
                     WHERE object_id = %i AND user_id = %i',
464 464
                     $record['id'],
465 465
                     $post_user_id
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
     // SHould we change step?
482 482
     DB::query(
483 483
         'SELECT increment_id
484
-        FROM ' . prefixTable('log_items') . '
484
+        FROM ' . prefixTable('log_items').'
485 485
         WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"'
486 486
     );
487 487
 
@@ -521,15 +521,15 @@  discard block
 block discarded – undo
521 521
     // Loop on fields
522 522
     $rows = DB::query(
523 523
         'SELECT id
524
-        FROM ' . prefixTable('categories_items') . '
524
+        FROM ' . prefixTable('categories_items').'
525 525
         WHERE encryption_type = "teampass_aes"
526
-        LIMIT ' . $post_start . ', ' . $post_length
526
+        LIMIT ' . $post_start.', '.$post_length
527 527
     );
528 528
     foreach ($rows as $record) {
529 529
         // Get itemKey from current user
530 530
         $currentUserKey = DB::queryFirstRow(
531 531
             'SELECT share_key
532
-            FROM ' . prefixTable('sharekeys_fields') . '
532
+            FROM ' . prefixTable('sharekeys_fields').'
533 533
             WHERE object_id = %i AND user_id = %i',
534 534
             $record['id'],
535 535
             $extra_arguments['owner_id']
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
                 if ((int) $post_user_id !== (int) $extra_arguments['owner_id']) {
558 558
                     $currentUserKey = DB::queryFirstRow(
559 559
                         'SELECT increment_id
560
-                        FROM ' . prefixTable('sharekeys_items') . '
560
+                        FROM ' . prefixTable('sharekeys_items').'
561 561
                         WHERE object_id = %i AND user_id = %i',
562 562
                         $record['id'],
563 563
                         $post_user_id
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
     // SHould we change step?
581 581
     DB::query(
582 582
         'SELECT *
583
-        FROM ' . prefixTable('categories_items') . '
583
+        FROM ' . prefixTable('categories_items').'
584 584
         WHERE encryption_type = "teampass_aes"'
585 585
     );
586 586
 
@@ -620,14 +620,14 @@  discard block
 block discarded – undo
620 620
     // Loop on suggestions
621 621
     $rows = DB::query(
622 622
         'SELECT id
623
-        FROM ' . prefixTable('suggestion') . '
624
-        LIMIT ' . $post_start . ', ' . $post_length
623
+        FROM ' . prefixTable('suggestion').'
624
+        LIMIT ' . $post_start.', '.$post_length
625 625
     );
626 626
     foreach ($rows as $record) {
627 627
         // Get itemKey from current user
628 628
         $currentUserKey = DB::queryFirstRow(
629 629
             'SELECT share_key
630
-            FROM ' . prefixTable('sharekeys_suggestions') . '
630
+            FROM ' . prefixTable('sharekeys_suggestions').'
631 631
             WHERE object_id = %i AND user_id = %i',
632 632
             $record['id'],
633 633
             $extra_arguments['owner_id']
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
             if ((int) $post_user_id !== (int) $extra_arguments['owner_id']) {
660 660
                 $currentUserKey = DB::queryFirstRow(
661 661
                     'SELECT increment_id
662
-                    FROM ' . prefixTable('sharekeys_items') . '
662
+                    FROM ' . prefixTable('sharekeys_items').'
663 663
                     WHERE object_id = %i AND user_id = %i',
664 664
                     $record['id'],
665 665
                     $post_user_id
@@ -719,16 +719,16 @@  discard block
 block discarded – undo
719 719
     // Loop on files
720 720
     $rows = DB::query(
721 721
         'SELECT f.id AS id, i.perso AS perso
722
-        FROM ' . prefixTable('files') . ' AS f
723
-        INNER JOIN ' . prefixTable('items') . ' AS i ON i.id = f.id_item
724
-        WHERE f.status = "' . TP_ENCRYPTION_NAME . '"
725
-        LIMIT ' . $post_start . ', ' . $post_length
722
+        FROM ' . prefixTable('files').' AS f
723
+        INNER JOIN ' . prefixTable('items').' AS i ON i.id = f.id_item
724
+        WHERE f.status = "' . TP_ENCRYPTION_NAME.'"
725
+        LIMIT ' . $post_start.', '.$post_length
726 726
     ); //aes_encryption
727 727
     foreach ($rows as $record) {
728 728
         // Get itemKey from current user
729 729
         $currentUserKey = DB::queryFirstRow(
730 730
             'SELECT share_key, increment_id
731
-            FROM ' . prefixTable('sharekeys_files') . '
731
+            FROM ' . prefixTable('sharekeys_files').'
732 732
             WHERE object_id = %i AND user_id = %i',
733 733
             $record['id'],
734 734
             (int) $record['perso'] === 0 ? $extra_arguments['owner_id'] : $extra_arguments['new_user_id']
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 
757 757
         $currentUserKey = DB::queryFirstRow(
758 758
             'SELECT increment_id
759
-            FROM ' . prefixTable('sharekeys_files') . '
759
+            FROM ' . prefixTable('sharekeys_files').'
760 760
             WHERE object_id = %i AND user_id = %i',
761 761
             $record['id'],
762 762
             $post_user_id
@@ -787,8 +787,8 @@  discard block
 block discarded – undo
787 787
     // SHould we change step? Finished ?
788 788
     DB::query(
789 789
         'SELECT *
790
-        FROM ' . prefixTable('files') . '
791
-        WHERE status = "' . TP_ENCRYPTION_NAME . '"'
790
+        FROM ' . prefixTable('files').'
791
+        WHERE status = "' . TP_ENCRYPTION_NAME.'"'
792 792
     );
793 793
     $counter = DB::count();
794 794
     $next_start = (int) $post_start + (int) $post_length;
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
     // get user info
855 855
     $userInfo = DB::queryFirstRow(
856 856
         'SELECT email, login, auth_type, special, lastname, name
857
-        FROM ' . prefixTable('users') . '
857
+        FROM ' . prefixTable('users').'
858 858
         WHERE id = %i',
859 859
         $extra_arguments['new_user_id']
860 860
     );
@@ -869,10 +869,10 @@  discard block
 block discarded – undo
869 869
             filter_var($userInfo['email'], FILTER_SANITIZE_FULL_SPECIAL_CHARS),
870 870
             // @scrutinizer ignore-type
871 871
             empty($extra_arguments['email_body']) === false ? $extra_arguments['email_body'] : $lang->get('email_body_user_config_1'),
872
-            'TEAMPASS - ' . $lang->get('login_credentials'),
872
+            'TEAMPASS - '.$lang->get('login_credentials'),
873 873
             (array) filter_var_array(
874 874
                 [
875
-                    '#code#' => cryption($extra_arguments['new_user_code'], '','decrypt', $SETTINGS)['string'],
875
+                    '#code#' => cryption($extra_arguments['new_user_code'], '', 'decrypt', $SETTINGS)['string'],
876 876
                     '#lastname#' => isset($userInfo['name']) === true ? $userInfo['name'] : '',
877 877
                     '#login#' => isset($userInfo['login']) === true ? $userInfo['login'] : '',
878 878
                 ],
Please login to merge, or discard this patch.