<body> </body> </html> <?php } else { $filePaths = array(); if (isset($_GET["grouped"])) { if (isset($_POST['selection'])) { foreach ($_POST['selection'] as $md5) { $filePaths[] = getPathForMD5Chain(DOWNLOADS_DIR, $md5); } } else { throw new Exception("No selection provided."); } } else { $filePaths[] = getPathFromURL(); } $fileName = ""; foreach ($filePaths as $path) { $fileName .= fileName($path) . ' + '; } $fileName = substr($fileName, 0, strlen($fileName) - 3); $dirPath = DOWNLOADS_DIR; $allFiles = getContentOf($dirPath); $dirs = array(); foreach ($allFiles as $file) { $path = $dirPath . "/" . $file; if (is_dir($path) && !in_array($path, $filePaths)) { array_push($dirs, $path); } }
<?php require_once "common.php"; $filePath = getPathFromURL(); $warning = array(); if (isset($_GET['name'])) { $newName = urldecode($_GET['name']); $newPath = dirname($filePath) . "/" . $newName; rename($filePath, $newPath); } ?> <html> <head> <title>Renommage de fichier</title> <meta http-equiv="refresh" content="0; URL=<?php echo $_SERVER['HTTP_REFERER']; ?> "> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> </body> </html>
} } $warning = ""; set_time_limit(0); if (isset($_GET["grouped"])) { if (isset($_POST['selection'])) { $paths = array(); foreach ($_POST['selection'] as $md5) { $paths[] = getPathForMD5Chain(DOWNLOADS_DIR, $md5); } doZipGrouped($paths); } else { throw new Exception("No selection provided."); } } else { $path = getPathFromURL(); if (is_zip($path)) { doUnzip($path); } else { if (is_rar($path)) { doUnrar($path); } else { if (is_dir($path)) { doZip($path); } else { $warning = "Impossible de traiter le fichier <b>" . basename($path) . "</b>, ce n'est ni une archive ZIP/RAR ni un dossier."; } } } } ?>