Use a layout for the dashboard
This commit is contained in:
1 parent
ec0391a150
commit
ed2d5d0b13
9 files changed
+551
-705
No files matched your search
@@ -23,94 +23,63 @@ $stmt->bind_result($uid, $username, $email, $api_key, $discord_id, $role, $avata
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
$conn->close();
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
$role_format = $role == 1 ? "Owner" : ($role == 2 ? "Admin" : ($role == 0 ? "User" : "Unknown"));
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<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="/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend: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="/dashboard/assets/main.css?v=<?php echo filemtime('/var/www/xus/webroot/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="/dashboard/assets/main.js?v=<?php echo filemtime('/var/www/xus/webroot/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="/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="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
<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><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 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><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 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 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 $username;?>">
|
||||
<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="<?= $username ?>">
|
||||
<input type="password" id="usernamepassword" placeholder="Password">
|
||||
<button type="submit">Change Username</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="user-settings" class="section half-width">
|
||||
<h2>User Settings</h2>
|
||||
<button onclick="setCookieAndRedirect('<?= $discordClientId ?>', '<?= urlencode($discordRedirectUri) ?>')">Re-Link Discord</button>
|
||||
<button onclick="copyAPIKey();">Copy API Key</button>
|
||||
<button onclick="generateAPIKey();">Generate new API Key</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 $username; ?>">
|
||||
<button type="submit">Change Password</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<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="<?= $username ?>">
|
||||
<input type="password" id="usernamepassword" placeholder="Password">
|
||||
<button type="submit">Change Username</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="user-settings" class="section half-width">
|
||||
<h2>User Settings</h2>
|
||||
<button onclick="setCookieAndRedirect('<?= $discordClientId ?>', '<?= urlencode($discordRedirectUri) ?>')">Re-Link Discord</button>
|
||||
<button onclick="copyAPIKey();">Copy API Key</button>
|
||||
<button onclick="generateAPIKey();">Generate new API Key</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
$title = 'Account Management';
|
||||
include 'layout.php';
|
||||
?>
|
||||
@@ -84,77 +84,43 @@ $result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
$uploads = $row['COUNT(*)'];
|
||||
|
||||
$conn->close();
|
||||
|
||||
$size = formatUnitSize($totalSize);
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<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="/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend: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="/dashboard/assets/main.css?v=<?php echo filemtime('/var/www/xus/webroot/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="/dashboard/assets/main.js?v=<?php echo filemtime('/var/www/xus/webroot/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="/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="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 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>
|
||||
<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>
|
||||
<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>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
$title = 'Admin Settings';
|
||||
include __DIR__ . '/../layout.php'; //this is the only way it wanted to work?
|
||||
?>
|
||||
@@ -233,6 +233,7 @@ body.tint::before {
|
||||
.sidebar-item {
|
||||
margin-bottom: 1.56vw;
|
||||
font-size: 1.56vw;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#upload {
|
||||
|
||||
+72
-104
@@ -13,6 +13,7 @@ if (!checkUserSession($conn)) {
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
$checkedSession = true;
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
@@ -29,117 +30,84 @@ $sql = "SELECT id, delete_key, size, original_name, filetype, password FROM uplo
|
||||
$result = $conn->query($sql);
|
||||
$row = $result->fetch_assoc();
|
||||
|
||||
$conn->close();
|
||||
ob_start();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<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="/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend: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="/dashboard/assets/main.css?v=<?php echo filemtime('/var/www/xus/webroot/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="/dashboard/assets/main.js?v=<?php echo filemtime('/var/www/xus/webroot/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="/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>
|
||||
<div id="main-content">
|
||||
<div id="gallery">
|
||||
<?php
|
||||
if ($role === 1 || $role === 2) {
|
||||
echo '<a href="/dashboard/admin" class="sidebar-item"><i class="fas fa-user-shield"></i></a>';
|
||||
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="/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(\"/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);
|
||||
} else {
|
||||
echo '<h1 style="text-align: center; margin-top: 10%;">No files uploaded!</h1>';
|
||||
}
|
||||
?>
|
||||
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
</div>
|
||||
</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="/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(\"/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>
|
||||
<h1 id="loading">Loading files...</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>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
document.getElementById("loading").style.display = "none";
|
||||
document.getElementById("gallery").style.display = "flex";
|
||||
};
|
||||
</script>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
$title = 'Gallery';
|
||||
include 'layout.php';
|
||||
?>
|
||||
+169
-198
@@ -13,6 +13,7 @@ if (!checkUserSession($conn)) {
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
$checkedSession = true;
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
@@ -106,8 +107,6 @@ if ($result->num_rows > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
|
||||
$size = formatUnitSize($totalSize);
|
||||
|
||||
$uploadStatsData = json_encode(array_reverse(array_values($uploadsByDay)));
|
||||
@@ -156,214 +155,186 @@ $news = str_ireplace('%dateformat%', date('F jS, Y'), $news);
|
||||
|
||||
$motd = str_ireplace('%storage%', $size, $motd);
|
||||
$news = str_ireplace('%storage%', $size, $news);
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<div id="container">
|
||||
<div class="info-group">
|
||||
<h1 style="font-weight: bold;">Hello, <?php echo $username; ?> 👋</h1>
|
||||
|
||||
<head>
|
||||
<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="/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend: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="/dashboard/assets/main.css?v=<?php echo filemtime('/var/www/xus/webroot/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="/dashboard/assets/main.js?v=<?php echo filemtime('/var/www/xus/webroot/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="/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="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
<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 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 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>
|
||||
<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 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>
|
||||
|
||||
<script>
|
||||
const formattedLabels = formatAllDates(<?php echo $uploadStatsLabels; ?>);
|
||||
<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>
|
||||
|
||||
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)',
|
||||
<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,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
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}`;
|
||||
}
|
||||
}
|
||||
},
|
||||
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
|
||||
},
|
||||
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>
|
||||
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>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
$title = 'Dashboard';
|
||||
include 'layout.php';
|
||||
?>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
if (!isset($dbservername)) include '../config/config.php';
|
||||
if (!function_exists("checkUserSession")) include '../incl/main.php';
|
||||
|
||||
if (!isset($conn)) {
|
||||
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die('Unable to access the database, please try again later');
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($checkedSession)) {
|
||||
if (!checkUserSession($conn)) {
|
||||
setcookie('session', '', time(), "/", "", true, true);
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($session)) $session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
if (isset($role)) {
|
||||
$stmt = $conn->prepare("SELECT role FROM users WHERE session = ?");
|
||||
$stmt->bind_param("s", $session);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($role);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Xytriza's Uploading Service - <?= $title ?></title>
|
||||
<link rel="icon" href="/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend: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="/dashboard/assets/main.css?v=<?php echo filemtime(__DIR__ . '/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="/dashboard/assets/main.js?v=<?php echo filemtime(__DIR__ . '/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="/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>';
|
||||
}
|
||||
?>
|
||||
<i onclick="logout()" class="fas fa-sign-out-alt sidebar-item"></i>
|
||||
</div>
|
||||
<div id="notification-container"></div>
|
||||
<?= $content ?>
|
||||
</body>
|
||||
</html>
|
||||
+111
-142
@@ -13,6 +13,7 @@ if (!checkUserSession($conn)) {
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
$checkedSession = true;
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
@@ -25,150 +26,118 @@ $stmt->close();
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
$conn->close();
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<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="/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend: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="/dashboard/assets/main.css?v=<?php echo filemtime('/var/www/xus/webroot/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="/dashboard/assets/main.js?v=<?php echo filemtime('/var/www/xus/webroot/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="/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="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 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>
|
||||
<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 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>
|
||||
</body>
|
||||
<button onclick="downloadConfig()" style="margin-top: 8px;">Download ShareX Config</button>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
<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>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
$title = 'Settings';
|
||||
include 'layout.php';
|
||||
?>
|
||||
@@ -13,6 +13,7 @@ if (!checkUserSession($conn)) {
|
||||
header('Location: /dashboard/login.php');
|
||||
die();
|
||||
}
|
||||
$checkedSession = true;
|
||||
|
||||
$session = htmlspecialchars($_COOKIE['session']);
|
||||
|
||||
@@ -23,69 +24,37 @@ $stmt->bind_result($api_key, $role, $discord_id);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
$conn->close();
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<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>This platform will be supported soon!</h3>';
|
||||
}
|
||||
} else {
|
||||
header('Location: /dashboard/settings.php');
|
||||
}
|
||||
echo '<button onclick="window.location.href=\'/dashboard/settings.php\'">Back</button>';
|
||||
echo '</div>';
|
||||
|
||||
<head>
|
||||
<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="/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend: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="/dashboard/assets/main.css?v=<?php echo filemtime('/var/www/xus/webroot/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="/dashboard/assets/main.js?v=<?php echo filemtime('/var/www/xus/webroot/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="/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="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>
|
||||
$content = ob_get_clean();
|
||||
$title = 'Upload Tools';
|
||||
include 'layout.php';
|
||||
?>
|
||||
@@ -25,55 +25,23 @@ $stmt->close();
|
||||
|
||||
checkDiscordLink($discord_id);
|
||||
|
||||
$conn->close();
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<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="/assets/logo.png" type="image/png">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lexend: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="/dashboard/assets/main.css?v=<?php echo filemtime('/var/www/xus/webroot/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="/dashboard/assets/main.js?v=<?php echo filemtime('/var/www/xus/webroot/dashboard/assets/main.js'); ?>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="sidebar">
|
||||
<a href="/" class="logo"><img class="sidebar-item" src="/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="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
|
||||
<div id="upload">
|
||||
<div id="dropZone">
|
||||
<p>Drag and drop a file here or click to upload</p>
|
||||
</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>
|
||||
<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>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<div id="progressText" class="progressText" style="display: none; font-weight: bold;">0%</div>
|
||||
</div>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
$title = 'Upload a file';
|
||||
include 'layout.php';
|
||||
?>
|
||||
Reference in new issue
Block a user