@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ) { |
80 | 80 | // Not allowed page |
81 | 81 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
82 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
82 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
83 | 83 | exit; |
84 | 84 | } |
85 | 85 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | ); |
168 | 168 | |
169 | 169 | // Initialisation |
170 | - $file = $SETTINGS['path_to_files_folder'] . '/' . $data['valeur']; |
|
170 | + $file = $SETTINGS['path_to_files_folder'].'/'.$data['valeur']; |
|
171 | 171 | $importation_possible = true; |
172 | 172 | $valuesToImport = []; |
173 | 173 | $items_number = 0; |
@@ -224,26 +224,26 @@ discard block |
||
224 | 224 | 'ISO-8859-1', |
225 | 225 | 'ISO-8859-15', |
226 | 226 | 'Windows-1252', |
227 | - 'Windows-1251', // Cyrillique |
|
228 | - 'CP1251', // Cyrillique alternatif |
|
229 | - 'KOI8-R', // Cyrillique russe |
|
230 | - 'Shift_JIS', // Japonais |
|
231 | - 'EUC-JP', // Japonais |
|
232 | - 'ISO-2022-JP', // Japonais |
|
233 | - 'TIS-620', // ThaĂŻ |
|
234 | - 'Windows-874', // ThaĂŻ Windows |
|
235 | - 'Big5', // Chinois traditionnel |
|
236 | - 'GB2312', // Chinois simplifié |
|
237 | - 'GBK', // Chinois simplifié étendu |
|
238 | - 'EUC-KR', // Coréen |
|
239 | - 'ISO-8859-2', // Europe centrale |
|
240 | - 'ISO-8859-5', // Cyrillique ISO |
|
241 | - 'ISO-8859-7', // Grec |
|
242 | - 'Windows-1250', // Europe centrale |
|
243 | - 'Windows-1253', // Grec |
|
244 | - 'Windows-1254', // Turc |
|
245 | - 'Windows-1255', // Hébreu |
|
246 | - 'Windows-1256', // Arabe |
|
227 | + 'Windows-1251', // Cyrillique |
|
228 | + 'CP1251', // Cyrillique alternatif |
|
229 | + 'KOI8-R', // Cyrillique russe |
|
230 | + 'Shift_JIS', // Japonais |
|
231 | + 'EUC-JP', // Japonais |
|
232 | + 'ISO-2022-JP', // Japonais |
|
233 | + 'TIS-620', // ThaĂŻ |
|
234 | + 'Windows-874', // ThaĂŻ Windows |
|
235 | + 'Big5', // Chinois traditionnel |
|
236 | + 'GB2312', // Chinois simplifié |
|
237 | + 'GBK', // Chinois simplifié étendu |
|
238 | + 'EUC-KR', // Coréen |
|
239 | + 'ISO-8859-2', // Europe centrale |
|
240 | + 'ISO-8859-5', // Cyrillique ISO |
|
241 | + 'ISO-8859-7', // Grec |
|
242 | + 'Windows-1250', // Europe centrale |
|
243 | + 'Windows-1253', // Grec |
|
244 | + 'Windows-1254', // Turc |
|
245 | + 'Windows-1255', // Hébreu |
|
246 | + 'Windows-1256', // Arabe |
|
247 | 247 | ]; |
248 | 248 | |
249 | 249 | // Get the list of encodings supported by the system |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | // Get the data and ensure columns are correctly mapped |
288 | 288 | $interpreter = new Interpreter(); |
289 | - $interpreter->addObserver(function (array $row) use (&$valuesToImport, $header) { |
|
289 | + $interpreter->addObserver(function(array $row) use (&$valuesToImport, $header) { |
|
290 | 290 | $rowData = array_combine($header, $row); |
291 | 291 | |
292 | 292 | if ($rowData !== false) { |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | // Handle multiple lignes description |
340 | 340 | if (strpos($comments, '<br>') !== false || strpos($label, '<br>') !== false) { |
341 | 341 | $continue_on_next_line = true; |
342 | - $comment .= " " . $label . " " . $comments; |
|
342 | + $comment .= " ".$label." ".$comments; |
|
343 | 343 | } else { |
344 | 344 | // Insert previous line if changing line |
345 | 345 | if (!empty($label)) { |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | // Insert in batch |
349 | 349 | $batchInsert[] = array( |
350 | 350 | 'label' => $label, |
351 | - 'description' => $comment . $comments, |
|
351 | + 'description' => $comment.$comments, |
|
352 | 352 | 'pwd' => $pwd, |
353 | 353 | 'url' => $url, |
354 | 354 | 'folder' => ((int) $session->get('user-admin') === 1 || (int) $session->get('user-manager') === 1 || (int) $session->get('user-can_manage_all_users') === 1) ? $folder : '', |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | // Insert in batch |
380 | 380 | $batchInsert[] = array( |
381 | 381 | 'label' => $label, |
382 | - 'description' => $comment . $comments, |
|
382 | + 'description' => $comment.$comments, |
|
383 | 383 | 'pwd' => $pwd, |
384 | 384 | 'url' => $url, |
385 | 385 | 'folder' => ((int) $session->get('user-admin') === 1 || (int) $session->get('user-manager') === 1 || (int) $session->get('user-can_manage_all_users') === 1) ? $folder : '', |
@@ -403,10 +403,10 @@ discard block |
||
403 | 403 | $values = []; |
404 | 404 | |
405 | 405 | foreach ($batchInsert as $data) { |
406 | - $values[] = "('" . implode("','", array_map('addslashes', $data)) . "')"; |
|
406 | + $values[] = "('".implode("','", array_map('addslashes', $data))."')"; |
|
407 | 407 | } |
408 | 408 | |
409 | - $sql = "INSERT INTO `$tableName` (`label`, `description`, `pwd`, `url`, `folder`, `login`, `operation_id`) VALUES " . implode(',', $values); |
|
409 | + $sql = "INSERT INTO `$tableName` (`label`, `description`, `pwd`, `url`, `folder`, `login`, `operation_id`) VALUES ".implode(',', $values); |
|
410 | 410 | |
411 | 411 | DB::query($sql); |
412 | 412 | } |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $parentId = $dataReceived['folderId']; // Strating with provided folder |
490 | 490 | |
491 | 491 | foreach ($parts as $part) { |
492 | - $currentPath = trim($currentPath . "/" . $part, "/"); |
|
492 | + $currentPath = trim($currentPath."/".$part, "/"); |
|
493 | 493 | $currentFolder = $part; |
494 | 494 | |
495 | 495 | // Check if this folder has already been created |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | // Get ID of existing folder |
551 | 551 | $ret = DB::queryFirstRow( |
552 | 552 | 'SELECT * |
553 | - FROM ' . prefixTable('nested_tree') . ' |
|
553 | + FROM ' . prefixTable('nested_tree').' |
|
554 | 554 | WHERE title = %s', |
555 | 555 | $currentFolder |
556 | 556 | ); |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | ); |
686 | 686 | $newId = DB::insertId(); |
687 | 687 | |
688 | - error_log('New item created with ID: ' . $newId); |
|
688 | + error_log('New item created with ID: '.$newId); |
|
689 | 689 | |
690 | 690 | // Create new task for the new item |
691 | 691 | // If it is not a personnal one |
@@ -1074,7 +1074,7 @@ discard block |
||
1074 | 1074 | ]; |
1075 | 1075 | $startPathLevel = 1; |
1076 | 1076 | |
1077 | - foreach($post_folders as $folder) { |
|
1077 | + foreach ($post_folders as $folder) { |
|
1078 | 1078 | // get parent id |
1079 | 1079 | $parentId = $arrFolders[$folder['parentFolderId']]; |
1080 | 1080 | |
@@ -1145,7 +1145,7 @@ discard block |
||
1145 | 1145 | DB::startTransaction(); |
1146 | 1146 | |
1147 | 1147 | // Import all items |
1148 | - foreach($post_items as $item) { |
|
1148 | + foreach ($post_items as $item) { |
|
1149 | 1149 | // get info about this folder |
1150 | 1150 | $destinationFolderMore = DB::queryFirstRow( |
1151 | 1151 | 'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | 'pw' => $cryptedStuff['encrypted'], |
1177 | 1177 | 'pw_iv' => '', |
1178 | 1178 | 'url' => substr($item['URL'], 0, 500), |
1179 | - 'id_tree' => isset($post_folders[$item['parentFolderId']]['id']) ? (int)$post_folders[$item['parentFolderId']]['id'] : 0, |
|
1179 | + 'id_tree' => isset($post_folders[$item['parentFolderId']]['id']) ? (int) $post_folders[$item['parentFolderId']]['id'] : 0, |
|
1180 | 1180 | 'login' => substr($item['UserName'], 0, 500), |
1181 | 1181 | 'anyone_can_modify' => $$inputData['editAll'], |
1182 | 1182 | 'encryption_type' => 'teampass_aes', |
@@ -1370,7 +1370,7 @@ discard block |
||
1370 | 1370 | ]; |
1371 | 1371 | } |
1372 | 1372 | |
1373 | -spl_autoload_register(function ($class) { |
|
1373 | +spl_autoload_register(function($class) { |
|
1374 | 1374 | $prefix = 'League\\Csv\\'; |
1375 | 1375 | $base_dir = __DIR__.'/src/'; |
1376 | 1376 | $len = strlen($prefix); |