@@ -72,7 +72,7 @@ discard block |
||
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,14 +133,14 @@ discard block |
||
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_' . DB_NAME]; |
|
143 | + $tables[] = $row['Tables_in_'.DB_NAME]; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | //cycle through |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | if (defined('DB_PREFIX') || substr_count($table, DB_PREFIX) > 0) { |
149 | 149 | $table = (is_string($table) ? $table : strval($table)); |
150 | 150 | // Do query |
151 | - $result = DB::query('SELECT * FROM ' . $table); |
|
151 | + $result = DB::query('SELECT * FROM '.$table); |
|
152 | 152 | DB::query( |
153 | 153 | 'SELECT * |
154 | 154 | FROM INFORMATION_SCHEMA.COLUMNS |
@@ -160,20 +160,20 @@ discard block |
||
160 | 160 | $numFields = DB::count(); |
161 | 161 | |
162 | 162 | // prepare a drop table |
163 | - $return .= 'DROP TABLE ' . $table . ';'; |
|
164 | - $row2 = DB::queryFirstRow('SHOW CREATE TABLE ' . $table); |
|
165 | - $return .= "\n\n" . strval($row2['Create Table']) . ";\n\n"; |
|
163 | + $return .= 'DROP TABLE '.$table.';'; |
|
164 | + $row2 = DB::queryFirstRow('SHOW CREATE TABLE '.$table); |
|
165 | + $return .= "\n\n".strval($row2['Create Table']).";\n\n"; |
|
166 | 166 | |
167 | 167 | //prepare all fields and datas |
168 | 168 | for ($i = 0; $i < $numFields; ++$i) { |
169 | 169 | if (is_object($result)) { |
170 | 170 | while ($row = $result->fetch_row()) { |
171 | - $return .= 'INSERT INTO ' . $table . ' VALUES('; |
|
171 | + $return .= 'INSERT INTO '.$table.' VALUES('; |
|
172 | 172 | for ($j = 0; $j < $numFields; ++$j) { |
173 | 173 | $row[$j] = addslashes($row[$j]); |
174 | 174 | $row[$j] = preg_replace("/\n/", '\\n', $row[$j]); |
175 | 175 | if (isset($row[$j])) { |
176 | - $return .= '"' . $row[$j] . '"'; |
|
176 | + $return .= '"'.$row[$j].'"'; |
|
177 | 177 | } else { |
178 | 178 | $return .= 'NULL'; |
179 | 179 | } |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | $token = GenerateCryptKey(20, false, true, true, false, true); |
195 | 195 | |
196 | 196 | //save file |
197 | - $filename = time() . '-' . $token . '.sql'; |
|
198 | - $handle = fopen($SETTINGS['path_to_files_folder'] . '/' . $filename, 'w+'); |
|
197 | + $filename = time().'-'.$token.'.sql'; |
|
198 | + $handle = fopen($SETTINGS['path_to_files_folder'].'/'.$filename, 'w+'); |
|
199 | 199 | if ($handle !== false) { |
200 | 200 | //write file |
201 | 201 | fwrite($handle, $return); |
@@ -207,16 +207,16 @@ discard block |
||
207 | 207 | // Encrypt the file |
208 | 208 | prepareFileWithDefuse( |
209 | 209 | 'encrypt', |
210 | - $SETTINGS['path_to_files_folder'] . '/' . $filename, |
|
211 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename, |
|
210 | + $SETTINGS['path_to_files_folder'].'/'.$filename, |
|
211 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename, |
|
212 | 212 | $post_option |
213 | 213 | ); |
214 | 214 | |
215 | 215 | // Do clean |
216 | - unlink($SETTINGS['path_to_files_folder'] . '/' . $filename); |
|
216 | + unlink($SETTINGS['path_to_files_folder'].'/'.$filename); |
|
217 | 217 | rename( |
218 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename, |
|
219 | - $SETTINGS['path_to_files_folder'] . '/' . $filename |
|
218 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename, |
|
219 | + $SETTINGS['path_to_files_folder'].'/'.$filename |
|
220 | 220 | ); |
221 | 221 | } |
222 | 222 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | //update LOG |
227 | 227 | logEvents($SETTINGS, 'admin_action', 'dataBase backup', (string) $session->get('user-id'), $session->get('user-login')); |
228 | 228 | |
229 | - 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"}]'; |
|
229 | + 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"}]'; |
|
230 | 230 | } |
231 | 231 | break; |
232 | 232 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | ); |
256 | 256 | break; |
257 | 257 | } |
258 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
258 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
259 | 259 | |
260 | 260 | $dataPost = explode('&', $post_option); |
261 | 261 | $file = htmlspecialchars($dataPost[0]); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | // Get filename from database |
265 | 265 | $data = DB::queryFirstRow( |
266 | 266 | 'SELECT valeur |
267 | - FROM ' . prefixTable('misc') . ' |
|
267 | + FROM ' . prefixTable('misc').' |
|
268 | 268 | WHERE increment_id = %i', |
269 | 269 | $file |
270 | 270 | ); |
@@ -283,8 +283,8 @@ discard block |
||
283 | 283 | // Decrypt the file |
284 | 284 | $ret = prepareFileWithDefuse( |
285 | 285 | 'decrypt', |
286 | - $SETTINGS['path_to_files_folder'] . '/' . $file, |
|
287 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file, |
|
286 | + $SETTINGS['path_to_files_folder'].'/'.$file, |
|
287 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file, |
|
288 | 288 | $key |
289 | 289 | ); |
290 | 290 | |
@@ -295,10 +295,10 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | // Do clean |
298 | - fileDelete($SETTINGS['path_to_files_folder'] . '/' . $file, $SETTINGS); |
|
299 | - $file = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file; |
|
298 | + fileDelete($SETTINGS['path_to_files_folder'].'/'.$file, $SETTINGS); |
|
299 | + $file = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file; |
|
300 | 300 | } else { |
301 | - $file = $SETTINGS['path_to_files_folder'] . '/' . $file; |
|
301 | + $file = $SETTINGS['path_to_files_folder'].'/'.$file; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | //read sql file |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | fclose($handle); |
316 | 316 | |
317 | 317 | //delete file |
318 | - unlink($SETTINGS['path_to_files_folder'] . '/' . $file); |
|
318 | + unlink($SETTINGS['path_to_files_folder'].'/'.$file); |
|
319 | 319 | |
320 | 320 | //Show done |
321 | 321 | echo '[{"result":"db_restore" , "message":""}]'; |
@@ -354,8 +354,8 @@ discard block |
||
354 | 354 | $tablename = (is_string($tablename) ? $tablename : strval($tablename)); |
355 | 355 | if (substr_count($tablename, DB_PREFIX) > 0) { |
356 | 356 | // launch optimization quieries |
357 | - DB::query('ANALYZE TABLE `' . $tablename . '`'); |
|
358 | - DB::query('OPTIMIZE TABLE `' . $tablename . '`'); |
|
357 | + DB::query('ANALYZE TABLE `'.$tablename.'`'); |
|
358 | + DB::query('OPTIMIZE TABLE `'.$tablename.'`'); |
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | } |
@@ -363,12 +363,12 @@ discard block |
||
363 | 363 | //Clean up LOG_ITEMS table |
364 | 364 | $rows = DB::query( |
365 | 365 | 'SELECT id |
366 | - FROM ' . prefixTable('items') . ' |
|
366 | + FROM ' . prefixTable('items').' |
|
367 | 367 | ORDER BY id ASC' |
368 | 368 | ); |
369 | 369 | foreach ($rows as $item) { |
370 | 370 | DB::query( |
371 | - 'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s', |
|
371 | + 'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s', |
|
372 | 372 | $item['id'], |
373 | 373 | 'at_creation' |
374 | 374 | ); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | if ($counter === 0) { |
377 | 377 | //Create new at_creation entry |
378 | 378 | $rowTmp = DB::queryFirstRow( |
379 | - 'SELECT date, id_user FROM ' . prefixTable('log_items') . ' WHERE id_item=%i ORDER BY date ASC', |
|
379 | + 'SELECT date, id_user FROM '.prefixTable('log_items').' WHERE id_item=%i ORDER BY date ASC', |
|
380 | 380 | $item['id'] |
381 | 381 | ); |
382 | 382 | DB::insert( |
@@ -406,8 +406,8 @@ discard block |
||
406 | 406 | echo prepareExchangedData( |
407 | 407 | array( |
408 | 408 | 'error' => false, |
409 | - 'message' => $lang->get('last_execution') . ' ' . |
|
410 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
409 | + 'message' => $lang->get('last_execution').' '. |
|
410 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
411 | 411 | '<i class="fas fa-check text-success ml-2"></i>', |
412 | 412 | ), |
413 | 413 | 'encode' |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | break; |
444 | 444 | } |
445 | 445 | |
446 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
446 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
447 | 447 | updateCacheTable('reload', NULL); |
448 | 448 | |
449 | 449 | // Log |
@@ -459,8 +459,8 @@ discard block |
||
459 | 459 | echo prepareExchangedData( |
460 | 460 | [ |
461 | 461 | 'error' => false, |
462 | - 'message' => $lang->get('last_execution') . ' ' . |
|
463 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
462 | + 'message' => $lang->get('last_execution').' '. |
|
463 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
464 | 464 | '<i class="fas fa-check text-success mr-2"></i>', |
465 | 465 | ], |
466 | 466 | 'encode' |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | $session->set('user-reencrypt_old_salt', file_get_contents(SECUREPATH.'/'.SECUREFILE)); |
503 | 503 | |
504 | 504 | // generate new saltkey |
505 | - $old_sk_filename = SECUREPATH.'/'.SECUREFILE . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))) . '.' . time(); |
|
505 | + $old_sk_filename = SECUREPATH.'/'.SECUREFILE.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).'.'.time(); |
|
506 | 506 | copy( |
507 | 507 | SECUREPATH.'/'.SECUREFILE, |
508 | 508 | $old_sk_filename |
@@ -531,13 +531,13 @@ discard block |
||
531 | 531 | logEvents($SETTINGS, 'system', 'change_salt_key', (string) $session->get('user-id'), $session->get('user-login')); |
532 | 532 | |
533 | 533 | // get number of items to change |
534 | - DB::query('SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', 0); |
|
534 | + DB::query('SELECT id FROM '.prefixTable('items').' WHERE perso = %i', 0); |
|
535 | 535 | $nb_of_items = DB::count(); |
536 | 536 | |
537 | 537 | // create backup table |
538 | - DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup')); |
|
538 | + DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup')); |
|
539 | 539 | DB::query( |
540 | - 'CREATE TABLE `' . prefixTable('sk_reencrypt_backup') . '` ( |
|
540 | + 'CREATE TABLE `'.prefixTable('sk_reencrypt_backup').'` ( |
|
541 | 541 | `id` int(12) NOT null AUTO_INCREMENT, |
542 | 542 | `current_table` varchar(100) NOT NULL, |
543 | 543 | `current_field` varchar(500) NOT NULL, |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | ); |
566 | 566 | |
567 | 567 | // delete previous backup files |
568 | - $files = glob($SETTINGS['path_to_upload_folder'] . '/*'); // get all file names |
|
568 | + $files = glob($SETTINGS['path_to_upload_folder'].'/*'); // get all file names |
|
569 | 569 | foreach ($files as $file) { // iterate files |
570 | 570 | if (is_file($file)) { |
571 | 571 | $file_parts = pathinfo($file); |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | echo prepareExchangedData( |
653 | 653 | array( |
654 | 654 | 'error' => true, |
655 | - 'message' => 'Input `' . $objects[0] . '` is not allowed', |
|
655 | + 'message' => 'Input `'.$objects[0].'` is not allowed', |
|
656 | 656 | 'nbOfItems' => '', |
657 | 657 | 'nextAction' => '', |
658 | 658 | ), |
@@ -665,9 +665,9 @@ discard block |
||
665 | 665 | //change all encrypted data in Items (passwords) |
666 | 666 | $rows = DB::query( |
667 | 667 | 'SELECT id, pw, pw_iv |
668 | - FROM ' . prefixTable('items') . ' |
|
668 | + FROM ' . prefixTable('items').' |
|
669 | 669 | WHERE perso = %s |
670 | - LIMIT ' . $post_start . ', ' . $post_length, |
|
670 | + LIMIT ' . $post_start.', '.$post_length, |
|
671 | 671 | '0' |
672 | 672 | ); |
673 | 673 | foreach ($rows as $record) { |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | 'current_field' => 'pw', |
680 | 680 | 'value_id' => $record['id'], |
681 | 681 | 'value' => $record['pw'], |
682 | - 'current_sql' => 'UPDATE ' . prefixTable('items') . " SET pw = '" . $record['pw'] . "' WHERE id = '" . $record['id'] . "';", |
|
682 | + 'current_sql' => 'UPDATE '.prefixTable('items')." SET pw = '".$record['pw']."' WHERE id = '".$record['id']."';", |
|
683 | 683 | 'value2' => 'none', |
684 | 684 | 'result' => 'none', |
685 | 685 | ) |
@@ -728,9 +728,9 @@ discard block |
||
728 | 728 | //change all encrypted data in Logs (passwords) |
729 | 729 | $rows = DB::query( |
730 | 730 | 'SELECT raison, increment_id |
731 | - FROM ' . prefixTable('log_items') . " |
|
731 | + FROM ' . prefixTable('log_items')." |
|
732 | 732 | WHERE action = %s AND raison LIKE 'at_pw :%' |
733 | - LIMIT " . $post_start . ', ' . $post_length, |
|
733 | + LIMIT " . $post_start.', '.$post_length, |
|
734 | 734 | 'at_modification' |
735 | 735 | ); |
736 | 736 | foreach ($rows as $record) { |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | 'current_field' => 'raison', |
743 | 743 | 'value_id' => $record['increment_id'], |
744 | 744 | 'value' => $record['raison'], |
745 | - 'current_sql' => 'UPDATE ' . prefixTable('log_items') . " SET raison = '" . $record['raison'] . "' WHERE increment_id = '" . $record['increment_id'] . "';", |
|
745 | + 'current_sql' => 'UPDATE '.prefixTable('log_items')." SET raison = '".$record['raison']."' WHERE increment_id = '".$record['increment_id']."';", |
|
746 | 746 | 'value2' => 'none', |
747 | 747 | 'result' => 'none', |
748 | 748 | ) |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | DB::update( |
771 | 771 | prefixTable('log_items'), |
772 | 772 | array( |
773 | - 'raison' => 'at_pw :' . $encrypt['string'], |
|
773 | + 'raison' => 'at_pw :'.$encrypt['string'], |
|
774 | 774 | 'encryption_type' => 'defuse', |
775 | 775 | ), |
776 | 776 | 'increment_id = %i', |
@@ -795,8 +795,8 @@ discard block |
||
795 | 795 | //change all encrypted data in CATEGORIES (passwords) |
796 | 796 | $rows = DB::query( |
797 | 797 | 'SELECT id, data |
798 | - FROM ' . prefixTable('categories_items') . ' |
|
799 | - LIMIT ' . $post_start . ', ' . $post_length |
|
798 | + FROM ' . prefixTable('categories_items').' |
|
799 | + LIMIT ' . $post_start.', '.$post_length |
|
800 | 800 | ); |
801 | 801 | foreach ($rows as $record) { |
802 | 802 | // backup data |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | 'current_field' => 'data', |
808 | 808 | 'value_id' => $record['id'], |
809 | 809 | 'value' => $record['data'], |
810 | - 'current_sql' => 'UPDATE ' . prefixTable('categories_items') . " SET data = '" . $record['data'] . "' WHERE id = '" . $record['id'] . "';", |
|
810 | + 'current_sql' => 'UPDATE '.prefixTable('categories_items')." SET data = '".$record['data']."' WHERE id = '".$record['id']."';", |
|
811 | 811 | 'value2' => 'none', |
812 | 812 | 'result' => 'none', |
813 | 813 | ) |
@@ -855,9 +855,9 @@ discard block |
||
855 | 855 | // Change all encrypted data in FILES (passwords) |
856 | 856 | $rows = DB::query( |
857 | 857 | 'SELECT id, file, status |
858 | - FROM ' . prefixTable('files') . " |
|
858 | + FROM ' . prefixTable('files')." |
|
859 | 859 | WHERE status = 'encrypted' |
860 | - LIMIT " . $post_start . ', ' . $post_length |
|
860 | + LIMIT " . $post_start.', '.$post_length |
|
861 | 861 | ); |
862 | 862 | foreach ($rows as $record) { |
863 | 863 | // backup data |
@@ -875,20 +875,20 @@ discard block |
||
875 | 875 | ); |
876 | 876 | $newID = DB::insertId(); |
877 | 877 | |
878 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) { |
|
878 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) { |
|
879 | 879 | // make a copy of file |
880 | 880 | if (!copy( |
881 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
882 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '.copy' |
|
881 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
882 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'.copy' |
|
883 | 883 | )) { |
884 | 884 | $error = 'Copy not possible'; |
885 | 885 | exit; |
886 | 886 | } else { |
887 | 887 | // prepare a bck of file (that will not be deleted) |
888 | - $backup_filename = $record['file'] . '.bck-change-sk.' . time(); |
|
888 | + $backup_filename = $record['file'].'.bck-change-sk.'.time(); |
|
889 | 889 | copy( |
890 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
891 | - $SETTINGS['path_to_upload_folder'] . '/' . $backup_filename |
|
890 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
891 | + $SETTINGS['path_to_upload_folder'].'/'.$backup_filename |
|
892 | 892 | ); |
893 | 893 | } |
894 | 894 | |
@@ -896,22 +896,22 @@ discard block |
||
896 | 896 | // STEP1 - Do decryption |
897 | 897 | prepareFileWithDefuse( |
898 | 898 | 'decrypt', |
899 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
900 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted' |
|
899 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
900 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted' |
|
901 | 901 | ); |
902 | 902 | |
903 | 903 | // Do cleanup of files |
904 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file']); |
|
904 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file']); |
|
905 | 905 | |
906 | 906 | // STEP2 - Do encryption |
907 | 907 | prepareFileWithDefuse( |
908 | 908 | 'encryp', |
909 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted', |
|
910 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] |
|
909 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted', |
|
910 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'] |
|
911 | 911 | ); |
912 | 912 | |
913 | 913 | // Do cleanup of files |
914 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted'); |
|
914 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted'); |
|
915 | 915 | |
916 | 916 | // Update backup table |
917 | 917 | DB::update( |
@@ -937,13 +937,13 @@ discard block |
||
937 | 937 | // do some things for new object |
938 | 938 | if (isset($objects[0])) { |
939 | 939 | if ($objects[0] === 'logs') { |
940 | - DB::query('SELECT increment_id FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
940 | + DB::query('SELECT increment_id FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
941 | 941 | } elseif ($objects[0] === 'files') { |
942 | - DB::query('SELECT id FROM ' . prefixTable('files')); |
|
942 | + DB::query('SELECT id FROM '.prefixTable('files')); |
|
943 | 943 | } elseif ($objects[0] === 'categories') { |
944 | - DB::query('SELECT id FROM ' . prefixTable('categories_items')); |
|
944 | + DB::query('SELECT id FROM '.prefixTable('categories_items')); |
|
945 | 945 | } elseif ($objects[0] === 'custfields') { |
946 | - DB::query('SELECT raison FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
946 | + DB::query('SELECT raison FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
947 | 947 | } |
948 | 948 | $nb_of_items = DB::count(); |
949 | 949 | } else { |
@@ -1063,12 +1063,12 @@ discard block |
||
1063 | 1063 | ); |
1064 | 1064 | } elseif ($record['current_table'] === 'files') { |
1065 | 1065 | // restore backup file |
1066 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value'])) { |
|
1067 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value']); |
|
1068 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) { |
|
1066 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value'])) { |
|
1067 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value']); |
|
1068 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) { |
|
1069 | 1069 | rename( |
1070 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['value2'], |
|
1071 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['value'] |
|
1070 | + $SETTINGS['path_to_upload_folder'].'/'.$record['value2'], |
|
1071 | + $SETTINGS['path_to_upload_folder'].'/'.$record['value'] |
|
1072 | 1072 | ); |
1073 | 1073 | } |
1074 | 1074 | } |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | } |
1088 | 1088 | |
1089 | 1089 | // drop table |
1090 | - DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup')); |
|
1090 | + DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup')); |
|
1091 | 1091 | |
1092 | 1092 | // Send back |
1093 | 1093 | echo prepareExchangedData( |
@@ -1130,17 +1130,17 @@ discard block |
||
1130 | 1130 | // delete files |
1131 | 1131 | $rows = DB::query( |
1132 | 1132 | 'SELECT value, value2 |
1133 | - FROM ' . prefixTable('sk_reencrypt_backup') . " |
|
1133 | + FROM ' . prefixTable('sk_reencrypt_backup')." |
|
1134 | 1134 | WHERE current_table = 'files'" |
1135 | 1135 | ); |
1136 | 1136 | foreach ($rows as $record) { |
1137 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) { |
|
1138 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value2']); |
|
1137 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) { |
|
1138 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value2']); |
|
1139 | 1139 | } |
1140 | 1140 | } |
1141 | 1141 | |
1142 | 1142 | // drop table |
1143 | - DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup')); |
|
1143 | + DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup')); |
|
1144 | 1144 | |
1145 | 1145 | echo '[{"status":"done"}]'; |
1146 | 1146 | break; |
@@ -1171,7 +1171,7 @@ discard block |
||
1171 | 1171 | 'encode' |
1172 | 1172 | ); |
1173 | 1173 | } else { |
1174 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1174 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1175 | 1175 | |
1176 | 1176 | //send email |
1177 | 1177 | $emailSettings = new EmailSettings($SETTINGS); |
@@ -1209,13 +1209,13 @@ discard block |
||
1209 | 1209 | break; |
1210 | 1210 | } |
1211 | 1211 | |
1212 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1212 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1213 | 1213 | $emailSettings = new EmailSettings($SETTINGS); |
1214 | 1214 | $emailService = new EmailService(); |
1215 | 1215 | |
1216 | 1216 | $rows = DB::query( |
1217 | 1217 | 'SELECT * |
1218 | - FROM ' . prefixTable('emails') . ' |
|
1218 | + FROM ' . prefixTable('emails').' |
|
1219 | 1219 | WHERE status = %s OR status = %s', |
1220 | 1220 | 'not_sent', |
1221 | 1221 | '' |
@@ -1301,13 +1301,13 @@ discard block |
||
1301 | 1301 | break; |
1302 | 1302 | } |
1303 | 1303 | |
1304 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1304 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1305 | 1305 | |
1306 | 1306 | // Instatiate email settings and service |
1307 | 1307 | $emailSettings = new EmailSettings($SETTINGS); |
1308 | 1308 | $emailService = new EmailService(); |
1309 | 1309 | |
1310 | - $rows = DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
1310 | + $rows = DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
1311 | 1311 | foreach ($rows as $record) { |
1312 | 1312 | //send email |
1313 | 1313 | $email = $emailService->sendMail( |
@@ -1376,7 +1376,7 @@ discard block |
||
1376 | 1376 | break; |
1377 | 1377 | } |
1378 | 1378 | |
1379 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1379 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1380 | 1380 | |
1381 | 1381 | // init |
1382 | 1382 | $filesList = array(); |
@@ -1389,7 +1389,7 @@ discard block |
||
1389 | 1389 | FROM ' . prefixTable('files') |
1390 | 1390 | ); |
1391 | 1391 | foreach ($rows as $record) { |
1392 | - if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) { |
|
1392 | + if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) { |
|
1393 | 1393 | $addFile = false; |
1394 | 1394 | if (($post_option === 'attachments-decrypt' && $record['status'] === 'encrypted') |
1395 | 1395 | || ($post_option === 'attachments-encrypt' && $record['status'] === 'clear') |
@@ -1454,8 +1454,8 @@ discard block |
||
1454 | 1454 | $post_list = filter_var_array($post_list, FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
1455 | 1455 | $post_counter = filter_var($post_counter, FILTER_SANITIZE_NUMBER_INT); |
1456 | 1456 | |
1457 | - include $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
1458 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1457 | + include $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
1458 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1459 | 1459 | |
1460 | 1460 | $cpt = 0; |
1461 | 1461 | $continu = true; |
@@ -1468,33 +1468,33 @@ discard block |
||
1468 | 1468 | // Get file name |
1469 | 1469 | $file_info = DB::queryFirstRow( |
1470 | 1470 | 'SELECT file |
1471 | - FROM ' . prefixTable('files') . ' |
|
1471 | + FROM ' . prefixTable('files').' |
|
1472 | 1472 | WHERE id = %i', |
1473 | 1473 | $file |
1474 | 1474 | ); |
1475 | 1475 | |
1476 | 1476 | // skip file is Coherancey not respected |
1477 | - if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'])) { |
|
1477 | + if (is_file($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'])) { |
|
1478 | 1478 | // Case where we want to decrypt |
1479 | 1479 | if ($post_option === 'decrypt') { |
1480 | 1480 | prepareFileWithDefuse( |
1481 | 1481 | 'decrypt', |
1482 | - $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], |
|
1483 | - $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'], |
|
1482 | + $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], |
|
1483 | + $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'], |
|
1484 | 1484 | ); |
1485 | 1485 | // Case where we want to encrypt |
1486 | 1486 | } elseif ($post_option === 'encrypt') { |
1487 | 1487 | prepareFileWithDefuse( |
1488 | 1488 | 'encrypt', |
1489 | - $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], |
|
1490 | - $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'], |
|
1489 | + $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], |
|
1490 | + $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'], |
|
1491 | 1491 | ); |
1492 | 1492 | } |
1493 | 1493 | // Do file cleanup |
1494 | - fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], $SETTINGS); |
|
1494 | + fileDelete($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], $SETTINGS); |
|
1495 | 1495 | rename( |
1496 | - $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'], |
|
1497 | - $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'] |
|
1496 | + $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'], |
|
1497 | + $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'] |
|
1498 | 1498 | ); |
1499 | 1499 | |
1500 | 1500 | // store in DB |
@@ -1529,8 +1529,8 @@ discard block |
||
1529 | 1529 | $post_option === 'attachments-decrypt' ? 'clear' : 'encrypted' |
1530 | 1530 | ); |
1531 | 1531 | |
1532 | - $message = $lang->get('last_execution') . ' ' . |
|
1533 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
1532 | + $message = $lang->get('last_execution').' '. |
|
1533 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
1534 | 1534 | '<i class="fas fa-check text-success ml-2 mr-3"></i>'; |
1535 | 1535 | } |
1536 | 1536 | |
@@ -1624,7 +1624,7 @@ discard block |
||
1624 | 1624 | $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_NUMBER_INT); |
1625 | 1625 | |
1626 | 1626 | DB::query( |
1627 | - 'DELETE FROM ' . prefixTable('api') . ' WHERE increment_id = %i', |
|
1627 | + 'DELETE FROM '.prefixTable('api').' WHERE increment_id = %i', |
|
1628 | 1628 | $post_id |
1629 | 1629 | ); |
1630 | 1630 | } |
@@ -1719,7 +1719,7 @@ discard block |
||
1719 | 1719 | // Delete existing key |
1720 | 1720 | } elseif (null !== $post_action && $post_action === 'delete') { |
1721 | 1721 | $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
1722 | - DB::query('DELETE FROM ' . prefixTable('api') . ' WHERE increment_id=%i', $post_id); |
|
1722 | + DB::query('DELETE FROM '.prefixTable('api').' WHERE increment_id=%i', $post_id); |
|
1723 | 1723 | } |
1724 | 1724 | |
1725 | 1725 | echo prepareExchangedData( |
@@ -1734,7 +1734,7 @@ discard block |
||
1734 | 1734 | |
1735 | 1735 | case 'save_api_status': |
1736 | 1736 | // Do query |
1737 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'api'); |
|
1737 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'api'); |
|
1738 | 1738 | $counter = DB::count(); |
1739 | 1739 | if ($counter === 0) { |
1740 | 1740 | DB::insert( |
@@ -1763,7 +1763,7 @@ discard block |
||
1763 | 1763 | |
1764 | 1764 | case 'run_duo_config_check': |
1765 | 1765 | //Libraries call |
1766 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
1766 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
1767 | 1767 | // Check KEY |
1768 | 1768 | if ($post_key !== $session->get('key')) { |
1769 | 1769 | echo prepareExchangedData( |
@@ -1869,7 +1869,7 @@ discard block |
||
1869 | 1869 | } else { |
1870 | 1870 | $tmp = 1; |
1871 | 1871 | } |
1872 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication'); |
|
1872 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication'); |
|
1873 | 1873 | $counter = DB::count(); |
1874 | 1874 | if ($counter === 0) { |
1875 | 1875 | DB::insert( |
@@ -1897,7 +1897,7 @@ discard block |
||
1897 | 1897 | |
1898 | 1898 | // ga_website_name |
1899 | 1899 | if (is_null($dataReceived['ga_website_name']) === false) { |
1900 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name'); |
|
1900 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name'); |
|
1901 | 1901 | $counter = DB::count(); |
1902 | 1902 | if ($counter === 0) { |
1903 | 1903 | DB::insert( |
@@ -1927,7 +1927,7 @@ discard block |
||
1927 | 1927 | } |
1928 | 1928 | |
1929 | 1929 | // send data |
1930 | - echo '[{"result" : "' . addslashes($lang['done']) . '" , "error" : ""}]'; |
|
1930 | + echo '[{"result" : "'.addslashes($lang['done']).'" , "error" : ""}]'; |
|
1931 | 1931 | break; |
1932 | 1932 | |
1933 | 1933 | case 'save_agses_options': |
@@ -1950,7 +1950,7 @@ discard block |
||
1950 | 1950 | |
1951 | 1951 | // agses_hosted_url |
1952 | 1952 | if (!is_null($dataReceived['agses_hosted_url'])) { |
1953 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url'); |
|
1953 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url'); |
|
1954 | 1954 | $counter = DB::count(); |
1955 | 1955 | if ($counter === 0) { |
1956 | 1956 | DB::insert( |
@@ -1981,7 +1981,7 @@ discard block |
||
1981 | 1981 | |
1982 | 1982 | // agses_hosted_id |
1983 | 1983 | if (!is_null($dataReceived['agses_hosted_id'])) { |
1984 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id'); |
|
1984 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id'); |
|
1985 | 1985 | $counter = DB::count(); |
1986 | 1986 | if ($counter === 0) { |
1987 | 1987 | DB::insert( |
@@ -2012,7 +2012,7 @@ discard block |
||
2012 | 2012 | |
2013 | 2013 | // agses_hosted_apikey |
2014 | 2014 | if (!is_null($dataReceived['agses_hosted_apikey'])) { |
2015 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey'); |
|
2015 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey'); |
|
2016 | 2016 | $counter = DB::count(); |
2017 | 2017 | if ($counter === 0) { |
2018 | 2018 | DB::insert( |
@@ -2042,7 +2042,7 @@ discard block |
||
2042 | 2042 | } |
2043 | 2043 | |
2044 | 2044 | // send data |
2045 | - echo '[{"result" : "' . addslashes($lang['done']) . '" , "error" : ""}]'; |
|
2045 | + echo '[{"result" : "'.addslashes($lang['done']).'" , "error" : ""}]'; |
|
2046 | 2046 | break; |
2047 | 2047 | |
2048 | 2048 | case 'save_option_change': |
@@ -2082,7 +2082,7 @@ discard block |
||
2082 | 2082 | |
2083 | 2083 | // Check if setting is already in DB. If NO then insert, if YES then update. |
2084 | 2084 | $data = DB::query( |
2085 | - 'SELECT * FROM ' . prefixTable('misc') . ' |
|
2085 | + 'SELECT * FROM '.prefixTable('misc').' |
|
2086 | 2086 | WHERE type = %s AND intitule = %s', |
2087 | 2087 | 'admin', |
2088 | 2088 | $post_field |
@@ -2105,7 +2105,7 @@ discard block |
||
2105 | 2105 | array( |
2106 | 2106 | 'valeur' => time(), |
2107 | 2107 | 'type' => 'admin', |
2108 | - 'intitule' => $post_field . '_time', |
|
2108 | + 'intitule' => $post_field.'_time', |
|
2109 | 2109 | 'updated_at' => time(), |
2110 | 2110 | ) |
2111 | 2111 | ); |
@@ -2127,10 +2127,10 @@ discard block |
||
2127 | 2127 | if ($post_field === 'send_stats') { |
2128 | 2128 | // Check if previous time exists, if not them insert this value in DB |
2129 | 2129 | DB::query( |
2130 | - 'SELECT * FROM ' . prefixTable('misc') . ' |
|
2130 | + 'SELECT * FROM '.prefixTable('misc').' |
|
2131 | 2131 | WHERE type = %s AND intitule = %s', |
2132 | 2132 | 'admin', |
2133 | - $post_field . '_time' |
|
2133 | + $post_field.'_time' |
|
2134 | 2134 | ); |
2135 | 2135 | $counter = DB::count(); |
2136 | 2136 | if ($counter === 0) { |
@@ -2139,7 +2139,7 @@ discard block |
||
2139 | 2139 | array( |
2140 | 2140 | 'valeur' => 0, |
2141 | 2141 | 'type' => 'admin', |
2142 | - 'intitule' => $post_field . '_time', |
|
2142 | + 'intitule' => $post_field.'_time', |
|
2143 | 2143 | 'created_at' => time(), |
2144 | 2144 | ) |
2145 | 2145 | ); |
@@ -2161,13 +2161,13 @@ discard block |
||
2161 | 2161 | // special Cases |
2162 | 2162 | if ($post_field === 'cpassman_url') { |
2163 | 2163 | // update also jsUrl for CSFP protection |
2164 | - $jsUrl = $post_value . '/includes/libraries/csrfp/js/csrfprotector.js'; |
|
2164 | + $jsUrl = $post_value.'/includes/libraries/csrfp/js/csrfprotector.js'; |
|
2165 | 2165 | $csrfp_file = '../includes/libraries/csrfp/libs/csrfp.config.php'; |
2166 | 2166 | $data = file_get_contents($csrfp_file); |
2167 | 2167 | $posJsUrl = strpos($data, '"jsUrl" => "'); |
2168 | 2168 | $posEndLine = strpos($data, '",', $posJsUrl); |
2169 | 2169 | $line = substr($data, $posJsUrl, ($posEndLine - $posJsUrl + 2)); |
2170 | - $newdata = str_replace($line, '"jsUrl" => "' . filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . '",', $data); |
|
2170 | + $newdata = str_replace($line, '"jsUrl" => "'.filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS).'",', $data); |
|
2171 | 2171 | file_put_contents($csrfp_file, $newdata); |
2172 | 2172 | } elseif ($post_field === 'restricted_to_input' && (int) $post_value === 0) { |
2173 | 2173 | DB::update( |
@@ -2192,7 +2192,7 @@ discard block |
||
2192 | 2192 | echo prepareExchangedData( |
2193 | 2193 | array( |
2194 | 2194 | 'error' => false, |
2195 | - 'misc' => $counter . ' ; ' . $SETTINGS[$post_field], |
|
2195 | + 'misc' => $counter.' ; '.$SETTINGS[$post_field], |
|
2196 | 2196 | 'message' => empty($post_translate) === false ? $lang->get($post_translate) : '', |
2197 | 2197 | ), |
2198 | 2198 | 'encode' |
@@ -2235,7 +2235,7 @@ discard block |
||
2235 | 2235 | |
2236 | 2236 | // send statistics |
2237 | 2237 | if (null !== $post_status) { |
2238 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_stats'); |
|
2238 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_stats'); |
|
2239 | 2239 | $counter = DB::count(); |
2240 | 2240 | if ($counter === 0) { |
2241 | 2241 | DB::insert( |
@@ -2266,7 +2266,7 @@ discard block |
||
2266 | 2266 | |
2267 | 2267 | // send statistics items |
2268 | 2268 | if (null !== $post_list) { |
2269 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items'); |
|
2269 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items'); |
|
2270 | 2270 | $counter = DB::count(); |
2271 | 2271 | if ($counter === 0) { |
2272 | 2272 | DB::insert( |
@@ -2312,7 +2312,7 @@ discard block |
||
2312 | 2312 | break; |
2313 | 2313 | } |
2314 | 2314 | |
2315 | - if (DB::query("SHOW TABLES LIKE '" . prefixTable('sk_reencrypt_backup') . "'")) { |
|
2315 | + if (DB::query("SHOW TABLES LIKE '".prefixTable('sk_reencrypt_backup')."'")) { |
|
2316 | 2316 | if (DB::count() === 1) { |
2317 | 2317 | echo 1; |
2318 | 2318 | } else { |
@@ -2350,7 +2350,7 @@ discard block |
||
2350 | 2350 | |
2351 | 2351 | $rows = DB::query( |
2352 | 2352 | 'SELECT id, title |
2353 | - FROM ' . prefixTable('roles_title') . ' |
|
2353 | + FROM ' . prefixTable('roles_title').' |
|
2354 | 2354 | ORDER BY title ASC' |
2355 | 2355 | ); |
2356 | 2356 | foreach ($rows as $record) { |
@@ -2473,7 +2473,7 @@ discard block |
||
2473 | 2473 | |
2474 | 2474 | $ignoredFiles = DB::queryFirstField( |
2475 | 2475 | 'SELECT valeur |
2476 | - FROM ' . prefixTable('misc') . ' |
|
2476 | + FROM ' . prefixTable('misc').' |
|
2477 | 2477 | WHERE type = %s AND intitule = %s', |
2478 | 2478 | 'admin', |
2479 | 2479 | 'ignored_unknown_files' |
@@ -2516,7 +2516,7 @@ discard block |
||
2516 | 2516 | // Get ignored unknown files |
2517 | 2517 | $existingData = DB::queryFirstRow( |
2518 | 2518 | 'SELECT valeur |
2519 | - FROM ' . prefixTable('misc') . ' |
|
2519 | + FROM ' . prefixTable('misc').' |
|
2520 | 2520 | WHERE type = %s AND intitule = %s', |
2521 | 2521 | 'admin', |
2522 | 2522 | 'ignored_unknown_files' |
@@ -2573,7 +2573,7 @@ discard block |
||
2573 | 2573 | // Get the list of files to delete |
2574 | 2574 | $filesToDelete = DB::queryFirstField( |
2575 | 2575 | 'SELECT valeur |
2576 | - FROM ' . prefixTable('misc') . ' |
|
2576 | + FROM ' . prefixTable('misc').' |
|
2577 | 2577 | WHERE type = %s AND intitule = %s', |
2578 | 2578 | 'admin', |
2579 | 2579 | 'unknown_files' |
@@ -2620,7 +2620,7 @@ discard block |
||
2620 | 2620 | $lang = new Language($session->get('user-language') ?? 'english'); |
2621 | 2621 | |
2622 | 2622 | $results = []; |
2623 | - $fullPath = __DIR__ . '/../'; |
|
2623 | + $fullPath = __DIR__.'/../'; |
|
2624 | 2624 | |
2625 | 2625 | foreach ($files as $file) { |
2626 | 2626 | // Normalize path separators for cross-platform compatibility |
@@ -2669,7 +2669,7 @@ discard block |
||
2669 | 2669 | } |
2670 | 2670 | |
2671 | 2671 | // Try to delete the file |
2672 | - $deleteResult = '';//@unlink($normalizedPath); |
|
2672 | + $deleteResult = ''; //@unlink($normalizedPath); |
|
2673 | 2673 | |
2674 | 2674 | if ($deleteResult) { |
2675 | 2675 | $results[$normalizedPath] = [ |
@@ -2699,7 +2699,7 @@ discard block |
||
2699 | 2699 | */ |
2700 | 2700 | function filesIntegrityCheck($baseDir): array |
2701 | 2701 | { |
2702 | - $referenceFile = __DIR__ . '/../files_reference.txt'; |
|
2702 | + $referenceFile = __DIR__.'/../files_reference.txt'; |
|
2703 | 2703 | |
2704 | 2704 | $unknownFiles = findUnknownFiles($baseDir, $referenceFile); |
2705 | 2705 | |
@@ -2737,7 +2737,7 @@ discard block |
||
2737 | 2737 | $dir, |
2738 | 2738 | FilesystemIterator::SKIP_DOTS |
2739 | 2739 | ), |
2740 | - function ($current, $key, $iterator) { |
|
2740 | + function($current, $key, $iterator) { |
|
2741 | 2741 | // Ignore hidden files and folders |
2742 | 2742 | if ($current->getFilename()[0] === '.') { |
2743 | 2743 | return false; |
@@ -2751,7 +2751,7 @@ discard block |
||
2751 | 2751 | foreach ($iterator as $file) { |
2752 | 2752 | try { |
2753 | 2753 | if ($file->isFile()) { |
2754 | - $relativePath = str_replace($dir . DIRECTORY_SEPARATOR, '', $file->getPathname()); |
|
2754 | + $relativePath = str_replace($dir.DIRECTORY_SEPARATOR, '', $file->getPathname()); |
|
2755 | 2755 | $relativePath = str_replace('\\', '/', $relativePath); // Normalisation Windows/Linux |
2756 | 2756 | |
2757 | 2757 | // Split relatif path into parts |
@@ -2817,7 +2817,7 @@ discard block |
||
2817 | 2817 | // Get ignored files |
2818 | 2818 | $ignoredFiles = DB::queryFirstField( |
2819 | 2819 | 'SELECT valeur |
2820 | - FROM ' . prefixTable('misc') . ' |
|
2820 | + FROM ' . prefixTable('misc').' |
|
2821 | 2821 | WHERE type = %s AND intitule = %s', |
2822 | 2822 | 'admin', |
2823 | 2823 | 'ignored_unknown_files' |
@@ -2836,7 +2836,7 @@ discard block |
||
2836 | 2836 | function tablesIntegrityCheck(): array |
2837 | 2837 | { |
2838 | 2838 | // Get integrity tables file |
2839 | - $integrityTablesFile = TEAMPASS_ROOT_PATH . '/includes/tables_integrity.json'; |
|
2839 | + $integrityTablesFile = TEAMPASS_ROOT_PATH.'/includes/tables_integrity.json'; |
|
2840 | 2840 | if (file_exists($integrityTablesFile) === false) { |
2841 | 2841 | return [ |
2842 | 2842 | 'error' => true, |
@@ -2854,7 +2854,7 @@ discard block |
||
2854 | 2854 | // Get all tables |
2855 | 2855 | $tables = []; |
2856 | 2856 | foreach (DB::queryFirstColumn("SHOW TABLES") as $table) { |
2857 | - $tables[] = str_replace(DB_PREFIX, "", $table);; |
|
2857 | + $tables[] = str_replace(DB_PREFIX, "", $table); ; |
|
2858 | 2858 | } |
2859 | 2859 | // Prepare the integrity check |
2860 | 2860 | $tablesInError = []; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) { |
69 | 69 | // Not allowed page |
70 | 70 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
71 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
71 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
72 | 72 | exit; |
73 | 73 | } |
74 | 74 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | // error |
170 | 170 | toastr.remove(); |
171 | 171 | toastr.error( |
172 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
172 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
173 | 173 | '', { |
174 | 174 | closeButton: true, |
175 | 175 | positionClass: 'toast-bottom-right' |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | // error |
249 | 249 | toastr.remove(); |
250 | 250 | toastr.error( |
251 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
251 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
252 | 252 | '', { |
253 | 253 | closeButton: true, |
254 | 254 | positionClass: 'toast-bottom-right' |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | // error |
311 | 311 | toastr.remove(); |
312 | 312 | toastr.error( |
313 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
313 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
314 | 314 | '', { |
315 | 315 | closeButton: true, |
316 | 316 | positionClass: 'toast-bottom-right' |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | // error |
405 | 405 | toastr.remove(); |
406 | 406 | toastr.error( |
407 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
407 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
408 | 408 | '', { |
409 | 409 | closeButton: true, |
410 | 410 | positionClass: 'toast-bottom-right' |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | |
434 | 434 | //const className = result.success ? 'success' : 'error'; |
435 | 435 | const icon = result.success ? '<i class="fa-solid fa-check text-success mr-1"></i>' : '<i class="fa-solid fa-xmark text-danger mr-1"></i>'; |
436 | - const message = result.success ? '<?php echo $lang->get('server_returned_data');?>' : 'Error: ' + result.error; |
|
436 | + const message = result.success ? '<?php echo $lang->get('server_returned_data'); ?>' : 'Error: ' + result.error; |
|
437 | 437 | |
438 | 438 | output += '<li>' + icon + '<b>' + file + '</b><br/>' + message + '</li>'; |
439 | 439 | }); |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | // error |
465 | 465 | toastr.remove(); |
466 | 466 | toastr.error( |
467 | - '<?php echo $lang->get('server_answer_error') . '<br />' . $lang->get('server_returned_data') . ':<br />'; ?>' + data.error, |
|
467 | + '<?php echo $lang->get('server_answer_error').'<br />'.$lang->get('server_returned_data').':<br />'; ?>' + data.error, |
|
468 | 468 | '', { |
469 | 469 | closeButton: true, |
470 | 470 | positionClass: 'toast-bottom-right' |
@@ -28,8 +28,8 @@ |
||
28 | 28 | * @see https://www.teampass.net |
29 | 29 | */ |
30 | 30 | |
31 | - // TO REMOVE |
|
32 | - // - selected_items_to_be_imported |
|
31 | + // TO REMOVE |
|
32 | + // - selected_items_to_be_imported |
|
33 | 33 | |
34 | 34 | return array( |
35 | 35 | 'newly_created_user_belongs_to_role' => 'Newly created user belongs to role', |