ACKS-Filemanager ACKS‑Filemanager
".htmlspecialchars($login_error)."
"; ?> ".htmlspecialchars($block_msg).""; ?>
© ACKS‑Filemanager
null,'items'=>[],'root'=>null]; } $perms = get_permissions($currentPathReal); /* ============================================ CLIPBOARD (COPY/CUT/PASTE) ============================================ */ if (!isset($_SESSION['clipboard'])) { $_SESSION['clipboard'] = [ 'mode' => null, 'items'=> [], 'root' => null ]; } /* ============================================ HULPFUNCTIES VOOR ACTIES ============================================ */ function resolve_targets($relList, $rootPath) { $out = []; foreach ($relList as $rel) { $rel = ltrim($rel, '/\\'); $rel = normalize_path($rel); $full = normalize_path($rootPath . DS . $rel); $real = realpath($full); if ($real && ensure_within_root($real)) { $out[] = ['rel' => $rel, 'real' => $real]; } } return $out; } function rrmdir_safe($path) { if (!file_exists($path)) return true; if (is_file($path) || is_link($path)) { return @unlink($path); } $it = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS); $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); foreach ($files as $f) { if ($f->isDir()) { if (!@rmdir($f->getRealPath())) return false; } else { if (!@unlink($f->getRealPath())) return false; } } return @rmdir($path); } function rcopy_safe($src, $dst) { if (is_file($src)) { $dir = dirname($dst); if (!is_dir($dir)) { if (!@mkdir($dir, 0777, true)) return false; } return @copy($src, $dst); } if (!is_dir($src)) return false; if (!is_dir($dst)) { if (!@mkdir($dst, 0777, true)) return false; } $dir = opendir($src); if (!$dir) return false; while (($file = readdir($dir)) !== false) { if ($file === '.' || $file === '..') continue; $srcPath = $src . DS . $file; $dstPath = $dst . DS . $file; if (is_dir($srcPath)) { if (!rcopy_safe($srcPath, $dstPath)) { closedir($dir); return false; } } else { if (!@copy($srcPath, $dstPath)) { closedir($dir); return false; } } } closedir($dir); return true; }