@@ -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 | if (!isset($arrFolders[$folder['parentFolderId']])) { |
| 1080 | 1080 | // If parent folder is not in the array, it means it is the destination folder |
@@ -1150,7 +1150,7 @@ discard block |
||
| 1150 | 1150 | DB::startTransaction(); |
| 1151 | 1151 | |
| 1152 | 1152 | // Import all items |
| 1153 | - foreach($post_items as $item) { |
|
| 1153 | + foreach ($post_items as $item) { |
|
| 1154 | 1154 | // get info about this folder |
| 1155 | 1155 | $destinationFolderMore = DB::queryFirstRow( |
| 1156 | 1156 | 'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | 'pw' => $cryptedStuff['encrypted'], |
| 1182 | 1182 | 'pw_iv' => '', |
| 1183 | 1183 | 'url' => substr($item['URL'], 0, 500), |
| 1184 | - 'id_tree' => isset($post_folders[$item['parentFolderId']]['id']) ? (int)$post_folders[$item['parentFolderId']]['id'] : 0, |
|
| 1184 | + 'id_tree' => isset($post_folders[$item['parentFolderId']]['id']) ? (int) $post_folders[$item['parentFolderId']]['id'] : 0, |
|
| 1185 | 1185 | 'login' => substr($item['UserName'], 0, 500), |
| 1186 | 1186 | 'anyone_can_modify' => $$inputData['editAll'], |
| 1187 | 1187 | 'encryption_type' => 'teampass_aes', |
@@ -1316,7 +1316,7 @@ discard block |
||
| 1316 | 1316 | |
| 1317 | 1317 | //For each role to which the user depends on, add the folder just created. |
| 1318 | 1318 | // (if not personal, otherwise, add to user-personal_folders) |
| 1319 | - if ( $isPersonalFolder ) { |
|
| 1319 | + if ($isPersonalFolder) { |
|
| 1320 | 1320 | SessionManager::addRemoveFromSessionArray('user-personal_folders', [$id], 'add'); |
| 1321 | 1321 | } else { |
| 1322 | 1322 | foreach ($session->get('system-array_roles') as $role) { |
@@ -1387,7 +1387,7 @@ discard block |
||
| 1387 | 1387 | ]; |
| 1388 | 1388 | } |
| 1389 | 1389 | |
| 1390 | -spl_autoload_register(function ($class) { |
|
| 1390 | +spl_autoload_register(function($class) { |
|
| 1391 | 1391 | $prefix = 'League\\Csv\\'; |
| 1392 | 1392 | $base_dir = __DIR__.'/src/'; |
| 1393 | 1393 | $len = strlen($prefix); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('import') === false) { |
| 73 | 73 | // Not allowed page |
| 74 | 74 | $session->set('system-error_code', ERR_NOT_ALLOWED); |
| 75 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 75 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 76 | 76 | exit; |
| 77 | 77 | } |
| 78 | 78 | ?> |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | // Isolate first item |
| 972 | 972 | if (itemsList.length > 0) { |
| 973 | 973 | $('#import-feedback-progress-text') |
| 974 | - .html('<i class="fa-solid fa-cog fa-spin ml-4 mr-2"></i><?php echo $lang->get('operation_progress');?> ('+((counter*100)/itemsNumber).toFixed(2)+'%) - <i id="item-title"></i>'); |
|
| 974 | + .html('<i class="fa-solid fa-cog fa-spin ml-4 mr-2"></i><?php echo $lang->get('operation_progress'); ?> ('+((counter*100)/itemsNumber).toFixed(2)+'%) - <i id="item-title"></i>'); |
|
| 975 | 975 | |
| 976 | 976 | // XSS Filtering : |
| 977 | 977 | //$('#import-feedback-progress-text').text(itemsList[0].Title); |