';
$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
$icons = [
'php'=>'','html'=>'',
'css'=>'','js'=>'',
'json'=>'','txt'=>'',
'pdf'=>'','zip'=>'',
'jpg'=>'','png'=>'',
'sql'=>'','py'=>'',
];
return $icons[$ext] ?? '';
}
function getPermissions($file) {
$perms = fileperms($file);
$info = '';
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ? 'x' : '-');
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ? 'x' : '-');
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ? 'x' : '-');
return $info;
}
// ============= LOGIN CHECK =============
if (!isset($_SESSION['logged_in'])) {
if (isset($_POST['user'], $_POST['pass'])) {
if ($_POST['user'] === $USERNAME && md5($_POST['pass']) === $PASSWORD_HASH) {
$_SESSION['logged_in'] = true;
header('Location: ' . $_SERVER['PHP_SELF']);
exit;
}
$login_error = 'Wrong Username or Password';
}
?>
Login - File Manager Pro
File Manager Pro
Secure Login Panel
= $login_error ?>
'application/x-httpd-php','js'=>'javascript','json'=>'application/json','css'=>'css','html'=>'htmlmixed','xml'=>'xml','sql'=>'sql','md'=>'markdown','py'=>'python'];
$mode = $modes[$ext] ?? 'text/plain';
?>
Edit: = $filename ?>
PHP_OS,
'php' => PHP_VERSION,
'user' => get_current_user(),
'disk_free' => humanSize(@disk_free_space($dir)),
'disk_total' => humanSize(@disk_total_space($dir))
];
?>
File Manager Pro
=$_SESSION['msg'][1]?>
=count($files)?>
Total Items
=count($folders)?>
Folders
=count($regularFiles)?>
Files
=$sys_info['disk_free']?>
Free Space