$timeconfig = $setUp->getConfig('default_timezone'); $timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC"; date_default_timezone_set($timezone); $downloader = new Downloader(); $utils = new Utils(); $logger = new Logger(); $actions = new Actions(); $getcloud = $_POST["setdel"]; $hash = filter_input(INPUT_POST, "h", FILTER_SANITIZE_STRING); $doit = filter_input(INPUT_POST, "doit", FILTER_SANITIZE_STRING); $time = filter_input(INPUT_POST, "t", FILTER_SANITIZE_STRING); if ($doit != $time * 12) { die('Direct access not permitted'); } $alt = $setUp->getConfig('salt'); $altone = $setUp->getConfig('session_name'); if ($hash && $time && $gateKeeper->isUserLoggedIn() && $gateKeeper->isAllowed('delete_enable')) { if (md5($alt . $time) === $hash && $downloader->checkTime($time) == true) { foreach ($getcloud as $pezzo) { if ($downloader->checkFile($pezzo) == true) { $myfile = "../" . urldecode(base64_decode($pezzo)); $actions->deleteMulti($myfile); } } echo "ok"; } else { echo "Action expired"; } } else { echo "Not enough data"; }
session_start(); require 'users.php'; require 'class.php'; $timeconfig = $_CONFIG['default_timezone']; $timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC"; date_default_timezone_set($timezone); $chunk = new Chunk(); $encodeExplorer = new EncodeExplorer(); if (isset($_SESSION['lang'])) { $lang = $_SESSION['lang']; } else { $lang = SetUp::getConfig("lang"); } require "translations/" . $lang . ".php"; $gateKeeper = new GateKeeper(); if ($gateKeeper->isAccessAllowed() && $gateKeeper->isAllowed('upload_enable')) { if ($_SERVER['REQUEST_METHOD'] === 'GET') { if ($_GET['resumableChunkNumber'] == 1) { $firstChunk = true; } else { $firstChunk = false; } $resumabledata = $chunk->setupFilename($_GET['resumableFilename'], $_GET['resumableIdentifier']); $resumableFilename = $resumabledata['filename']; $extension = $resumabledata['extension']; $basename = $resumabledata['basename']; $fullfilepath = $_GET['loc'] . $resumableFilename; if (Utils::notList($extension, SetUp::getConfig("upload_allow_type")) == true || Utils::inList($extension, SetUp::getConfig("upload_reject_extension")) == true || Utils::inList($resumableFilename, array('.htaccess', '.htpasswd', '.ftpquota')) == true || substr($resumableFilename, 0, 1) === ".") { if ($_GET['resumableChunkNumber'] == 1) { $chunk->setError("<span><i class=\"fa fa-exclamation-triangle\"></i> " . $basename . "<strong>." . $extension . "</strong> " . SetUp::getLangString("upload_type_not_allowed") . "</span> "); }
/** * create new folder * * @param string $location where to create new folder * @param string $dirname new dir name * * @return adds new folder */ public static function newFolder($location, $dirname) { global $encodeExplorer; if (GateKeeper::isAllowed('newdir_enable')) { if (strlen($dirname) > 0) { $dirname = Utils::normalizeStr($dirname); if (!$location->editAllowed()) { // The system configuration does not allow uploading here $encodeExplorer->setErrorString("upload_not_allowed"); } elseif (!$location->isWritable()) { // The target directory is not writable $encodeExplorer->setErrorString("upload_dir_not_writable"); } elseif (file_exists($location->getDir(true, false, false, 0) . $dirname)) { Utils::setError("<i class=\"fa fa-folder\"></i> <strong>" . $dirname . "</strong> " . $encodeExplorer->getString("file_exists")); } elseif (!mkdir($location->getDir(true, false, false, 0) . $dirname, 0755)) { // Error creating a new directory $encodeExplorer->setErrorString("new_dir_failed"); } elseif (!chmod($location->getDir(true, false, false, 0) . $dirname, 0755)) { // Error applying chmod 755 $encodeExplorer->setErrorString("chmod_dir_failed"); } else { Utils::setSuccess("<i class=\"fa fa-folder\"></i> <strong>" . $dirname . "</strong> " . $encodeExplorer->getString("created")); // Directory successfully created, sending e-mail notification Logger::logCreation($location->getDir(true, false, false, 0) . $dirname, true); } } } }