Move files
This commit is contained in:
1 parent
30dd940c0e
commit
a58ecbb597
43 files changed
+7
-7
No files matched your search
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
include '../config/config.php';
|
||||
include '../incl/main.php';
|
||||
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die('Unable to access the database, please try again later');
|
||||
}
|
||||
|
||||
if (!checkUserSession($conn)) {
|
||||
setcookie('session', '', time(), "/", "", true, true);
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
$stmt = $conn->prepare("SELECT uid, display_name, username, email, api_key, discord_id, role, discord_avatar FROM users WHERE session = ?");
|
||||
$stmt->bind_param("s", $session);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($uid, $displayname, $username, $email, $api_key, $discord_id, $role, $avatar);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
$displayname = htmlspecialchars($displayname, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
$conn->close();
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
$role_format = $role == 1 ? "Owner" : ($role == 2 ? "Admin" : ($role == 0 ? "User" : "Unknown"));
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SH08WXZBBG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SH08WXZBBG');
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Xytriza's Uploading Service - Account Management</title>
|
||||
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://upload.xytriza.com/dashboard/assets/main.css?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://upload.xytriza.com/dashboard/assets/main.js?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service" height="40vw" width="40vw"></a>
|
||||
<a href="/dashboard/"><i class="fas fa-home sidebar-item"></i></a>
|
||||
<a href="/dashboard/gallery.php"><i class="fas fa-file-alt sidebar-item" style="margin-left: 20%;"></i></a>
|
||||
<a href="/dashboard/upload.php"><i class="fas fa-upload sidebar-item"></i></a>
|
||||
<a href="/dashboard/settings.php"><i class="fas fa-cog sidebar-item"></i></a>
|
||||
<a href="/dashboard/account.php" style="margin-top: auto;"><i class="fas fa-user-cog sidebar-item"></i></a>
|
||||
<?php
|
||||
if ($role === 1 || $role === 2) {
|
||||
echo '<a href="/dashboard/admin" class="sidebar-item"><i class="fas fa-user-shield"></i></a>
|
||||
<a href="/dashboard/admin/users.php" class="sidebar-item"><i class="fas fa-user-edit"></i></a>';
|
||||
}
|
||||
?>
|
||||
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
</div>
|
||||
|
||||
<div id="notification-container"></div>
|
||||
|
||||
<div id="container" style="max-width: 48%;">
|
||||
<div id="account-information" class="section">
|
||||
<h2>Account Information</h2>
|
||||
<p id="username"><strong>Username:</strong> <?php echo $username;?></p>
|
||||
<p id="displayname"><strong>Display Name:</strong> <?php echo $displayname;?></p>
|
||||
<p><strong>UID:</strong> <?php echo $uid;?></p>
|
||||
<p><strong>Discord ID:</strong> <?php echo $discord_id;?></p>
|
||||
<p><strong>Email:</strong> <em class="blur-on-hover"><?php echo $email;?></em></p>
|
||||
<p><strong>Role:</strong> <?php echo $role_format;?></p>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="file-settings" class="section half-width">
|
||||
<h2>File Settings</h2>
|
||||
<?php 'PGRpdiBjbGFzcz0ic2xpZGVyLWNvbnRhaW5lciI+CiAgICAgICAgICAgICAgICAgICAgPHAgc3R5bGU9ImRpc3BsYXk6IG5vbmU7IiBpZD0ic2V0dGluZ05hbWUiPmxvY2FsaXplZC10aW1lem9uZTwvcD4KICAgICAgICAgICAgICAgICAgICA8bGFiZWwgZm9yPSJib29sZWFuU2V0dGluZyIgY2xhc3M9InNsaWRlci1sYWJlbCI+VXNlIGxvY2FsaXplZCB0aW1lem9uZSBmb3IgZmlsZSBwYWdlPC9sYWJlbD4KICAgICAgICAgICAgICAgICAgICA8cD5EaXNhYmxlIHRvIHVzZSB5b3VyIHVzZXIgc2V0dGluZyB0aW1lem9uZSBmb3Igd2hlbiBhIHVzZXIgdmlld3MgYSBmaWxlIHlvdSBwb3N0ZWQ8cD4KICAgICAgICAgICAgICAgICAgICA8cD5FbmFibGUgdG8gdXNlIHRoZSB1c2VyJ3MgdGltZXpvbmUgZm9yIHdoZW4gYSB1c2VyIHZpZXdzIGEgZmlsZSB5b3UgcG9zdGVkPHA+CiAgICAgICAgICAgICAgICAgICAgPGxhYmVsIGNsYXNzPSJzd2l0Y2giPgogICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0iY2hlY2tib3giIGlkPSJib29sZWFuU2V0dGluZyI8P3BocCBlY2hvICRsb2NhbGl6c2VkVGltZXpvbmUgPT09ICd0cnVlJyA/ICIgY2hlY2tlZCIgOiAiIjs/Pj4KICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9InNsaWRlciByb3VuZCI+PC9zcGFuPgogICAgICAgICAgICAgICAgICAgIDwvbGFiZWw+CiAgICAgICAgICAgICAgICA8L2Rpdj4=';
|
||||
?>
|
||||
<button onclick="deleteAllFiles();">Delete all files</button>
|
||||
</div>
|
||||
|
||||
<div id="change-password" class="section half-width">
|
||||
<h2>Change Password</h2>
|
||||
<form id="passwordChangeForm">
|
||||
<input type="password" id="oldPassword" placeholder="Old Password">
|
||||
<input type="password" id="newPassword" placeholder="New Password">
|
||||
<input type="password" id="confirmPassword" placeholder="Confirm New Password">
|
||||
<input type="hidden" id="username" value="<?php echo $displayname;?>">
|
||||
<button type="submit">Change Password</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="change-username" class="section half-width">
|
||||
<h2>Change Username</h2>
|
||||
<form id="usernameChangeForm">
|
||||
<input type="text" id="newUsername" placeholder="New Username">
|
||||
<input type="hidden" id="oldUsername" value="<?php echo $username;?>">
|
||||
<input type="password" id="usernamepassword" placeholder="Password">
|
||||
<button type="submit">Change Username</button>
|
||||
</form>
|
||||
<h2>Change Display Name</h2>
|
||||
<form id="displaynameChangeForm">
|
||||
<input type="text" id="newDisplayname" placeholder="New Display Name">
|
||||
<input type="hidden" id="oldDisplayname" value="<?php echo $displayname;?>">
|
||||
<input type="hidden" id="username" value="<?php echo $username;?>">
|
||||
<input type="password" id="displayusernamepassword" placeholder="Password">
|
||||
<button type="submit">Change Display Name</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="user-settings" class="section half-width">
|
||||
<h2>User Settings</h2>
|
||||
<button onclick="setCookieAndRedirect()">Re-Link Discord</button>
|
||||
<button onclick="copyAPIKey();">Copy API Key</button>
|
||||
<button onclick="generateAPIKey();">Generate new API Key</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
include '../../config/config.php';
|
||||
include '../../incl/main.php';
|
||||
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die('Unable to access the database, please try again later');
|
||||
}
|
||||
|
||||
if (!checkUserSession($conn)) {
|
||||
setcookie('session', '', time(), "/", "", true, true);
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
$stmt = $conn->prepare("SELECT uid, username, email, api_key, role, discord_id FROM users WHERE session = ?");
|
||||
$stmt->bind_param("s", $session);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($uid, $username, $email, $api_key, $role, $discord_id);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
if ($role !== 1 && $role !== 2) {
|
||||
header('Location: /dashboard/');
|
||||
die();
|
||||
}
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (isset($_POST['news'])) {
|
||||
$news = base64_encode(htmlspecialchars($_POST['news']));
|
||||
$sql = "UPDATE settings SET value = ? WHERE id = 1";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("s", $news);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
}
|
||||
if (isset($_POST['motd'])) {
|
||||
$motd = base64_encode(htmlspecialchars($_POST['motd']));
|
||||
$sql = "UPDATE settings SET value = ? WHERE id = 2";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("s", $motd);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT value FROM settings WHERE id = 1";
|
||||
$result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
$news = base64_decode($row['value']);
|
||||
|
||||
$sql = "SELECT value FROM settings WHERE id = 2";
|
||||
$result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
$motd = base64_decode($row['value']);
|
||||
|
||||
$totalSize = 0;
|
||||
$uploadCount = 0;
|
||||
|
||||
$sql = "SELECT size FROM uploads";
|
||||
$result = $conn->query($sql);
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$totalSize += $row['size'];
|
||||
$uploadCount++;
|
||||
}
|
||||
|
||||
$sql = "SELECT COUNT(*) FROM users";
|
||||
$result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
$users = $row['COUNT(*)'];
|
||||
|
||||
$sql = "SELECT COUNT(*) FROM logins";
|
||||
$result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
$logins = $row['COUNT(*)'];
|
||||
|
||||
$sql = "SELECT COUNT(*) FROM uploads";
|
||||
$result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
$uploads = $row['COUNT(*)'];
|
||||
|
||||
$conn->close();
|
||||
|
||||
$size = formatUnitSize($totalSize);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SH08WXZBBG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SH08WXZBBG');
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Xytriza's Uploading Service - Dashboard</title>
|
||||
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://upload.xytriza.com/dashboard/assets/main.css?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://upload.xytriza.com/dashboard/assets/main.js?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.js'); ?>"></script>
|
||||
<style>
|
||||
textarea {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service" height="40vw" width="40vw"></a>
|
||||
<a href="/dashboard/"><i class="fas fa-home sidebar-item"></i></a>
|
||||
<a href="/dashboard/gallery.php"><i class="fas fa-file-alt sidebar-item" style="margin-left: 20%;"></i></a>
|
||||
<a href="/dashboard/upload.php"><i class="fas fa-upload sidebar-item"></i></a>
|
||||
<a href="/dashboard/settings.php"><i class="fas fa-cog sidebar-item"></i></a>
|
||||
<a href="/dashboard/account.php" style="margin-top: auto;"><i class="fas fa-user-cog sidebar-item"></i></a>
|
||||
<?php
|
||||
if ($role === 1 || $role === 2) {
|
||||
echo '<a href="/dashboard/admin" class="sidebar-item"><i class="fas fa-user-shield"></i></a>
|
||||
<a href="/dashboard/admin/users.php" class="sidebar-item"><i class="fas fa-user-edit"></i></a>';
|
||||
}
|
||||
?>
|
||||
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
</div>
|
||||
|
||||
<div id="notification-container"></div>
|
||||
|
||||
<div id="container">
|
||||
<div class="info-group">
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Storage Used</strong></p>
|
||||
<p><?php echo $size;?></p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Uploads</strong></p>
|
||||
<p><?php echo $uploads;?></p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Users</strong></p>
|
||||
<p><?php echo $users;?></p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Total Logins</strong></p>
|
||||
<p><?php echo $logins;?></p>
|
||||
</div>
|
||||
</div>
|
||||
<p>Dynamic placeholders like %discord% (Discord link), %username% (user's name), %uploads% (user's upload count), %role% (user's role), %uid% (user ID), %storage% (user's storage usage), and date details (%year%, %month%, %monthformat%, %day%, %dayformat%, %date%) are automatically replaced with specific user or system information for personalized messages.</p>
|
||||
<form method="POST">
|
||||
<p>News</p>
|
||||
<textarea name="news"><?php echo $news; ?></textarea>
|
||||
<p>MOTD</p>
|
||||
<textarea name="motd"><?php echo $motd; ?></textarea>
|
||||
<button type="submit">Update</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
include '../../config/config.php';
|
||||
include '../../incl/main.php';
|
||||
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die('Unable to access the database, please try again later');
|
||||
}
|
||||
|
||||
if (!checkUserSession($conn)) {
|
||||
setcookie('session', '', time(), "/", "", true, true);
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
$stmt = $conn->prepare("SELECT uid, username, email, api_key, role, discord_id FROM users WHERE session = ?");
|
||||
$stmt->bind_param("s", $session);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($uid, $username, $email, $api_key, $role, $discord_id);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
if ($role !== 1 && $role !== 2) {
|
||||
header('Location: /dashboard/');
|
||||
die();
|
||||
}
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
$sql = "SELECT * FROM users";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
$conn->close();
|
||||
|
||||
function getRole($role) {
|
||||
return $role == 1 ? "Owner" : ($role == 2 ? "Admin" : ($role == 0 ? "User" : "Unknown"));
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SH08WXZBBG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SH08WXZBBG');
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Xytriza's Uploading Service - Dashboard</title>
|
||||
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://upload.xytriza.com/dashboard/assets/main.css?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://upload.xytriza.com/dashboard/assets/main.js?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.js'); ?>"></script>
|
||||
<style>
|
||||
.hidden {
|
||||
filter: blur(8px);
|
||||
transition: filter 0.25s ease;
|
||||
}
|
||||
|
||||
.hidden:hover {
|
||||
filter: blur(0);
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service" height="40vw" width="40vw"></a>
|
||||
<a href="/dashboard/"><i class="fas fa-home sidebar-item"></i></a>
|
||||
<a href="/dashboard/gallery.php"><i class="fas fa-file-alt sidebar-item" style="margin-left: 20%;"></i></a>
|
||||
<a href="/dashboard/upload.php"><i class="fas fa-upload sidebar-item"></i></a>
|
||||
<a href="/dashboard/settings.php"><i class="fas fa-cog sidebar-item"></i></a>
|
||||
<a href="/dashboard/account.php" style="margin-top: auto;"><i class="fas fa-user-cog sidebar-item"></i></a>
|
||||
<?php
|
||||
if ($role === 1 || $role === 2) {
|
||||
echo '<a href="/dashboard/admin" class="sidebar-item"><i class="fas fa-user-shield"></i></a>
|
||||
<a href="/dashboard/admin/users.php" class="sidebar-item"><i class="fas fa-user-edit"></i></a>';
|
||||
}
|
||||
?>
|
||||
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
</div>
|
||||
|
||||
<div id="notification-container"></div>
|
||||
|
||||
<div id="container">
|
||||
<div class="info-group">
|
||||
<h1>Admin Panel</h1>
|
||||
<p>Manage users and settings</p>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>UID</th>
|
||||
<th>Username</th>
|
||||
<th>Display Name</th>
|
||||
<th>Email</th>
|
||||
<th>Discord ID</th>
|
||||
<th>IP</th>
|
||||
<th>Role</th>
|
||||
</tr>
|
||||
<?php
|
||||
while($row = $result->fetch_assoc()) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . (!empty($row['uid']) ? htmlspecialchars($row['uid']) : "N/A") . "</td>";
|
||||
echo "<td>" . (!empty($row['username']) ? htmlspecialchars($row['username']) : "N/A") . "</td>";
|
||||
echo "<td>" . (!empty($row['display_name']) ? htmlspecialchars($row['display_name']) : "N/A") . "</td>";
|
||||
if ($row['role'] != 0 || $role != 1) {
|
||||
echo "<td>Hidden</td>";
|
||||
} else {
|
||||
echo "<td class='hidden'>" . (!empty($row['email']) ? htmlspecialchars($row['email']) : "N/A") . "</td>";
|
||||
}
|
||||
echo "<td>" . (!empty($row['discord_id']) ? htmlspecialchars($row['discord_id']) : "Not Synced") . "</td>";
|
||||
if ($row['role'] != 0 || $role != 1) {
|
||||
echo "<td>Hidden</td>";
|
||||
} else {
|
||||
echo "<td class='hidden'>" . (!empty($row['latest_ip']) ? htmlspecialchars($row['latest_ip']) : "N/A") . "</td>";
|
||||
}
|
||||
echo "<td>" . (!empty(getRole($row['role'])) ? htmlspecialchars(getRole($row['role'])) : "N/A") . "</td>";
|
||||
echo "<td>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,703 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #060606;
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: normal;
|
||||
flex-direction: column;
|
||||
font-size: 0.78vw;
|
||||
}
|
||||
|
||||
body.tint::before {
|
||||
content: "";
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 99998;
|
||||
}
|
||||
|
||||
#container {
|
||||
text-align: center;
|
||||
padding: 1.04vw;
|
||||
border-radius: 0.52vw;
|
||||
margin-top: 1.04vw;
|
||||
background-color: #0E0E0E;
|
||||
box-shadow: 0 0.21vw 0.42vw rgba(0, 0, 0, 0.1);
|
||||
justify-content: space-between;
|
||||
flex: 1;
|
||||
min-width: 15.62vw;
|
||||
max-width: 79%;
|
||||
}
|
||||
|
||||
|
||||
#main-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: 2.60vw;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 1.04vw;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.info-group {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin: 1.04vw;
|
||||
}
|
||||
|
||||
.info-box {
|
||||
background-color: #131313;
|
||||
padding: 1.04vw 0.52vw;
|
||||
border-radius: 0.42vw;
|
||||
max-width: 20.83vw;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 0.21vw 0.42vw rgba(0, 0, 0, 0.1);
|
||||
margin-left: 0.52vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.info-box p.big {
|
||||
font-size: 1.25vw;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 0.42vw;
|
||||
}
|
||||
|
||||
.info-box p {
|
||||
font-size: 1vw;
|
||||
line-height: 1.2;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#container h1 {
|
||||
margin-right: auto;
|
||||
margin-left: 1.30vw;
|
||||
margin-bottom: 1.04vw;
|
||||
}
|
||||
|
||||
#container h2 {
|
||||
color: #fff;
|
||||
font-size: 1.5em;
|
||||
margin-top: 1.04vw;
|
||||
margin-bottom: 0.52vw;
|
||||
}
|
||||
|
||||
#uploadStats,
|
||||
#loginStats {
|
||||
margin-top: 1.04vw;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
#charts-container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 1.56vw;
|
||||
}
|
||||
|
||||
#canvas-group {
|
||||
background-color: #131313;
|
||||
border-radius: 0.52vw;
|
||||
margin: 0 1.04vw;
|
||||
}
|
||||
|
||||
#canvas-group p {
|
||||
font-size: 1.30vw;
|
||||
}
|
||||
|
||||
#canvas-group canvas {
|
||||
max-width: 22vw;
|
||||
max-height: 22vh;
|
||||
width: 200%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#gallery {
|
||||
text-align: center;
|
||||
max-width: 90%;
|
||||
margin-top: 1.04vw;
|
||||
justify-content: space-between;
|
||||
display: none;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.gallery-item {
|
||||
margin: 0.26vw;
|
||||
position: relative;
|
||||
flex: 1 1 auto;
|
||||
background-color: #131313;
|
||||
box-shadow: 0 0.21vw 0.42vw rgba(0, 0, 0, 0.1);
|
||||
padding: 0.26vw;
|
||||
border-radius: 0.52vw;
|
||||
width: 15vw;
|
||||
height: 15vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transition: transform 0.3s ease;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.gallery-item img {
|
||||
max-width: 100%;
|
||||
max-height: 50%;
|
||||
height: auto;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.gallery-item textarea {
|
||||
background-color: #222;
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
border-radius: 5px;
|
||||
resize: none;
|
||||
overflow: auto;
|
||||
transition: border-color 0.3s ease;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.gallery-item textarea:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.gallery-item textarea:hover {
|
||||
border-color: #370664;
|
||||
}
|
||||
|
||||
.gallery-item:hover {
|
||||
transform: scale(1.015);
|
||||
}
|
||||
|
||||
.gallery-btn {
|
||||
margin: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.file-info {
|
||||
margin-top: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
position: absolute;
|
||||
top: 0.52vw;
|
||||
right: 0.52vw;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.icon-container i {
|
||||
margin-left: 0.52vw;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
padding: 1.56vw;
|
||||
background-color: #0E0E0E;
|
||||
margin-right: auto;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.sidebar-item {
|
||||
margin-bottom: 1.56vw;
|
||||
font-size: 1.56vw;
|
||||
}
|
||||
|
||||
#upload {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#dropZone {
|
||||
width: 50%;
|
||||
height: 30vh;
|
||||
border: 0.10vw solid #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 10%;
|
||||
cursor: pointer;
|
||||
background-color: #0E0E0E;
|
||||
box-shadow: 0 0.21vw 0.42vw rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0.52vw;
|
||||
padding: 1.04vw;
|
||||
text-align: center;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
#dropZone p {
|
||||
color: #fff;
|
||||
font-size: 1.04vw;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#dropZone:hover {
|
||||
transform: scale(1.02)
|
||||
}
|
||||
|
||||
#progressContainer {
|
||||
width: 50%;
|
||||
height: 2vh;
|
||||
border: 0.10vw solid #fff;
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 2%;
|
||||
background-color: #0E0E0E;
|
||||
box-shadow: 0 0.21vw 0.42vw rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0.52vw;
|
||||
padding: 1.04vw;
|
||||
}
|
||||
|
||||
#progressBar {
|
||||
margin-bottom: 5%;
|
||||
}
|
||||
|
||||
#progressText, #uploadSpeed {
|
||||
color: #fff;
|
||||
font-size: 1.04vw;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.section {
|
||||
background-color: #131313;
|
||||
padding: 1.04vw;
|
||||
margin-bottom: 1.04vw;
|
||||
border-radius: 0.42vw;
|
||||
box-shadow: 0 0.21vw 0.42vw rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.half-width {
|
||||
width: calc(50% - 1vw);
|
||||
margin-right: 0.26vw;
|
||||
margin-left: 0.26vw;
|
||||
}
|
||||
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 3.12vw;
|
||||
height: 1.77vw;
|
||||
}
|
||||
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
-webkit-transition: .4s;
|
||||
transition: .4s;
|
||||
border-radius: 1.77vw;
|
||||
}
|
||||
|
||||
.slider-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid #222;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.slider-container p {
|
||||
font-size: 0.8vw;
|
||||
margin: 0.2vh 0 0.2vh 0;
|
||||
}
|
||||
|
||||
.slider-label {
|
||||
margin-right: 0.52vw;
|
||||
color: #fff;
|
||||
font-size: 0.8vw;
|
||||
font-weight: bold;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 1.35vw;
|
||||
width: 1.35vw;
|
||||
left: 0.21vw;
|
||||
bottom: 0.21vw;
|
||||
background-color: white;
|
||||
-webkit-transition: .4s;
|
||||
transition: .4s;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
input:checked+.slider {
|
||||
background-color: #370664;
|
||||
}
|
||||
|
||||
input:focus+.slider {
|
||||
box-shadow: 0 0 0.05vw #370664;
|
||||
}
|
||||
|
||||
input:checked+.slider:before {
|
||||
-webkit-transform: translateX(1.35vw);
|
||||
-ms-transform: translateX(1.35vw);
|
||||
transform: translateX(1.35vw);
|
||||
}
|
||||
|
||||
.icon-check,
|
||||
.icon-times {
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
font-size: 0.52vw;
|
||||
}
|
||||
|
||||
.icon-check {
|
||||
left: 0.42vw;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.icon-times {
|
||||
right: 0.42vw;
|
||||
}
|
||||
|
||||
input:checked~.icon-check {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
input:checked~.icon-times {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.upload-tools {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 1.04vw;
|
||||
}
|
||||
|
||||
.tool-box {
|
||||
width: 6.67vw;
|
||||
height: 6.67vw;
|
||||
background-color: #333;
|
||||
border-radius: 0.42vw;
|
||||
padding: 0.26vw;
|
||||
text-align: center;
|
||||
margin: 0.26vw;
|
||||
}
|
||||
|
||||
.tool-title {
|
||||
margin-top: 0.26vw;
|
||||
font-size: 1.04vw;
|
||||
color: #fff;
|
||||
margin-bottom: 0.52vw;
|
||||
}
|
||||
|
||||
.tool-icon {
|
||||
font-size: 2.50vw;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
button {
|
||||
display: inline-block;
|
||||
padding: 0.52vw 1.04vw;
|
||||
background-color: #3c076e;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
border-radius: 0.26vw;
|
||||
font-size: 0.94vw;
|
||||
transition: background-color 0.3s, transform 0.3s;
|
||||
cursor: pointer;
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #370664;
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.settings-group {
|
||||
margin-bottom: 1.04vw;
|
||||
}
|
||||
|
||||
.settings-label {
|
||||
display: block;
|
||||
margin-bottom: 0.42vw;
|
||||
font-size: 0.83vw;
|
||||
}
|
||||
|
||||
select {
|
||||
width: 100%;
|
||||
padding: 0.42vw 0.52vw;
|
||||
font-size: 0.73vw;
|
||||
border: 0.05vw solid #ccc;
|
||||
border-radius: 0.21vw;
|
||||
background-color: #131313;
|
||||
box-sizing: border-box;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
select:hover {
|
||||
border-color: #370664;
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 0.2rem rgba(55, 6, 160, 0.25);
|
||||
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
||||
}
|
||||
|
||||
.settings-radio-group {
|
||||
width: 100%;
|
||||
padding: 0.42vw 0.52vw;
|
||||
font-size: 0.73vw;
|
||||
border: 0.05vw solid #ccc;
|
||||
border-radius: 0.21vw;
|
||||
background-color: #131313;
|
||||
box-sizing: border-box;
|
||||
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
||||
}
|
||||
|
||||
.settings-radio-group:hover {
|
||||
border-color: #370664;
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 0.2rem rgba(55, 6, 160, 0.25);
|
||||
}
|
||||
|
||||
.settings-radio-group .settings-label {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
margin-bottom: 0.26vw;
|
||||
}
|
||||
|
||||
.settings-radio-group label {
|
||||
display: inline-block;
|
||||
margin-right: 0.78vw;
|
||||
font-size: 0.73vw;
|
||||
}
|
||||
|
||||
.radio-container input[type="radio"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.radio-container .fa-circle,
|
||||
.radio-container .fa-check-circle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.radio-container input[type="radio"]:checked+.fa-circle+.fa-check-circle {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.radio-container input[type="radio"]:not(:checked)+.fa-circle {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.radio-container input[type="radio"]:disabled+.fa-circle {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.radio-container input[type="radio"]:disabled+.fa-circle+.fa-check-circle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.input-field {
|
||||
width: 90%;
|
||||
padding: 0.52vw;
|
||||
margin-bottom: 1.04vw;
|
||||
background-color: #131313;
|
||||
border: none;
|
||||
border-radius: 0.42vw;
|
||||
color: #fff;
|
||||
font-size: 0.94vw;
|
||||
}
|
||||
|
||||
.input-field:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0.52vw rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.form-section {
|
||||
margin: 1.04vw 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.select-field {
|
||||
width: 92%;
|
||||
padding: 0.52vw;
|
||||
background-color: #131313;
|
||||
border: none;
|
||||
border-radius: 0.42vw;
|
||||
color: #fff;
|
||||
font-size: 0.94vw;
|
||||
margin-bottom: 1.04vw;
|
||||
}
|
||||
|
||||
.select-field:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#notification-container {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: 10000;
|
||||
transition: transform 0.5s ease-in-out;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.notification {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
margin: 10px;
|
||||
padding: 15px;
|
||||
color: white;
|
||||
background-color: #333;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
||||
transition: transform 0.5s ease-in-out;
|
||||
min-width: 15vw;
|
||||
min-height: 6.5vh;
|
||||
max-width: 30vw;
|
||||
height: auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.notification div:first-child {
|
||||
border-right: 1px solid white;
|
||||
padding-right: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.notification i {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#notification-message {
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
input {
|
||||
background-color: #131313;
|
||||
border: 0.05vw solid #ccc;
|
||||
border-radius: 0.21vw;
|
||||
color: #fff;
|
||||
font-size: 0.83vw;
|
||||
padding: 0.42vw 0.52vw;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
margin: 0.3vh 0 0.3vh 0;
|
||||
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input:hover {
|
||||
border-color: #370664;
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 0.2rem rgba(55, 6, 160, 0.25);
|
||||
}
|
||||
|
||||
input:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0.52vw rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
form textarea {
|
||||
background-color: #131313;
|
||||
border: 0.05vw solid #ccc;
|
||||
border-radius: 0.21vw;
|
||||
color: #fff;
|
||||
font-size: 0.83vw;
|
||||
padding: 0.42vw 0.52vw;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
margin: 0.3vh 0 0.3vh 0;
|
||||
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
||||
}
|
||||
|
||||
#account-information .blur-on-hover {
|
||||
filter: blur(8px);
|
||||
font-style: normal;
|
||||
transition: filter 0.25s ease;
|
||||
}
|
||||
|
||||
#account-information .blur-on-hover:hover {
|
||||
filter: none;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.file-textbox {
|
||||
width: 50vw;
|
||||
min-height: 30vh;
|
||||
max-height: 100vh;
|
||||
background-color: #222;
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
border-radius: 5px;
|
||||
resize: none;
|
||||
overflow: auto;
|
||||
transition: border-color 0.3s ease;
|
||||
}
|
||||
|
||||
.file-textbox:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.file-textbox:hover {
|
||||
border-color: #370664;
|
||||
}
|
||||
@@ -0,0 +1,685 @@
|
||||
function logout() {
|
||||
document.cookie = "session=" + "; path=/";
|
||||
location.reload();
|
||||
}
|
||||
|
||||
function showNotification(message, type) {
|
||||
var notification = document.createElement('div');
|
||||
notification.className = 'notification ' + type;
|
||||
notification.style.display = 'flex';
|
||||
notification.style.flexDirection = 'row';
|
||||
notification.style.alignItems = 'center';
|
||||
|
||||
var iconDiv = document.createElement('div');
|
||||
var icon = document.createElement('i');
|
||||
icon.className = type === 'Success' ? 'fas fa-check' : 'fas fa-times';
|
||||
icon.style.color = type === 'Success' ? '#4CAF50' : '#f44336';
|
||||
iconDiv.appendChild(icon);
|
||||
notification.appendChild(iconDiv);
|
||||
|
||||
var textDiv = document.createElement('div');
|
||||
textDiv.id = 'notification-message';
|
||||
textDiv.style.display = 'flex';
|
||||
textDiv.style.flexDirection = 'column';
|
||||
|
||||
var titleNode = document.createElement('h4');
|
||||
titleNode.style.margin = '0';
|
||||
titleNode.appendChild(document.createTextNode(type));
|
||||
textDiv.appendChild(titleNode);
|
||||
|
||||
var messageNode = document.createElement('div');
|
||||
messageNode.style.margin = '0';
|
||||
messageNode.appendChild(document.createTextNode(message));
|
||||
textDiv.appendChild(messageNode);
|
||||
|
||||
notification.appendChild(textDiv);
|
||||
|
||||
var container = document.getElementById('notification-container');
|
||||
container.appendChild(notification);
|
||||
notification.style.transform = 'translateY(100%)';
|
||||
setTimeout(function() {
|
||||
notification.style.transform = 'translateY(0)';
|
||||
}, 100);
|
||||
|
||||
setTimeout(function() {
|
||||
notification.style.transform = 'translateY(100%)';
|
||||
setTimeout(function() {
|
||||
container.removeChild(notification);
|
||||
}, 500);
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
function showSuccess(message) {
|
||||
showNotification(message, 'Success');
|
||||
}
|
||||
|
||||
function showError(message) {
|
||||
showNotification(message, 'Error');
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
let element = "";
|
||||
|
||||
element = document.getElementById('dropZone');
|
||||
if (element) {
|
||||
element.addEventListener('click', function() {
|
||||
document.getElementById('fileInput').click();
|
||||
});
|
||||
}
|
||||
|
||||
element = document.getElementById('fileInput');
|
||||
if (element) {
|
||||
element.addEventListener('change', function(event) {
|
||||
handleFileUpload(event.target.files[0]);
|
||||
});
|
||||
}
|
||||
|
||||
element = document.getElementById('dropZone');
|
||||
if (element) {
|
||||
element.addEventListener('dragover', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
event.target.style.border = '3px solid #09f';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
element = document.getElementById('dropZone');
|
||||
if (element) {
|
||||
element.addEventListener('dragleave', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
event.target.style.border = '2px dashed #fff';
|
||||
});
|
||||
}
|
||||
|
||||
element = document.getElementById('dropZone');
|
||||
if (element) {
|
||||
element.addEventListener('drop', function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
event.target.style.border = '2px dashed #fff';
|
||||
const files = event.dataTransfer.files;
|
||||
if (files.length) {
|
||||
handleFileUpload(files[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
element = document.getElementById('booleanSetting');
|
||||
if (element) {
|
||||
element.addEventListener('change', function () {
|
||||
let value = this.checked ? true : false;
|
||||
|
||||
let label = document.querySelector("p[id='settingName']").innerText.toLowerCase().replace(/ /g, '-');
|
||||
|
||||
$.ajax({
|
||||
url: '/api/dashboard/setPreferences.php',
|
||||
type: 'POST',
|
||||
data: {[`${label}`]: value},
|
||||
success: function(response) {
|
||||
console.log('Full response:', response);
|
||||
if (response.success) {
|
||||
console.log('Settings updated: ', response.response);
|
||||
showSuccess(response.response);
|
||||
} else {
|
||||
console.error('Update failed: ', response.response);
|
||||
showError(response.response);
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
console.error('Update failed: ', xhr);
|
||||
if (xhr.responseJSON && xhr.responseJSON.response) {
|
||||
showError(xhr.responseJSON.response);
|
||||
} else {
|
||||
showError(xhr.responseText);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
element1 = document.getElementById('passwordChangeForm');
|
||||
element2 = document.getElementById('usernameChangeForm');
|
||||
element3 = document.getElementById('displaynameChangeForm');
|
||||
if (element1 && element2 && element3) {
|
||||
$(document).ready(function() {
|
||||
$('#passwordChangeForm').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
var oldPassword = $('#oldPassword').val();
|
||||
var newPassword = $('#newPassword').val();
|
||||
var confirmPassword = $('#confirmPassword').val();
|
||||
var username = $('#username').val();
|
||||
$.ajax({
|
||||
url: '/api/changePassword.php',
|
||||
type: 'POST',
|
||||
data: {
|
||||
username: username,
|
||||
oldpassword: oldPassword,
|
||||
newpassword: newPassword,
|
||||
confirmpassword: confirmPassword
|
||||
},
|
||||
success: function(data) {
|
||||
response = JSON.parse(data);
|
||||
if (response.success) {
|
||||
location.reload();
|
||||
} else {
|
||||
showError(response.response);
|
||||
}
|
||||
},
|
||||
error: function(error) {
|
||||
if (error.responseJSON && error.responseJSON.response) {
|
||||
showError(error.responseJSON.response);
|
||||
} else {
|
||||
showError(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#usernameChangeForm').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
var oldUsername = $('#oldUsername').val();
|
||||
var newUsername = $('#newUsername').val();
|
||||
var password = $('#usernamepassword').val();
|
||||
$.ajax({
|
||||
url: '/api/changeUsername.php',
|
||||
type: 'POST',
|
||||
data: {
|
||||
oldusername: oldUsername,
|
||||
newusername: newUsername,
|
||||
password: password
|
||||
},
|
||||
success: function(data) {
|
||||
response = data;
|
||||
if (response.success) {
|
||||
showSuccess(response.response);
|
||||
$('#oldUsername').val(newUsername);
|
||||
$('#username').html('<strong>Username:</strong> ').append(document.createTextNode(newUsername));
|
||||
} else {
|
||||
showError(response.response);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR) {
|
||||
if (jqXHR.responseJSON && jqXHR.responseJSON.response) {
|
||||
showError(jqXHR.responseJSON.response);
|
||||
} else {
|
||||
showError(jqXHR.responseText);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#displaynameChangeForm').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
var oldUsername = $('#oldDisplayname').val();
|
||||
var newUsername = $('#newDisplayname').val();
|
||||
var username = $('#username').val();
|
||||
var password = $('#displayusernamepassword').val();
|
||||
$.ajax({
|
||||
url: '/api/changeDisplayname.php',
|
||||
type: 'POST',
|
||||
data: {
|
||||
olddisplayname: oldUsername,
|
||||
newdisplayname: newUsername,
|
||||
username: username,
|
||||
password: password
|
||||
},
|
||||
success: function(data) {
|
||||
response = data;
|
||||
if (response.success) {
|
||||
showSuccess(response.response);
|
||||
$('#oldDisplayname').val(newUsername);
|
||||
$('#displayname').html('<strong>Username:</strong> ').append(document.createTextNode(newUsername));
|
||||
} else {
|
||||
showError(response.response);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR) {
|
||||
if (jqXHR.responseJSON && jqXHR.responseJSON.response) {
|
||||
showError(jqXHR.responseJSON.response);
|
||||
} else {
|
||||
showError(jqXHR.responseText);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function deleteFile(deletionKey, imageId) {
|
||||
const deleteUrl = 'https://upload.xytriza.com/delete/' + deletionKey;
|
||||
|
||||
$.ajax({
|
||||
url: deleteUrl,
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
success: function(responseJson) {
|
||||
console.log('Server response:', responseJson);
|
||||
|
||||
const isSuccess = responseJson.success === true || responseJson.success === 'true';
|
||||
|
||||
if (isSuccess) {
|
||||
const galleryItem = document.querySelector('.gallery-item[data-id="' + imageId + '"]');
|
||||
if (galleryItem) {
|
||||
galleryItem.remove();
|
||||
} else {
|
||||
console.error('Gallery item not found:', deletionKey);
|
||||
}
|
||||
console.log('File deleted successfully:', deletionKey);
|
||||
showSuccess("File deleted Successfuly")
|
||||
} else {
|
||||
console.error('Error deleting file:', responseJson.response);
|
||||
showError("Error deleting file: " + responseJson.response)
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error deleting file:', error + ' (' + status + ')');
|
||||
showError('Error deleting file: ' + error + ' (' + status + ')');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function copyToClipboardOld(text, message, type) {
|
||||
const tempInput = document.createElement('input');
|
||||
tempInput.value = text;
|
||||
document.body.appendChild(tempInput);
|
||||
tempInput.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(tempInput);
|
||||
console.log('Link copied to clipboard: ', tempInput.value);
|
||||
if (message) {
|
||||
if (type == 0) {
|
||||
showSuccess(message);
|
||||
} else if (type == 1) {
|
||||
showError(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function copyToClipboard(text, message, type) {
|
||||
if (!navigator.clipboard) {
|
||||
console.error('Clipboard not available');
|
||||
showError('Copying not supported on this browser.');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
console.log('Link copied to clipboard:', text);
|
||||
|
||||
if (message) {
|
||||
type = type.toString();
|
||||
if (type === "0" || type === "success") {
|
||||
showSuccess(message);
|
||||
} else if (type === "1" || type === "error") {
|
||||
showError(message);
|
||||
} else {
|
||||
console.log('Invalid copy type');
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to copy content:', err);
|
||||
showError('Failed to copy content: ' + err);
|
||||
}
|
||||
}
|
||||
|
||||
function downloadFile(fileId, originalName, fileType) {
|
||||
$.ajax({
|
||||
url: 'https://files.upload.xytriza.com/' + fileId,
|
||||
method: 'GET',
|
||||
xhrFields: {
|
||||
responseType: 'blob'
|
||||
},
|
||||
success: function (data) {
|
||||
var blob = new Blob([data], {type: fileType});
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
var a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = originalName;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
window.URL.revokeObjectURL(url);
|
||||
showSuccess("File downloaded successfully")
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error downloading file:', error + ' (' + status + ')');
|
||||
showError('Error downloading file: ' + error + ' (' + status + ')');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function formatDate(dateStr) {
|
||||
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
||||
const date = new Date(dateStr);
|
||||
const year = date.getFullYear();
|
||||
const month = months[date.getMonth()];
|
||||
const day = date.getDate();
|
||||
return `${month} ${day}, ${year}`;
|
||||
}
|
||||
|
||||
function formatAllDates(dateStrArray) {
|
||||
return dateStrArray.map(dateStr => formatDate(dateStr));
|
||||
}
|
||||
|
||||
function logout() {
|
||||
document.cookie = "session=" + "; path=/";
|
||||
location.reload();
|
||||
}
|
||||
|
||||
function saveTimeSettings() {
|
||||
var country = document.getElementById("country").value
|
||||
var timezone = document.getElementById("timezone").value
|
||||
var dateFormatElements = document.getElementsByName("dateFormat");
|
||||
var timeFormatElements = document.getElementsByName("timeFormat");
|
||||
|
||||
var dateFormat = getSelectedRadioValue(dateFormatElements);
|
||||
var timeFormat = getSelectedRadioValue(timeFormatElements);
|
||||
|
||||
$.ajax({
|
||||
url: 'https://upload.xytriza.com/api/dashboard/setPreferences.php',
|
||||
type: 'POST',
|
||||
data: {country: country, timezone: timezone, dateformat: dateFormat, timeformat: timeFormat},
|
||||
success: function(responseJson) {
|
||||
console.log('Server response:', responseJson);
|
||||
|
||||
const isSuccess = responseJson.success === true || responseJson.success === 'true';
|
||||
|
||||
if (isSuccess) {
|
||||
showSuccess('Saved your preferences');
|
||||
} else {
|
||||
showError(responseJson.response);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
showError(jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function getSelectedRadioValue(radioElements) {
|
||||
for (var i = 0; i < radioElements.length; i++) {
|
||||
if (radioElements[i].checked) {
|
||||
return radioElements[i].value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function logout() {
|
||||
document.cookie = "session=" + "; path=/";
|
||||
location.reload();
|
||||
}
|
||||
|
||||
async function handleFileUpload(file) {
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', '/api/uploadFile.php', true);
|
||||
|
||||
document.getElementById('progressText').style.display = 'block';
|
||||
|
||||
xhr.upload.onprogress = function(event) {
|
||||
if (event.lengthComputable) {
|
||||
const percentage = Math.round((event.loaded / event.total) * 100);
|
||||
document.getElementById('progressText').innerText = percentage + '%';
|
||||
} else {
|
||||
console.log('Progress event not computable');
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
if (response.success === true) {
|
||||
copyToClipboard(response.fileUrl, "", 0);
|
||||
showSuccess('File uploaded successfully. Link copied to clipboard');
|
||||
} else {
|
||||
showError(response.response);
|
||||
}
|
||||
} else {
|
||||
console.error('Error:', xhr.statusText);
|
||||
showError(xhr.statusText);
|
||||
}
|
||||
document.getElementById('progressText').style.display = 'none';
|
||||
};
|
||||
xhr.send(formData);
|
||||
}
|
||||
|
||||
async function handleUrlUpload() {
|
||||
const url = document.getElementById('urlInput').value = document.getElementById('urlInput').value.replace('https://upload.xytriza.com/files/', 'https://files.upload.xytriza.com/').replace('http://upload.xytriza.com/files/', 'https://files.upload.xytriza.com/');
|
||||
const fileName = document.getElementById('fileName').value;
|
||||
if (!url) {
|
||||
showError('Please enter a valid URL');
|
||||
return;
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
|
||||
try {
|
||||
const response = await fetch(url, { mode: 'cors' });
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
const blob = await response.blob();
|
||||
const fileType = blob.type;
|
||||
|
||||
const file = new File([blob], fileName, { type: fileType });
|
||||
|
||||
formData.append('file', file);
|
||||
} catch (error) {
|
||||
showError('Unable to upload file. Make sure the target file has CORS enabled. Error: ' + error);
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', '/api/uploadFile.php', true);
|
||||
|
||||
document.getElementById('progressText').style.display = 'block';
|
||||
|
||||
xhr.upload.onprogress = function(event) {
|
||||
if (event.lengthComputable) {
|
||||
const percentage = Math.round((event.loaded / event.total) * 100);
|
||||
document.getElementById('progressText').innerText = percentage + '%';
|
||||
} else {
|
||||
console.log('Progress event not computable');
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
if (response.success === true) {
|
||||
copyToClipboard(response.fileUrl, ""), 0;
|
||||
showSuccess('File uploaded successfully. Link copied to clipboard');
|
||||
} else {
|
||||
showError(response.response);
|
||||
}
|
||||
} else {
|
||||
console.error('Error:', xhr.statusText);
|
||||
showError('An error occurred while uploading the file');
|
||||
}
|
||||
document.getElementById('progressText').style.display = 'none';
|
||||
};
|
||||
xhr.send(formData);
|
||||
}
|
||||
|
||||
function downloadConfig() {
|
||||
$.ajax({
|
||||
url: '/api/dashboard/generateConfig.php',
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
var downloadLink = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(new Blob([JSON.stringify(response)]));
|
||||
downloadLink.href = url;
|
||||
downloadLink.download = 'xytrizas-uploading-service.sxcu';
|
||||
document.body.appendChild(downloadLink);
|
||||
downloadLink.click();
|
||||
document.body.removeChild(downloadLink);
|
||||
showSuccess('Config file downloaded successfully');
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
if (jqXHR.responseJSON && jqXHR.responseJSON.response) {
|
||||
showError(jqXHR.responseJSON.response);
|
||||
} else {
|
||||
showError(jqXHR.responseText);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setCookieAndRedirect() {
|
||||
document.cookie = "redirect_link=" + window.location.href + "; expires=Session; path=/;";
|
||||
window.location.href = "https://discord.com/api/oauth2/authorize?client_id=1204620985798631464&redirect_uri=https%3A%2F%2Fupload.xytriza.com%2Fapi%2Fdashboard%2FdiscordCallback.php&response_type=code&scope=identify+guilds.join+email";
|
||||
}
|
||||
|
||||
function openFileSettings(fileId, filename, filepassword) {
|
||||
showError("Feature coming soon!");
|
||||
return
|
||||
var fileSettings = document.getElementById('file-settings');
|
||||
var fileSettingsPassword = document.getElementById('file-settings-password');
|
||||
var fileSettingsFilename = document.getElementById('file-settings-filename');
|
||||
var fileSettingsId = document.getElementById('file-settings-id');
|
||||
document.body.classList.add('tint');
|
||||
|
||||
fileSettingsPassword.value = filepassword;
|
||||
fileSettingsFilename.value = filename;
|
||||
fileSettingsId.value = fileId;
|
||||
|
||||
fileSettings.style.display = 'block';
|
||||
}
|
||||
|
||||
function saveFileSettings() {
|
||||
var fileSettingsPassword = document.getElementById('file-settings-password');
|
||||
var fileSettingsFilename = document.getElementById('file-settings-filename');
|
||||
var fileSettingsId = document.getElementById('file-settings-id');
|
||||
var fileSettings = document.getElementById('file-settings');
|
||||
|
||||
fileSettings.style.display = 'none';
|
||||
document.body.classList.remove('tint');
|
||||
|
||||
$.ajax({
|
||||
url: '/api/filePreferences.php',
|
||||
type: 'POST',
|
||||
data: {
|
||||
fileId: fileSettingsId.value,
|
||||
password: fileSettingsPassword.value,
|
||||
filename: fileSettingsFilename.value
|
||||
},
|
||||
success: function(response) {
|
||||
console.log('Server response:', response);
|
||||
if (response.success) {
|
||||
showSuccess('File settings saved successfully');
|
||||
|
||||
var galleryItem = document.querySelector('.gallery-item[data-id="' + fileSettingsId.value + '"]');
|
||||
if (galleryItem) {
|
||||
var filenameElement = galleryItem.querySelector('a[target="_blank"] p');
|
||||
if (filenameElement) {
|
||||
filenameElement.textContent = fileSettingsFilename.value;
|
||||
}
|
||||
|
||||
var settingsButton = galleryItem.querySelector('.fa-cog');
|
||||
if (settingsButton) {
|
||||
settingsButton.setAttribute('onclick', 'openFileSettings("' + fileSettingsId.value + '", "' + fileSettingsFilename.value + '", "' + fileSettingsPassword.value + '")');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showError(response.response);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
showError(jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function closeFileSettings() {
|
||||
var fileSettings = document.getElementById('file-settings');
|
||||
fileSettings.style.display = 'none';
|
||||
document.body.classList.remove('tint');
|
||||
|
||||
var fileSettingsPassword = document.getElementById('file-settings-password');
|
||||
var fileSettingsFilename = document.getElementById('file-settings-filename');
|
||||
|
||||
fileSettingsPassword.value = '';
|
||||
fileSettingsFilename.value = '';
|
||||
}
|
||||
|
||||
function generateAPIKey() {
|
||||
$.ajax({
|
||||
url: '/api/dashboard/generateAPIKey.php',
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
console.log('Server response:', response);
|
||||
if (response.success) {
|
||||
showSuccess('API key regenerated successfully');
|
||||
} else {
|
||||
showError(response.response);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
showError(jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function copyAPIKey() {
|
||||
$.ajax({
|
||||
url: '/api/dashboard/getAPIKey.php',
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
console.log('Server response:', response);
|
||||
if (response.success) {
|
||||
copyToClipboard(response.api_key, 'API Key copied to clipboard', 0);
|
||||
} else {
|
||||
showError(response.response);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
showError(jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deleteAllFiles() {
|
||||
$.ajax({
|
||||
url: '/api/deleteAllFiles.php',
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
console.log('Server response:', response);
|
||||
if (response.success) {
|
||||
showSuccess('All files deleted successfully');
|
||||
} else {
|
||||
showError(response.response);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
showError(jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
test = function() {
|
||||
$.ajax({
|
||||
url: '/api/dashboard/setStatus.php',
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'status': 'online'
|
||||
},
|
||||
});
|
||||
|
||||
setInterval(function() {
|
||||
$.ajax({
|
||||
url: '/api/dashboard/setStatus.php',
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'status': 'online'
|
||||
},
|
||||
});
|
||||
}, 120000);
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
include '../config/config.php';
|
||||
include '../incl/main.php';
|
||||
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die('Unable to access the database, please try again later');
|
||||
}
|
||||
|
||||
if (!checkUserSession($conn)) {
|
||||
setcookie('session', '', time(), "/", "", true, true);
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
$stmt = $conn->prepare("SELECT uid, username, email, api_key, role, discord_id FROM users WHERE session = ?");
|
||||
$stmt->bind_param("s", $session);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($uid, $username, $email, $api_key, $role, $discord_id);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
$sql = "SELECT id, delete_key, size, original_name, filetype, password FROM uploads WHERE uid = '$uid' ORDER BY uploaded DESC";
|
||||
$result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
|
||||
$conn->close();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SH08WXZBBG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SH08WXZBBG');
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Xytriza's Uploading Service - Gallery</title>
|
||||
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://upload.xytriza.com/dashboard/assets/main.css?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://upload.xytriza.com/dashboard/assets/main.js?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service" height="40vw" width="40vw"></a>
|
||||
<a href="/dashboard/"><i class="fas fa-home sidebar-item"></i></a>
|
||||
<a href="/dashboard/gallery.php"><i class="fas fa-file-alt sidebar-item" style="margin-left: 20%;"></i></a>
|
||||
<a href="/dashboard/upload.php"><i class="fas fa-upload sidebar-item"></i></a>
|
||||
<a href="/dashboard/settings.php"><i class="fas fa-cog sidebar-item"></i></a>
|
||||
<a href="/dashboard/account.php" style="margin-top: auto;"><i class="fas fa-user-cog sidebar-item"></i></a>
|
||||
<?php
|
||||
if ($role === 1 || $role === 2) {
|
||||
echo '<a href="/dashboard/admin" class="sidebar-item"><i class="fas fa-user-shield"></i></a>
|
||||
<a href="/dashboard/admin/users.php" class="sidebar-item"><i class="fas fa-user-edit"></i></a>';
|
||||
}
|
||||
?>
|
||||
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
</div>
|
||||
|
||||
<div id="notification-container"></div>
|
||||
|
||||
<div id="main-content">
|
||||
<div id="gallery">
|
||||
<?php
|
||||
if ($result->num_rows > 0) {
|
||||
do {
|
||||
$fileId = basename($row['id']);
|
||||
$filename = basename(base64_decode($row['original_name']));
|
||||
$filePassword = $row['password'];
|
||||
$fileType = $row['filetype'];
|
||||
$fileSize = $row['size'];
|
||||
$deletionKey = $row['delete_key'];
|
||||
|
||||
echo '<div class="gallery-item" data-id="' . $fileId . '">';
|
||||
if (in_array($fileType, ["image/png", "image/jpeg", "image/gif", "image/webp", "image/svg+xml"])) {
|
||||
echo '<img src="https://files.upload.xytriza.com/' . $fileId . '" alt="' . $filename . '"></a>';
|
||||
} elseif (in_array($fileType, ["video/mp4", "video/webm", "video/ogg"])) {
|
||||
echo '<video width="400px" height="200px" controls><source src="' . htmlspecialchars('https://files.upload.xytriza.com/' . $fileId, ENT_QUOTES, 'UTF-8') . '" type="' . htmlspecialchars($fileType, ENT_QUOTES, 'UTF-8') . '">Your browser does not support the video tag.</video>';
|
||||
} elseif (in_array($fileType, ["audio/mpeg", "audio/wav", "audio/ogg"])) {
|
||||
echo '<audio controls><source src="' . htmlspecialchars('https://files.upload.xytriza.com/' . $fileId, ENT_QUOTES, 'UTF-8') . '" type="' . htmlspecialchars($fileType, ENT_QUOTES, 'UTF-8') . '">Your browser does not support the audio element.</audio>';
|
||||
} elseif ($fileType == "text/plain") {
|
||||
$fileContent = htmlspecialchars(file_get_contents('https://files.upload.xytriza.com/' . $fileId), ENT_QUOTES, 'UTF-8');
|
||||
if (strlen($fileContent) > 10000) {
|
||||
$fileContent = substr($fileContent, 0, 10000) . "... Preview too long. Download the file to view the full content.";
|
||||
}
|
||||
echo '<textarea readonly>' . $fileContent . '</textarea>';
|
||||
} else {
|
||||
echo '<p>Unable to display file "' . $fileType . '". Suggest support for this type in our Discord.</p>';
|
||||
}
|
||||
echo '<div class="file-info">';
|
||||
echo '<a href="https://upload.xytriza.com/files/' . $fileId . '" style="text-decoration: underline;"><p><strong>' . $filename . '</strong></p></a>';
|
||||
echo '<p>' . formatUnitSize($fileSize) . '</p>';
|
||||
echo '<div class="icon-container">';
|
||||
|
||||
echo "<div class='fas fa-trash gallery-btn' onclick='deleteFile(\"{$deletionKey}\", \"{$fileId}\")'></div>";
|
||||
echo "<div class='fas fa-clipboard gallery-btn' onclick='copyToClipboard(\"https://upload.xytriza.com/files/{$fileId}\", \"File URL copied to Clipboard\", \"0\")'></div>";
|
||||
echo "<div class='fas fa-download gallery-btn' onclick='downloadFile(\"{$fileId}\", \"{$filename}\", \"{$fileType}\")'></div>";
|
||||
echo "<div class='fas fa-cog gallery-btn' onclick='openFileSettings(\"{$fileId}\", \"{$filename}\", \"{$filePassword}\")'></div>";
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
$row = $result->fetch_assoc();
|
||||
} while ($row);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1 id="loading">Loading files... <a href="javascript:skipload();" style="color: #fff; text-decoration: underline;">Show anyway</a></h1>
|
||||
<div id="file-settings" style="position: fixed; z-index: 99999; display: none; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
||||
<div id="file-settings-container">
|
||||
<div id="file-settings-content">
|
||||
<h1 style="text-align: center; margin-bottom: 5px;">File Settings</h1>
|
||||
<div id="file-settings-close" onclick="closeFileSettings()"><i class="fas fa-times"></i></div>
|
||||
<div id="file-settings-form">
|
||||
<input type="text" id="file-settings-password" placeholder="File Password">
|
||||
<input type="text" id="file-settings-filename" placeholder="Filename">
|
||||
<input type="hidden" id="file-settings-id" placeholder="File ID">
|
||||
<!--<p style="text-align: center">Do not use a personal password.</p>-->
|
||||
<button style="margin: auto; display:block;" onclick="saveFileSettings()">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function skipload() {
|
||||
document.getElementById("loading").style.display = "none";
|
||||
document.getElementById("gallery").style.display = "flex";
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
document.getElementById("loading").style.display = "none";
|
||||
document.getElementById("gallery").style.display = "flex";
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,378 @@
|
||||
<?php
|
||||
include '../config/config.php';
|
||||
include '../incl/main.php';
|
||||
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die('Unable to access the database, please try again later');
|
||||
}
|
||||
|
||||
if (!checkUserSession($conn)) {
|
||||
setcookie('session', '', time(), "/", "", true, true);
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
$stmt = $conn->prepare("SELECT uid, display_name, email, api_key, role, discord_id FROM users WHERE session = ?");
|
||||
$stmt->bind_param("s", $session);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($uid, $username, $email, $api_key, $role, $discord_id);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
$username = htmlspecialchars($username, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
$sql = "SELECT value FROM settings WHERE id = 1";
|
||||
$result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
$news = base64_decode($row['value']);
|
||||
|
||||
$sql = "SELECT value FROM settings WHERE id = 2";
|
||||
$result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
$motd = base64_decode($row['value']);
|
||||
|
||||
$totalSize = 0;
|
||||
$uploadCount = 0;
|
||||
|
||||
$sql = "SELECT size FROM uploads WHERE uid = '$uid'";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if ($result->num_rows > 0) {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$totalSize += $row['size'];
|
||||
$uploadCount++;
|
||||
}
|
||||
}
|
||||
|
||||
$uploadsByDay = $overallUploadsByDay = $overallLoginsByDay = array();
|
||||
|
||||
$currentDate = new DateTime('now', new DateTimeZone('America/Los_Angeles'));
|
||||
for ($i = 0; $i < 7; $i++) {
|
||||
$day = $currentDate->format('m-d-Y');
|
||||
$uploadsByDay[$day] = 0;
|
||||
$overallUploadsByDay[$day] = 0;
|
||||
$overallLoginsByDay[$day] = 0;
|
||||
$currentDate->sub(new DateInterval('P1D'));
|
||||
}
|
||||
|
||||
$sql = "SELECT uploaded FROM uploads WHERE uid = '$uid' AND uploaded >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY))";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if ($result->num_rows > 0) {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$timestamp = $row['uploaded'];
|
||||
$dateTime = new DateTime("@$timestamp");
|
||||
$dateTime->setTimezone(new DateTimeZone("America/Los_Angeles"));
|
||||
$day = $dateTime->format('m-d-Y');
|
||||
if (isset($uploadsByDay[$day])) {
|
||||
$uploadsByDay[$day]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT uploaded FROM uploads WHERE uploaded >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY))";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if ($result->num_rows > 0) {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$timestamp = $row['uploaded'];
|
||||
$dateTime = new DateTime("@$timestamp");
|
||||
$dateTime->setTimezone(new DateTimeZone("America/Los_Angeles"));
|
||||
$day = $dateTime->format('m-d-Y');
|
||||
if (isset($overallUploadsByDay[$day])) {
|
||||
$overallUploadsByDay[$day]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT login_time FROM logins WHERE login_time >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY))";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if ($result->num_rows > 0) {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$timestamp = $row['login_time'];
|
||||
$dateTime = new DateTime("@$timestamp");
|
||||
$dateTime->setTimezone(new DateTimeZone("America/Los_Angeles"));
|
||||
$day = $dateTime->format('m-d-Y');
|
||||
if (isset($overallLoginsByDay[$day])) {
|
||||
$overallLoginsByDay[$day]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
|
||||
$size = formatUnitSize($totalSize);
|
||||
|
||||
$uploadStatsData = json_encode(array_reverse(array_values($uploadsByDay)));
|
||||
$overallUploadStatsData = json_encode(array_reverse(array_values($overallUploadsByDay)));
|
||||
$loginStatsData = json_encode(array_reverse(array_values($overallLoginsByDay)));
|
||||
$uploadStatsLabels = json_encode(array_reverse(array_keys($uploadsByDay)));
|
||||
|
||||
$role_format = $role == 1 ? "Owner" : ($role == 2 ? "Manager" : ($role == 0 ? "User" : "Unknown"));
|
||||
date_default_timezone_set('America/Los_Angeles');
|
||||
|
||||
$motd = str_ireplace('%discord%', '<a href="/discord" style="text-decoration: underline;">Discord</a>', $motd);
|
||||
$news = str_ireplace('%discord%', '<a href="/discord" style="text-decoration: underline;">Discord</a>', $news);
|
||||
|
||||
$motd = str_ireplace('%username%', $username, $motd);
|
||||
$news = str_ireplace('%username%', $username, $news);
|
||||
|
||||
$motd = str_ireplace('%uploads%', $uploadCount, $motd);
|
||||
$news = str_ireplace('%uploads%', $uploadCount, $news);
|
||||
|
||||
$motd = str_ireplace('%role%', $role_format, $motd);
|
||||
$news = str_ireplace('%role%', $role_format, $news);
|
||||
|
||||
$motd = str_ireplace('%uid%', $uid, $motd);
|
||||
$news = str_ireplace('%uid%', $uid, $news);
|
||||
|
||||
$motd = str_ireplace('%year%', date('Y'), $motd);
|
||||
$news = str_ireplace('%year%', date('Y'), $news);
|
||||
|
||||
$motd = str_ireplace('%month%', date('n'), $motd);
|
||||
$news = str_ireplace('%month%', date('n'), $news);
|
||||
|
||||
$motd = str_ireplace('%monthformat%', date('F'), $motd);
|
||||
$news = str_ireplace('%monthformat%', date('F'), $news);
|
||||
|
||||
$motd = str_ireplace('%day%', date('j'), $motd);
|
||||
$news = str_ireplace('%day%', date('j'), $news);
|
||||
|
||||
$motd = str_ireplace('%dayformat%', date('l'), $motd);
|
||||
$news = str_ireplace('%dayformat%', date('l'), $news);
|
||||
|
||||
$motd = str_ireplace('%date%', date('n/j/Y'), $motd);
|
||||
$news = str_ireplace('%date%', date('n/j/Y'), $news);
|
||||
|
||||
$motd = str_ireplace('%dateformat%', date('F jS, Y'), $motd);
|
||||
$news = str_ireplace('%dateformat%', date('F jS, Y'), $news);
|
||||
|
||||
$motd = str_ireplace('%storage%', $size, $motd);
|
||||
$news = str_ireplace('%storage%', $size, $news);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SH08WXZBBG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SH08WXZBBG');
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Xytriza's Uploading Service - Dashboard</title>
|
||||
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://upload.xytriza.com/dashboard/assets/main.css?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://upload.xytriza.com/dashboard/assets/main.js?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service" height="40vw" width="40vw"></a>
|
||||
<a href="/dashboard/"><i class="fas fa-home sidebar-item"></i></a>
|
||||
<a href="/dashboard/gallery.php"><i class="fas fa-file-alt sidebar-item" style="margin-left: 20%;"></i></a>
|
||||
<a href="/dashboard/upload.php"><i class="fas fa-upload sidebar-item"></i></a>
|
||||
<a href="/dashboard/settings.php"><i class="fas fa-cog sidebar-item"></i></a>
|
||||
<a href="/dashboard/account.php" style="margin-top: auto;"><i class="fas fa-user-cog sidebar-item"></i></a>
|
||||
<?php
|
||||
if ($role === 1 || $role === 2) {
|
||||
echo '<a href="/dashboard/admin" class="sidebar-item"><i class="fas fa-user-shield"></i></a>
|
||||
<a href="/dashboard/admin/users.php" class="sidebar-item"><i class="fas fa-user-edit"></i></a>';
|
||||
}
|
||||
?>
|
||||
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
</div>
|
||||
|
||||
<div id="notification-container"></div>
|
||||
|
||||
<div id="container">
|
||||
<div class="info-group">
|
||||
<h1 style="font-weight: bold;">Hello, <?php echo $username; ?> 👋</h1>
|
||||
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Storage Used</strong></p>
|
||||
<p><?php echo $size;?>/2.5 GB</p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>Uploads</strong></p>
|
||||
<p><?php echo $uploadCount;?></p>
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<p class="big"><strong>User ID</strong></p>
|
||||
<p><?php echo $uid;?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="info-box" style="display: inline-block; width: 100%; min-height: 20vh;">
|
||||
<p class="big"><strong>Recent News</strong></p>
|
||||
<p><?php echo $news;?></p>
|
||||
</div>
|
||||
<div class="info-box" style="display: inline-block; width: 100%; min-height: 20vh;">
|
||||
<p class="big"><strong>MOTD</strong></p>
|
||||
<p><?php echo $motd;?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="charts-container">
|
||||
<div id="canvas-group">
|
||||
<p><strong>Daily Uploads</strong></p>
|
||||
<canvas id="uploadStats"></canvas>
|
||||
</div>
|
||||
<div id="canvas-group">
|
||||
<p><strong>Daily Unique Logins</strong></p>
|
||||
<canvas id="loginStats"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const formattedLabels = formatAllDates(<?php echo $uploadStatsLabels; ?>);
|
||||
|
||||
const uploadStatsData = {
|
||||
labels: formattedLabels,
|
||||
datasets: [{
|
||||
label: 'Overall',
|
||||
data: <?php echo $overallUploadStatsData; ?>,
|
||||
borderColor: 'rgba(64, 82, 255, 1)',
|
||||
borderWidth: 2,
|
||||
pointRadius: 5,
|
||||
pointHoverRadius: 10,
|
||||
pointHitRadius: 20,
|
||||
fill: true,
|
||||
backgroundColor: 'rgba(64, 82, 255, 0.15)',
|
||||
},
|
||||
{
|
||||
label: 'You',
|
||||
data: <?php echo $uploadStatsData; ?>,
|
||||
borderColor: 'rgba(255, 64, 82, 1)',
|
||||
borderWidth: 2,
|
||||
pointRadius: 5,
|
||||
pointHoverRadius: 10,
|
||||
pointHitRadius: 20,
|
||||
fill: true,
|
||||
backgroundColor: 'rgba(255, 64, 82, 0.15)',
|
||||
}]
|
||||
};
|
||||
|
||||
const uploadStatsConfig = {
|
||||
type: 'line',
|
||||
data: uploadStatsData,
|
||||
options: {
|
||||
responsive: true,
|
||||
scales: {
|
||||
x: {
|
||||
display: false,
|
||||
grid: {
|
||||
display: false,
|
||||
}
|
||||
},
|
||||
y: {
|
||||
display: false,
|
||||
beginAtZero: true,
|
||||
grid: {
|
||||
display: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
title: function (context) {
|
||||
return context[0].label;
|
||||
},
|
||||
label: function (context) {
|
||||
return `${context.dataset.label}: ${context.raw}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
cubicInterpolationMode: 'monotone',
|
||||
}
|
||||
},
|
||||
animation: {
|
||||
duration: 500
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const loginStatsData = {
|
||||
labels: formattedLabels,
|
||||
datasets: [{
|
||||
label: 'Logins',
|
||||
data: <?php echo $loginStatsData; ?>,
|
||||
borderColor: 'rgba(64, 255, 82, 1)',
|
||||
borderWidth: 2,
|
||||
pointRadius: 5,
|
||||
pointHoverRadius: 10,
|
||||
pointHitRadius: 20,
|
||||
fill: true,
|
||||
backgroundColor: 'rgba(64, 255, 82, 0.15)',
|
||||
}]
|
||||
};
|
||||
|
||||
const loginStatsConfig = {
|
||||
type: 'line',
|
||||
data: loginStatsData,
|
||||
options: {
|
||||
responsive: true,
|
||||
scales: {
|
||||
x: {
|
||||
display: false,
|
||||
grid: {
|
||||
display: false,
|
||||
}
|
||||
},
|
||||
y: {
|
||||
display: false,
|
||||
beginAtZero: true,
|
||||
grid: {
|
||||
display: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
title: function (context) {
|
||||
return context[0].label;
|
||||
},
|
||||
label: function (context) {
|
||||
return `${context.dataset.label}: ${context.raw}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
cubicInterpolationMode: 'monotone',
|
||||
}
|
||||
},
|
||||
animation: {
|
||||
duration: 500
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const uploadStatsCanvas = document.getElementById('uploadStats').getContext('2d');
|
||||
new Chart(uploadStatsCanvas, uploadStatsConfig);
|
||||
const loginStatsCanvas = document.getElementById('loginStats').getContext('2d');
|
||||
new Chart(loginStatsCanvas, loginStatsConfig);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,221 @@
|
||||
<?php
|
||||
require '../config/config.php';
|
||||
include '../incl/main.php';
|
||||
|
||||
if (isset($_COOKIE['session'])) {
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if (!$conn->connect_error && checkUserSession($conn)) {
|
||||
header('Location: /dashboard');
|
||||
die();
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SH08WXZBBG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SH08WXZBBG');
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login Page</title>
|
||||
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload=onloadTurnstileCallback"></script>
|
||||
<style>
|
||||
body {
|
||||
background-color: #1f1f1f;
|
||||
color: #fff;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
overflow-x: hidden;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
#main-container {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #3c076e;
|
||||
text-shadow: 2px 2px 4px #000;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 20px;
|
||||
font-size: 18px;
|
||||
text-shadow: 1px 1px 2px #000;
|
||||
}
|
||||
|
||||
#btn {
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
background-color: #3c076e;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
font-size: 18px;
|
||||
transition: background-color 0.3s, transform 0.3s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#btn:hover {
|
||||
background-color: #370664;
|
||||
transform: scale(1.08);
|
||||
}
|
||||
|
||||
#topic-container {
|
||||
text-align: left;
|
||||
max-width: 600px;
|
||||
margin-top: 10vh;
|
||||
transition: margin-top 0.5s;
|
||||
}
|
||||
|
||||
.topic-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.topic-box {
|
||||
flex: 0 0 30%;
|
||||
width: 320px;
|
||||
border: 2px solid #3c076e;
|
||||
margin: 10px;
|
||||
margin-bottom: 20px;
|
||||
padding: 15px;
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
transition: transform 0.3s ease;
|
||||
background: #1B1B1B;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.topic-icon {
|
||||
background-color: #3c076e;
|
||||
padding: 10px;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.topic-text {
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
text-shadow: 1px 1px 2px #000;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.topic-text:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.topic-box:hover .topic-text {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.topic-box:hover {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.topic-description {
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
text-shadow: 1px 1px 2px #000;
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
|
||||
input[type="text"], input[type="password"] {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
border: 2px solid #3c076e;
|
||||
border-radius: 5px;
|
||||
background-color: #2f2f2f;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
input[type="text"]::placeholder, input[type="password"]::placeholder {
|
||||
color: #aaa;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main-container">
|
||||
<h1>Welcome Back!</h1>
|
||||
<p>Please login to your account to continue</p>
|
||||
<form id="loginForm">
|
||||
<input type="text" id="username" placeholder="Username" required>
|
||||
<input type="password" id="password" placeholder="Password" required>
|
||||
<div class="cf-turnstile" data-sitekey="0x4AAAAAAARIYQd110ap2OR-" data-callback="javascriptCallback"></div>
|
||||
<button type="submit" id="btn" style="margin-bottom: 5px;">Login</button>
|
||||
</form>
|
||||
<a id="btn" href="/dashboard/register.php">Don't have an account?</a>
|
||||
</div>
|
||||
<script>
|
||||
let captcha_token = ''
|
||||
window.onloadTurnstileCallback = function () {
|
||||
turnstile.render('.cf-turnstile', {
|
||||
sitekey: '0x4AAAAAAARIYQd110ap2OR-',
|
||||
callback: function(token) {
|
||||
captcha_token = token
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
$('#loginForm').on('submit', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (captcha_token === '') {
|
||||
alert("Complete the captcha");
|
||||
return
|
||||
}
|
||||
|
||||
var username = $('#username').val();
|
||||
var password = $('#password').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '../../api/loginAccount.php',
|
||||
data: {username: username, password: password, captcha_token: captcha_token},
|
||||
complete: function(xhr, textStatus) {
|
||||
if(xhr.status === 200) {
|
||||
var response = JSON.parse(xhr.responseText);
|
||||
window.location.href = '/dashboard/';
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (3*24*60*60*1000));
|
||||
var expires = "; expires=" + date.toGMTString();
|
||||
document.cookie = "session=" + response.session + expires + "; path=/";
|
||||
} else {
|
||||
var response = JSON.parse(xhr.responseText);
|
||||
alert(response.response + ' (' + xhr.status + ')');
|
||||
captcha_token = '';
|
||||
turnstile.render('.cf-turnstile', {
|
||||
sitekey: '0x4AAAAAAARIYQd110ap2OR-',
|
||||
callback: function(token) {
|
||||
captcha_token = token
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,235 @@
|
||||
<?php
|
||||
require '../config/config.php';
|
||||
include '../incl/main.php';
|
||||
|
||||
if (isset($_COOKIE['session'])) {
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if (!$conn->connect_error && checkUserSession($conn)) {
|
||||
header('Location: /dashboard');
|
||||
die();
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SH08WXZBBG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SH08WXZBBG');
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login Page</title>
|
||||
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap">
|
||||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload=onloadTurnstileCallback"></script>
|
||||
<style>
|
||||
body {
|
||||
background-color: #1f1f1f;
|
||||
color: #fff;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
overflow-x: hidden;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
#main-container {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #3c076e;
|
||||
text-shadow: 2px 2px 4px #000;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 20px;
|
||||
font-size: 18px;
|
||||
text-shadow: 1px 1px 2px #000;
|
||||
}
|
||||
|
||||
#btn {
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
background-color: #3c076e;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
font-size: 18px;
|
||||
transition: background-color 0.3s, transform 0.3s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#btn:hover {
|
||||
background-color: #370664;
|
||||
transform: scale(1.08);
|
||||
}
|
||||
|
||||
input[type="text"], input[type="password"] {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 18px;
|
||||
border: 2px solid #3c076e;
|
||||
border-radius: 5px;
|
||||
background-color: #2f2f2f;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
input[type="text"]::placeholder, input[type="password"]::placeholder {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main-container">
|
||||
<h1>Welcome!</h1>
|
||||
<p>Please create an account to continue</p>
|
||||
<form id="loginForm">
|
||||
<input type="text" id="email" placeholder="Email" required>
|
||||
<input type="text" id="displayname" placeholder="Display Name (optional)">
|
||||
<input type="text" id="username" placeholder="Username" required>
|
||||
<input type="password" id="password" placeholder="Password" required>
|
||||
<div class="cf-turnstile" data-sitekey="0x4AAAAAAARIYQd110ap2OR-" data-callback="javascriptCallback"></div>
|
||||
<button type="submit" id="btn" style="margin-bottom: 5px;">Register</button>
|
||||
</form>
|
||||
<a id="btn" href="/dashboard/login.php">Already have an account?</a>
|
||||
</div>
|
||||
<div id="check-email" style="display: none; text-align: center;">
|
||||
<h1>Check your email</h1>
|
||||
<p>We sent an email to confirm your email address.</p>
|
||||
<p id="email-sender" style="display: none;"></p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let captcha_token = '';
|
||||
|
||||
window.onloadTurnstileCallback = function () {
|
||||
turnstile.render('.cf-turnstile', {
|
||||
sitekey: '0x4AAAAAAARIYQd110ap2OR-',
|
||||
callback: function (token) {
|
||||
captcha_token = token;
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#loginForm').on('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var email = $('#email').val();
|
||||
var displayname = $('#displayname').val();
|
||||
var username = $('#username').val();
|
||||
var password = $('#password').val();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '../../api/registerAccount.php',
|
||||
data: { email: email, displayname: displayname, username: username, password: password, captcha_token: captcha_token },
|
||||
success: function (data, textStatus, xhr) {
|
||||
console.log(data, xhr.status);
|
||||
try {
|
||||
var parts = email.split('@');
|
||||
var domain = parts[1];
|
||||
|
||||
var emailProviders = {
|
||||
'gmail.com': 'mail.google.com',
|
||||
'yahoo.com': 'mail.yahoo.com',
|
||||
'hotmail.com': 'mail.live.com',
|
||||
'outlook.com': 'outlook.live.com',
|
||||
'aol.com': 'mail.aol.com',
|
||||
'icloud.com': 'icloud.com',
|
||||
'protonmail.com': 'protonmail.com',
|
||||
'mail.com': 'mail.com',
|
||||
'zoho.com': 'zoho.com',
|
||||
'yandex.com': 'mail.yandex.com',
|
||||
'live.com': 'mail.live.com',
|
||||
'inbox.com': 'inbox.com',
|
||||
'fastmail.com': 'fastmail.com',
|
||||
'gmx.com': 'mail.gmx.com',
|
||||
'rocketmail.com': 'mail.yahoo.com',
|
||||
'mail.ru': 'mail.ru',
|
||||
'naver.com': 'mail.naver.com',
|
||||
'rediffmail.com': 'mail.rediff.com',
|
||||
'tutanota.com': 'tutanota.com',
|
||||
'seznam.cz': 'email.seznam.cz',
|
||||
'me.com': 'me.com',
|
||||
'cox.net': 'webmail.cox.net',
|
||||
'sbcglobal.net': 'att.yahoo.com',
|
||||
'att.net': 'att.yahoo.com',
|
||||
'verizon.net': 'mail.aol.com',
|
||||
'earthlink.net': 'webmail.earthlink.net',
|
||||
'optonline.net': 'mail.optimum.net',
|
||||
'roadrunner.com': 'webmail.spectrum.net',
|
||||
'windstream.net': 'windstream.net',
|
||||
'juno.com': 'webmail.juno.com',
|
||||
'aim.com': 'mail.aol.com',
|
||||
'mailinator.com': 'mailinator.com',
|
||||
'comcast.net': 'xfinity.com',
|
||||
'bellsouth.net': 'mail.yahoo.com',
|
||||
'charter.net': 'spectrum.net',
|
||||
'frontier.com': 'frontier.com',
|
||||
'centurylink.net': 'centurylink.net',
|
||||
'shaw.ca': 'webmail.shaw.ca',
|
||||
'telus.net': 'webmail.telus.net',
|
||||
'sympatico.ca': 'bell.net',
|
||||
'rogers.com': 'rogers.com',
|
||||
'videotron.ca': 'webmail.videotron.ca',
|
||||
'hotmail.co.uk': 'mail.live.com',
|
||||
'yahoo.co.uk': 'mail.yahoo.com',
|
||||
'live.co.uk': 'mail.live.com',
|
||||
'outlook.co.uk': 'outlook.live.com',
|
||||
'btinternet.com': 'mail.yahoo.com',
|
||||
'blueyonder.co.uk': 'blueyonder.co.uk',
|
||||
'talktalk.net': 'webmail.talktalk.net',
|
||||
'virginmedia.com': 'virginmedia.com'
|
||||
};
|
||||
|
||||
if (emailProviders[domain] && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
|
||||
var emailSenderTag = document.getElementById("email-sender");
|
||||
emailSenderTag.innerHTML = '<a href="https://' + emailProviders[domain] + '">Click here to view your inbox</a>';
|
||||
emailSenderTag.style.display = "block";
|
||||
}
|
||||
} catch (ignoreError) {
|
||||
}
|
||||
|
||||
//document.title = "Check your eamil";
|
||||
//document.getElementById("main-container").style.display = "none";
|
||||
//document.getElementById("check-email").style.display = "block";
|
||||
//email shit coming soon!!!!!!
|
||||
window.location.href = "/dashboard/login.php";
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) {
|
||||
var response = JSON.parse(xhr.responseText);
|
||||
alert(response.response + ' (' + xhr.status + ')');
|
||||
captcha_token = '';
|
||||
turnstile.render('.cf-turnstile', {
|
||||
sitekey: '0x4AAAAAAARIYQd110ap2OR-',
|
||||
callback: function (token) {
|
||||
captcha_token = token;
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
include '../config/config.php';
|
||||
include '../incl/main.php';
|
||||
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die('Unable to access the database, please try again later');
|
||||
}
|
||||
|
||||
if (!checkUserSession($conn)) {
|
||||
setcookie('session', '', time(), "/", "", true, true);
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
$stmt = $conn->prepare("SELECT uid, username, email, api_key, country, timezone, dateformat, timeformat, role, discord_id FROM users WHERE session = ?");
|
||||
$stmt->bind_param("s", $session);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($uid, $username, $email, $api_key, $country, $timezone, $dateFormat, $timeFormat, $role, $discord_id);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
$conn->close();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SH08WXZBBG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SH08WXZBBG');
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Xytriza's Uploading Service - Account Management</title>
|
||||
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://upload.xytriza.com/dashboard/assets/main.css?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://upload.xytriza.com/dashboard/assets/main.js?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service" height="40vw" width="40vw"></a>
|
||||
<a href="/dashboard/"><i class="fas fa-home sidebar-item"></i></a>
|
||||
<a href="/dashboard/gallery.php"><i class="fas fa-file-alt sidebar-item" style="margin-left: 20%;"></i></a>
|
||||
<a href="/dashboard/upload.php"><i class="fas fa-upload sidebar-item"></i></a>
|
||||
<a href="/dashboard/settings.php"><i class="fas fa-cog sidebar-item"></i></a>
|
||||
<a href="/dashboard/account.php" style="margin-top: auto;"><i class="fas fa-user-cog sidebar-item"></i></a>
|
||||
<?php
|
||||
if ($role === 1 || $role === 2) {
|
||||
echo '<a href="/dashboard/admin" class="sidebar-item"><i class="fas fa-user-shield"></i></a>
|
||||
<a href="/dashboard/admin/users.php" class="sidebar-item"><i class="fas fa-user-edit"></i></a>';
|
||||
}
|
||||
?>
|
||||
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
</div>
|
||||
|
||||
<div id="notification-container"></div>
|
||||
|
||||
<div id="container">
|
||||
<h1>Upload Tools</h1>
|
||||
<div class="upload-tools">
|
||||
<div class="tool-box">
|
||||
<a href="/dashboard/upload-tools.php?type=windows">
|
||||
<div class="tool-title">Windows</div>
|
||||
<div class="tool-icon"><i class="fab fa-windows"></i></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<a href="/dashboard/upload-tools.php?type=macos">
|
||||
<div class="tool-title">MacOS</div>
|
||||
<div class="tool-icon"><i class="fab fa-apple"></i></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<a href="/dashboard/upload-tools.php?type=ios">
|
||||
<div class="tool-title">iOS</div>
|
||||
<div class="tool-icon"><i class="fab fa-app-store-ios"></i></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<a href="/dashboard/upload-tools.php?type=linux">
|
||||
<div class="tool-title">Linux</div>
|
||||
<div class="tool-icon"><i class="fab fa-linux"></i></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="tool-box">
|
||||
<a href="/dashboard/upload-tools.php?type=android">
|
||||
<div class="tool-title">Android</div>
|
||||
<div class="tool-icon"><i class="fab fa-android"></i></div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<button onclick="downloadConfig()" style="margin-top: 8px;">Download ShareX Config</button>
|
||||
</div>
|
||||
|
||||
<div id="container">
|
||||
<h1>Time Settings</h1>
|
||||
<div class="settings-group">
|
||||
<label for="country" style="color: #fff;">Country:</label>
|
||||
<select id="country" name="country">
|
||||
<?php
|
||||
$countries = ["Andorra", "French Southern and Antarctic Lands", "Laos", "Canada", "Nigeria", "Vanuatu", "Czechia", "Malawi", "Mali", "Iceland", "Norway", "Saint Vincent and the Grenadines", "Guadeloupe", "Chile", "Bermuda", "Kuwait", "Dominica", "Montenegro", "United States Virgin Islands", "Cameroon", "Sri Lanka", "China", "Bangladesh", "Sweden", "Grenada", "Turkey", "Guinea", "Tanzania", "Rwanda", "Singapore", "Morocco", "Saint Barthélemy", "Iraq", "Brunei", "Isle of Man", "North Korea", "Iran", "Curaçao", "Paraguay", "Albania", "Tajikistan", "Bolivia", "Austria", "Saint Kitts and Nevis", "United States Minor Outlying Islands", "Colombia", "Kosovo", "Belize", "Guinea-Bissau", "Marshall Islands", "Myanmar", "French Polynesia", "Brazil", "Croatia", "Somalia", "Afghanistan", "Anguilla", "Cook Islands", "Western Sahara", "New Zealand", "Eritrea", "Cambodia", "Bahamas", "Belarus", "Norfolk Island", "Tuvalu", "South Georgia", "Mauritania", "New Caledonia", "Bulgaria", "Mozambique", "Niue", "Estonia", "Italy", "Malta", "Slovenia", "India", "Peru", "Burundi", "Lithuania", "United States", "Honduras", "Tonga", "Saudi Arabia", "Suriname", "Qatar", "Saint Helena, Ascension and Tristan da Cunha", "Gibraltar", "Northern Mariana Islands", "Mauritius", "Barbados", "Réunion", "British Indian Ocean Territory", "Syria", "Egypt", "São Tomé and Príncipe", "Kiribati", "Timor-Leste", "Lesotho", "Solomon Islands", "Libya", "South Korea", "Liechtenstein", "Nicaragua", "Ecuador", "Maldives", "Algeria", "Kyrgyzstan", "Finland", "Antarctica", "Kenya", "Cuba", "Montserrat", "Poland", "Åland Islands", "Ethiopia", "Togo", "Bosnia and Herzegovina", "Uruguay", "Guam", "Cape Verde", "Chad", "Vatican City", "Palau", "Haiti", "Yemen", "Eswatini", "Zimbabwe", "Greece", "Israel", "Saint Martin", "Antigua and Barbuda", "Cyprus", "Sint Maarten", "Monaco", "Fiji", "Ukraine", "Martinique", "Hong Kong", "Portugal", "Bhutan", "Nepal", "France", "Ireland", "United Arab Emirates", "Guernsey", "Saint Lucia", "Dominican Republic", "Serbia", "Botswana", "Ivory Coast", "Ghana", "Comoros", "Azerbaijan", "United Kingdom", "Central African Republic", "Palestine", "Caribbean Netherlands", "Taiwan", "Pitcairn Islands", "San Marino", "Svalbard and Jan Mayen", "Djibouti", "Wallis and Futuna", "Denmark", "Papua New Guinea", "Madagascar", "Bouvet Island", "Hungary", "Tokelau", "Trinidad and Tobago", "Gambia", "Luxembourg", "Cocos (Keeling) Islands", "Republic of the Congo", "Argentina", "DR Congo", "Greenland", "Jordan", "Belgium", "Switzerland", "Indonesia", "Lebanon", "Malaysia", "Cayman Islands", "Slovakia", "Armenia", "Christmas Island", "Mongolia", "Saint Pierre and Miquelon", "Japan", "South Africa", "Philippines", "Micronesia", "Germany", "Latvia", "Jamaica", "Macau", "Nauru", "Faroe Islands", "Guyana", "Burkina Faso", "Sudan", "Russia", "Mayotte", "Australia", "Liberia", "Mexico", "Tunisia", "Aruba", "Kazakhstan", "Oman", "French Guiana", "Niger", "Turkmenistan", "Sierra Leone", "Samoa", "Senegal", "Georgia", "Namibia", "South Sudan", "Thailand", "Bahrain", "Heard Island and McDonald Islands", "Falkland Islands", "Jersey", "Vietnam", "Guatemala", "Moldova", "North Macedonia", "Uzbekistan", "Romania", "Uganda", "El Salvador", "Zambia", "Gabon", "Equatorial Guinea", "Spain", "Netherlands", "British Virgin Islands", "Benin", "Pakistan", "Panama", "Turks and Caicos Islands", "Angola", "American Samoa", "Venezuela", "Costa Rica", "Puerto Rico", "Seychelles"];
|
||||
|
||||
foreach ($countries as $option) {
|
||||
echo '<option class="settings-value" value="' . htmlspecialchars($option) . '"';
|
||||
if ($option == $country) {
|
||||
echo ' selected';
|
||||
}
|
||||
echo '>' . htmlspecialchars($option) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="settings-group">
|
||||
<label for="timezone" style="color: #fff;">Timezone:</label>
|
||||
<select id="timezone" name="timezone">
|
||||
<?php
|
||||
$timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
|
||||
|
||||
foreach ($timezones as $option) {
|
||||
echo '<option class="settings-value" value="' . htmlspecialchars($option) . '"';
|
||||
if ($option == $timezone) {
|
||||
echo ' selected';
|
||||
}
|
||||
echo '>' . htmlspecialchars($option) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="settings-group settings-radio-group">
|
||||
<div class="settings-label">Date Format:</div>
|
||||
<label class="radio-container">
|
||||
<input type="radio" name="dateFormat" value="mmddyyyy" <?php echo $dateFormat == "mmddyyyy" ? 'checked' : ''; ?>>
|
||||
<i class="far fa-circle"></i>
|
||||
<i class="fas fa-check-circle"></i>
|
||||
mm/dd/yyyy
|
||||
</label>
|
||||
<label class="radio-container">
|
||||
<input type="radio" name="dateFormat" value="ddmmyyyy" <?php echo $dateFormat == "ddmmyyyy" ? 'checked' : ''; ?>>
|
||||
<i class="far fa-circle"></i>
|
||||
<i class="fas fa-check-circle"></i>
|
||||
dd/mm/yyyy
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="settings-group settings-radio-group">
|
||||
<div class="settings-label">Time Format:</div>
|
||||
<label class="radio-container">
|
||||
<input type="radio" name="timeFormat" value="12hour" <?php echo $timeFormat == "12" ? 'checked' : ''; ?>>
|
||||
<i class="far fa-circle"></i>
|
||||
<i class="fas fa-check-circle"></i>
|
||||
12-hour
|
||||
</label>
|
||||
<label class="radio-container">
|
||||
<input type="radio" name="timeFormat" value="24hour" <?php echo $timeFormat == "24" ? 'checked' : ''; ?>>
|
||||
<i class="far fa-circle"></i>
|
||||
<i class="fas fa-check-circle"></i>
|
||||
24-hour
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button onclick="saveTimeSettings()" style="margin-top: 8px;">Save Settings</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
include '../config/config.php';
|
||||
include '../incl/main.php';
|
||||
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die('Unable to access the database, please try again later');
|
||||
}
|
||||
|
||||
if (!checkUserSession($conn)) {
|
||||
setcookie('session', '', time(), "/", "", true, true);
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
$stmt = $conn->prepare("SELECT api_key, role, discord_id FROM users WHERE session = ?");
|
||||
$stmt->bind_param("s", $session);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($api_key, $role, $discord_id);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
$conn->close();
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SH08WXZBBG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SH08WXZBBG');
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Xytriza's Uploading Service - Upload Tools</title>
|
||||
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://upload.xytriza.com/dashboard/assets/main.css?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://upload.xytriza.com/dashboard/assets/main.js?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service" height="40vw" width="40vw"></a>
|
||||
<a href="/dashboard/"><i class="fas fa-home sidebar-item"></i></a>
|
||||
<a href="/dashboard/gallery.php"><i class="fas fa-file-alt sidebar-item" style="margin-left: 20%;"></i></a>
|
||||
<a href="/dashboard/upload.php"><i class="fas fa-upload sidebar-item"></i></a>
|
||||
<a href="/dashboard/settings.php"><i class="fas fa-cog sidebar-item"></i></a>
|
||||
<a href="/dashboard/account.php" style="margin-top: auto;"><i class="fas fa-user-cog sidebar-item"></i></a>
|
||||
<?php
|
||||
if ($role === 1 || $role === 2) {
|
||||
echo '<a href="/dashboard/admin" class="sidebar-item"><i class="fas fa-user-shield"></i></a>
|
||||
<a href="/dashboard/admin/users.php" class="sidebar-item"><i class="fas fa-user-edit"></i></a>';
|
||||
}
|
||||
?>
|
||||
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
</div>
|
||||
|
||||
<div id="notification-container"></div>
|
||||
|
||||
<div id="container">
|
||||
<h1>Upload Tools</h1>
|
||||
<?php
|
||||
if (isset($_GET['type'])) {
|
||||
if ($_GET['type'] === 'windows') {
|
||||
echo '<h3>Windows - Upload Configuration</h3>
|
||||
<p>Download ShareX here: <a href="https://getsharex.com/" style="text-decoration: underline;" target="_blank">https://getsharex.com/</a></p>
|
||||
<p>Download the ShareX upload config here: <a href="javascript:downloadConfig()" style="text-decoration: underline;">Download</a></p>
|
||||
<p>Run the ShareX upload config and click "Yes" when prompted</p>';
|
||||
} elseif ($_GET['type'] === 'ios') {
|
||||
echo '<h3>iOS - Upload Configuration</h3>
|
||||
<p>Download the Shortcuts app <a href="https://apps.apple.com/us/app/shortcuts/id915249334" style="text-decoration: underline;" target="_blank">here</a></p>
|
||||
<p>Download the iOS shortcut <a href="https://www.icloud.com/shortcuts/335833f37e244a54914fbc5c65dcd6f4" style="text-decoration: underline;">here</a></p>
|
||||
<p>Copy your api key from <a href="/dashboard/settings.php" style="text-decoration: underline;">your account settings</a></p>
|
||||
<p>Click "Set Up Shortcut"</p>
|
||||
<p>Paste your API Key then click "Add Shortcut"
|
||||
<p>Optionally add the shortcut to a wiget on your home screen to easily upload files and run the shortcut</p>';
|
||||
} else {
|
||||
echo '<h3>Other Platform support coming soon!</h3>';
|
||||
}
|
||||
} else {
|
||||
header('Location: /dashboard/settings.php');
|
||||
}
|
||||
echo '<button onclick="window.location.href=\'/dashboard/settings.php\'">Back</button>';
|
||||
?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
include '../config/config.php';
|
||||
include '../incl/main.php';
|
||||
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die('Unable to access the database, please try again later');
|
||||
}
|
||||
|
||||
if (!checkUserSession($conn)) {
|
||||
setcookie('session', '', time(), "/", "", true, true);
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
$stmt = $conn->prepare("SELECT api_key, role, discord_id FROM users WHERE session = ?");
|
||||
$stmt->bind_param("s", $session);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($api_key, $role, $discord_id);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
$conn->close();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SH08WXZBBG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SH08WXZBBG');
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Xytriza's Uploading Service - Upload a file</title>
|
||||
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://upload.xytriza.com/dashboard/assets/main.css?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.css'); ?>">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://upload.xytriza.com/dashboard/assets/main.js?v=<?php echo filemtime('/home/xytriza-upload/htdocs/upload.xytriza.com/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service" height="40vw" width="40vw"></a>
|
||||
<a href="/dashboard/"><i class="fas fa-home sidebar-item"></i></a>
|
||||
<a href="/dashboard/gallery.php"><i class="fas fa-file-alt sidebar-item" style="margin-left: 20%;"></i></a>
|
||||
<a href="/dashboard/upload.php"><i class="fas fa-upload sidebar-item"></i></a>
|
||||
<a href="/dashboard/settings.php"><i class="fas fa-cog sidebar-item"></i></a>
|
||||
<a href="/dashboard/account.php" style="margin-top: auto;"><i class="fas fa-user-cog sidebar-item"></i></a>
|
||||
<?php
|
||||
if ($role === 1 || $role === 2) {
|
||||
echo '<a href="/dashboard/admin" class="sidebar-item"><i class="fas fa-user-shield"></i></a>
|
||||
<a href="/dashboard/admin/users.php" class="sidebar-item"><i class="fas fa-user-edit"></i></a>';
|
||||
}
|
||||
?>
|
||||
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
</div>
|
||||
|
||||
<div id="notification-container"></div>
|
||||
|
||||
<div id="upload">
|
||||
<div id="dropZone">
|
||||
<p>Drag and drop a file here or click to upload</p>
|
||||
</div>
|
||||
<input type="file" id="fileInput" style="display: none;" />
|
||||
<p>Or upload a file from a URL</p>
|
||||
<div id="urlUpload">
|
||||
<input type="text" id="urlInput" placeholder="Enter Direct File URL" />
|
||||
<input type="text" id="fileName" placeholder="File URL Filename" />
|
||||
<button onclick="handleUrlUpload()" style="display: block; margin-left: auto; margin-right: auto;">Upload</button>
|
||||
</div>
|
||||
<div id="progressText" class="progressText" style="display: none; font-weight: bold;">0%</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in new issue
Block a user