Move files

This commit is contained in:
Lncvrt committed 2025-03-02 12:56:14 -07:00
1 parent 30dd940c0e
commit a58ecbb597
43 files changed
+7 -7

No files matched your search

+62
View File
@@ -0,0 +1,62 @@
<?php
require '../config/config.php';
require '../incl/main.php';
$old_displayname = isset($_POST['olddisplayname']) ? $_POST['olddisplayname'] : '';
$new_displayname = isset($_POST['newdisplayname']) ? $_POST['newdisplayname'] : '';
$username = isset($_POST['username']) ? $_POST['username'] : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
if (empty($username) || empty($old_displayname) || empty($new_displayname) || empty($password)) {
http_response_code(400);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'Missing Username, Old Display Name, New Display Name, or Password']));
}
if (strlen($new_displayname) < 3 || strlen($new_displayname) > 32) {
http_response_code(400);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'responsae' => 'New Display Name must be between 3 and 32 characters']));
exit;
}
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
http_response_code(500);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'Unable to access database']));
}
$stmt = $conn->prepare("SELECT password FROM users WHERE username = ?");
$stmt->bind_param("s", $username);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
if (!password_verify($password, $user['password'])) {
http_response_code(400);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'Password is incorrect']));
}
$stmt = $conn->prepare("UPDATE users SET display_name = ? WHERE username = ?");
$stmt->bind_param("ss", $new_displayname, $username);
$stmt->execute();
http_response_code(200);
header('Content-Type: application/json');
echo json_encode(['success' => 'true', 'response' => 'Display Name changed successfully']);
} else {
http_response_code(404);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'User not found']));
}
$stmt->close();
$conn->close();
?>
+63
View File
@@ -0,0 +1,63 @@
<?php
require '../config/config.php';
require '../incl/main.php';
$username = isset($_POST['username']) ? $_POST['username'] : '';
$old_password = isset($_POST['oldpassword']) ? $_POST['oldpassword'] : '';
$new_password = isset($_POST['newpassword']) ? $_POST['newpassword'] : '';
if (empty($username) || empty($old_password) || empty($new_password)) {
http_response_code(400);
die(json_encode(['success' => 'false', 'response' => 'Missing Username, Old Password, or New Password']));
}
if (isset($_POST['confirmpassword']) && $_POST['confirmpassword'] != $new_password) {
http_response_code(400);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'Passwords do not match']));
}
if (strlen($new_password) < 8 || !preg_match("/[A-Za-z]/", $new_password) || !preg_match("/[0-9]/", $new_password)) {
http_response_code(400);
die(json_encode(['success' => 'false', 'response' => 'New password must be at least 8 characters long and contain at least one letter and one number']));
}
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
http_response_code(500);
die(json_encode(['success' => 'false', 'response' => 'Unable to access database']));
}
$stmt = $conn->prepare("SELECT password FROM users WHERE username = ?");
$stmt->bind_param("s", $username);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
if (!password_verify($old_password, $user['password'])) {
http_response_code(400);
die(json_encode(['success' => 'false', 'response' => 'Old password is incorrect']));
}
$hashed_password = password_hash($new_password, PASSWORD_DEFAULT);
$empty = null;
$stmt = $conn->prepare("UPDATE users SET password = ?, session = ?, session_expire = ? WHERE username = ?");
$stmt->bind_param("ssss", $hashed_password, $empty, $empty, $username);
$stmt->execute();
http_response_code(200);
echo json_encode(['success' => 'true', 'response' => 'Password changed successfully']);
} else {
http_response_code(404);
die(json_encode(['success' => 'false', 'response' => 'User not found']));
}
$stmt->close();
$conn->close();
?>
+60
View File
@@ -0,0 +1,60 @@
<?php
require '../config/config.php';
require '../incl/main.php';
$old_username = isset($_POST['oldusername']) ? $_POST['oldusername'] : '';
$new_username = isset($_POST['newusername']) ? $_POST['newusername'] : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
if (empty($old_username) || empty($new_username) || empty($password)) {
http_response_code(400);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'Missing Old Username, New Username, or Password']));
}
if (strlen($new_username) < 3 || strlen($new_username) > 32) {
http_response_code(400);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'New Username must be between 3 and 32 characters']));
}
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
http_response_code(500);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'Unable to access database']));
}
$stmt = $conn->prepare("SELECT password FROM users WHERE username = ?");
$stmt->bind_param("s", $old_username);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
if (!password_verify($password, $user['password'])) {
http_response_code(400);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'Password is incorrect']));
}
$stmt = $conn->prepare("UPDATE users SET username = ? WHERE username = ?");
$stmt->bind_param("ss", $new_username, $old_username);
$stmt->execute();
http_response_code(200);
header('Content-Type: application/json');
echo json_encode(['success' => 'true', 'response' => 'Username changed successfully']);
} else {
http_response_code(404);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'User not found']));
}
$stmt->close();
$conn->close();
?>
+53
View File
@@ -0,0 +1,53 @@
<?php
require '../config/config.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$apikey = isset($_SERVER['HTTP_KEY']) ? $_SERVER['HTTP_KEY'] : '';
if (isset($apikey) && empty($apikey)) {
$response = [
'success' => 'false',
'response' => 'API Key not provided',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt = $conn->prepare("SELECT api_key FROM users WHERE api_key = ?");
$stmt->bind_param("s", $apikey);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$response = [
'success' => 'true',
'response' => 'API Key is valid',
];
header('Content-Type: application/json');
die(json_encode($response));
} else {
$response = [
'success' => 'false',
'response' => 'API Key is invalid',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt->close();
$conn->close();
?>
+115
View File
@@ -0,0 +1,115 @@
<?php
include '../../config/config.php';
if (isset($_GET['code']) && !empty($_GET['code']) && isset($_COOKIE['session']) && !empty($_COOKIE['session'])){
$code = $_GET['code'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://discord.com/api/v8/oauth2/token');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'client_id' => $discordClientId,
'client_secret' => $discordClientSecret,
'grant_type' => 'authorization_code',
'code' => $code,
'redirect_uri' => $discordRedirectUri,
'scope' => 'identify guilds.join, email, identify'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status_code != 200) {
$response = [
'success' => 'false',
'message' => 'Invalid code provided.',
];
header('Content-Type: application/json');
die(json_encode($response));
}
$data = json_decode($response, true);
curl_setopt($ch, CURLOPT_URL, 'https://discord.com/api/v8/users/@me');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $data['access_token']
]);
curl_setopt($ch, CURLOPT_POST, 0);
$response = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status_code != 200) {
$response = [
'success' => 'false',
'message' => 'Unable to fetch user data.',
];
header('Content-Type: application/json');
die(json_encode($response));
}
$userData = json_decode($response, true);
curl_setopt($ch, CURLOPT_URL, "https://discord.com/api/v8/guilds/{$discordGuildId}/members/{$userData['id']}");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bot ' . $discordBotToken,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'access_token' => $data['access_token'],
'roles' => [],
'mute' => false,
'deaf' => false
]));
curl_exec($ch);
curl_close($ch);
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'message' => 'Unable to connect to the database.',
];
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt = $conn->prepare("SELECT * FROM users WHERE session = ?");
$stmt->bind_param("s", $_COOKIE['session']);
$stmt->execute();
$result = $stmt->get_result();
$sqlData = $result->fetch_assoc();
if ($result->num_rows == 0) {
$response = [
'success' => 'false',
'message' => 'Invalid session.',
];
header('Content-Type: application/json');
die(json_encode($response));
}
$avatar = "https://cdn.discordapp.com/avatars/" . $userData['id'] . "/" . $userData['avatar'];
$stmt = $conn->prepare("UPDATE users SET discord_id = ?, discord_access_token = ?, discord_refresh_token = ?, discord_expires_in = ?, discord_avatar = ?, discord_email = ? WHERE email = ?");
$stmt->bind_param("sssssss", $userData['id'], $data['access_token'], $data['refresh_token'], $data['expires_in'], $avatar, $userData['email'], $sqlData['email']);
$stmt->execute();
if (isset($_COOKIE['redirect_link']) && !empty($_COOKIE['redirect_link']) && strpos($_COOKIE['redirect_link'], 'https://upload.xytriza.com/dashboard') === 0) {
setcookie('redirect_link', '', time() - 3600, '/', '', true, true);
// deepcode ignore OR: already validated in the if condition
header('Location: ' . $_COOKIE['redirect_link']);
die();
}
$response = [
'success' => 'true',
'message' => 'Successfully saved to database'
];
header('Content-Type: application/json');
die(json_encode($response));
} else {
$response = [
'success' => 'false',
'message' => 'Invalid request.',
];
header('Content-Type: application/json');
die(json_encode($response));
}
?>
+70
View File
@@ -0,0 +1,70 @@
<?php
require '../../config/config.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
function generateRandomString($length) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[random_int(0, strlen($characters) - 1)];
}
return $randomString;
}
$session = isset($_COOKIE['session']) ? $_COOKIE['session'] : '';
if (isset($session) && empty($session)) {
$response = [
'success' => 'false',
'response' => 'Invalid session',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt = $conn->prepare("SELECT * FROM users WHERE session = ?");
$stmt->bind_param("s", $session);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
$api_key = generateRandomString(32);
$stmt = $conn->prepare("UPDATE users SET api_key = ? WHERE session = ?");
$stmt->bind_param("ss", $api_key, $session);
$stmt->execute();
$response = [
'success' => 'true',
'response' => 'API key generated',
'api_key' => $api_key,
];
header('Content-Type: application/json');
die(json_encode($response));
} else {
$response = [
'success' => 'false',
'response' => 'Invalid session',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt->close();
$conn->close();
?>
+61
View File
@@ -0,0 +1,61 @@
<?php
require '../../config/config.php';
require '../../incl/main.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$session = isset($_COOKIE['session']) ? $_COOKIE['session'] : '';
$stmt = $conn->prepare("SELECT * FROM users WHERE session = ?");
$stmt->bind_param("s", $session);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
$key = $row['api_key'];
if ($result->num_rows == 0) {
$response = [
'success' => 'false',
'response' => 'Invalid session',
];
http_response_code(403);
header('Content-Type: application/json');
die(json_encode($response));
}
$config = '{
"Name": "Xytriza\'s Uploading Service",
"DestinationType": "ImageUploader, FileUploader",
"RequestType": "POST",
"RequestURL": "https://upload.xytriza.com/api/uploadFile.php",
"FileFormName": "file",
"Body": "MultipartFormData",
"Headers": {
"key": "' . $key . '"
},
"URL": "$json:fileUrl$",
"DeletionURL": "$json:deletionUrl$",
"ErrorMessage": "$json:error$"
}';
header('Content-Type: application/json');
header('Content-Disposition: attachment; filename="xytrizas-uploading-service.sxcu"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . strlen($config));
echo $config;
$stmt->close();
$conn->close();
+57
View File
@@ -0,0 +1,57 @@
<?php
require '../../config/config.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$session = isset($_COOKIE['session']) ? $_COOKIE['session'] : '';
if (isset($session) && empty($session)) {
$response = [
'success' => 'false',
'response' => 'Invalid session',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt = $conn->prepare("SELECT api_key FROM users WHERE session = ?");
$stmt->bind_param("s", $session);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
$api_key = $user['api_key'];
$response = [
'success' => 'true',
'response' => 'Success',
'api_key' => $api_key,
];
header('Content-Type: application/json');
die(json_encode($response));
} else {
$response = [
'success' => 'false',
'response' => 'Invalid session',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt->close();
$conn->close();
?>
+52
View File
@@ -0,0 +1,52 @@
<?php
require '../../config/config.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$session = isset($_COOKIE['session']) ? $_COOKIE['session'] : '';
if (isset($session) && empty($session)) {
$response = [
'success' => 'false',
'response' => 'Invalid session',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$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']);
$response = [
'success' => 'true',
'response' => 'Here is the announcements',
'news' => $news,
'motd' => $motd,
];
http_response_code(200);
header('Content-Type: application/json');
echo json_encode($response);
$stmt->close();
$conn->close();
?>
@@ -0,0 +1,57 @@
<?php
require '../../config/config.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$key = isset($_SERVER['HTTP_KEY']) ? $_SERVER['HTTP_KEY'] : '';
$stmt = $conn->prepare("SELECT * FROM users WHERE api_key = ?");
$stmt->bind_param("s", $key);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows == 0) {
$response = [
'success' => 'false',
'response' => 'Invalid API Key',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$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']);
$response = [
'success' => 'true',
'response' => 'Here is the announcements',
'news' => $news,
'motd' => $motd,
];
http_response_code(200);
header('Content-Type: application/json');
echo json_encode($response);
$conn->close();
?>
+147
View File
@@ -0,0 +1,147 @@
<?php
require '../../config/config.php';
require '../../incl/main.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$apiKey = isset($_POST['key']) ? $_POST['key'] : null;
$session = isset($_COOKIE['session']) ? $_COOKIE['session'] : null;
$country = isset($_POST['country']) ? $_POST['country'] : null;
$timezone = isset($_POST['timezone']) ? $_POST['timezone'] : null;
$dateformat = isset($_POST['dateformat']) ? $_POST['dateformat'] : null;
$timeformat = isset($_POST['timeformat']) ? $_POST['timeformat'] : null;
$query = "UPDATE users SET ";
$params = [];
$paramTypes = "";
if ($country !== null) {
$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"];
if (!in_array($country, $countries)) {
$country = null;
die('{"success": false, "response": "Invalid country" }');
return;
}
$query .= "country = ?, ";
array_push($params, $country);
$paramTypes .= "s";
}
if ($timezone !== null) {
$timezones = ['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Asmera', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Timbuktu', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/ComodRivadavia', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Atka', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Buenos_Aires', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Catamarca', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Ciudad_Juarez', 'America/Coral_Harbour', 'America/Cordoba', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Ensenada', 'America/Fort_Nelson', 'America/Fort_Wayne', 'America/Fortaleza', 'America/Glace_Bay', 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Indianapolis', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Jujuy', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Knox_IN', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Louisville', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Mendoza', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montreal', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nipigon', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Nuuk', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Acre', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Punta_Arenas', 'America/Rainy_River', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Rosario', 'America/Santa_Isabel', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Shiprock', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Thunder_Bay', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Virgin', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'America/Yellowknife', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/South_Pole', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Line truncated
if (!in_array($timezone, $timezones)) {
$timezone = null;
return;
}
$query .= "timezone = ?, ";
array_push($params, $timezone);
$paramTypes .= "s";
}
if ($dateformat !== null) {
if ($dateformat !== "mmddyyyy" && $dateformat !== "ddmmyyyy") {
$dateformat = null;
return;
}
$query .= "dateformat = ?, ";
array_push($params, $dateformat);
$paramTypes .= "s";
}
if ($timeformat !== null) {
if ($timeformat !== "12hour" && $timeformat !== "24hour") {
$timeformat = null;
return;
}
$query .= "timeformat = ?, ";
array_push($params, str_replace('hour', '', $timeformat));
$paramTypes .= "s";
}
if ($country !== null || $timezone !== null || $dateformat !== null || $timeformat !== null) {
$query = rtrim($query, ", ");
if ($apiKey) {
$stmt = $conn->prepare("SELECT COUNT(*) FROM users WHERE api_key = ?");
$stmt->bind_param("s", $apiKey);
$stmt->execute();
$result = $stmt->get_result();
$count = $result->fetch_array(MYSQLI_NUM)[0];
if ($count == 0) {
$response = [
'success' => 'false',
'response' => 'Invalid API Key',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$query .= " WHERE api_key = ?";
array_push($params, $apiKey);
} else if ($_COOKIE['session']) {
$query .= " WHERE session = ?";
array_push($params, $_COOKIE['session']);
} else {
$response = [
'success' => 'false',
'response' => 'Invalid API Key',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$paramTypes .= "s";
$stmt = $conn->prepare($query);
$stmt->bind_param($paramTypes, ...$params);
} else {
$response = [
'success' => 'false',
'response' => 'No data provided',
];
http_response_code(400);
header('Content-Type: application/json');
die(json_encode($response));
}
if ($stmt->execute()) {
$response = [
'success' => 'true',
'response' => 'Saved preferences',
];
http_response_code(200);
header('Content-Type: application/json');
die(json_encode($response));
} else {
$response = [
'success' => 'false',
'response' => 'Error updating database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt->close();
$stmt->close();
$conn->close();
+92
View File
@@ -0,0 +1,92 @@
<?php
require '../../libs/vendor/autoload.php';
require '../config/config.php';
require '../incl/main.php';
use Google\Cloud\Storage\StorageClient;
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$key = isset($_SERVER['HTTP_KEY']) ? $_SERVER['HTTP_KEY'] : '';
$session = isset($_COOKIE['session']) ? $_COOKIE['session'] : '';
if (!empty($key)) {
$sql = "SELECT uid FROM users WHERE api_key = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $apiKey);
$stmt->execute();
} else if (!empty($session)) {
$sql = "SELECT uid FROM users WHERE session = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $session);
$stmt->execute();
} else {
$response = [
'success' => 'false',
'response' => 'Invalid API key',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$uid = $row["uid"];
$storage = new StorageClient([
'projectId' => $googleProjectId,
'keyFilePath' => $googleKeyFilePath,
]);
$bucket = $storage->bucket($googleBucketName);
$sql = "SELECT id FROM uploads WHERE uid = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $uid);
$stmt->execute();
$result = $stmt->get_result();
while($row = $result->fetch_assoc()) {
$id = $row["id"];
$object = $bucket->object($id);
$object->delete();
$sql = "DELETE FROM uploads WHERE id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $id);
$stmt->execute();
}
$response = [
'success' => 'true',
'response' => 'All files deleted successfully',
];
http_response_code(200);
} else {
$response = [
'success' => 'false',
'response' => 'Invalid API key',
];
http_response_code(401);
}
header('Content-Type: application/json');
echo json_encode($response);
?>
+77
View File
@@ -0,0 +1,77 @@
<?php
require '../../libs/vendor/autoload.php';
require '../config/config.php';
require '../incl/main.php';
use Google\Cloud\Storage\StorageClient;
if (isset($_GET['deletionkey']) && $_SERVER['REQUEST_METHOD'] === 'GET') {
$deleteKey = str_replace('/delete/', '', $_GET['deletionkey']); // used for /delete/ endpoint (nginx stuff blah blah)
} else if (isset($_SERVER['HTTP_DELETIONKEY'])) {
$deleteKey = $_SERVER['HTTP_DELETIONKEY'];
} else {
$response = [
'success' => 'false',
'response' => 'No deletion key provided',
];
http_response_code(400);
header('Content-Type: application/json');
die(json_encode($response));
}
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$sql = "SELECT id FROM uploads WHERE delete_key = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $deleteKey);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$id = $row["id"];
$storage = new StorageClient([
'projectId' => $googleProjectId,
'keyFilePath' => $googleKeyFilePath,
]);
$bucket = $storage->bucket($googleBucketName);
$object = $bucket->object($id);
$object->delete();
$sql = "DELETE FROM uploads WHERE id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $id);
$stmt->execute();
$response = [
'success' => 'true',
'response' => 'File deleted successfully',
];
http_response_code(200);
} else {
$response = [
'success' => 'false',
'response' => 'Invalid deletion key',
];
http_response_code(401);
}
header('Content-Type: application/json');
echo json_encode($response);
?>
+274
View File
@@ -0,0 +1,274 @@
<?php
require "../config/config.php";
require '../../libs/vendor/autoload.php';
include '../incl/main.php';
use Google\Cloud\Storage\StorageClient;
if (extension_loaded("zlib")) {
ob_start("ob_gzhandler");
}
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
"success" => "false",
"response" => "Unable to access the database",
];
http_response_code(500);
header("Content-Type: application/json");
die(json_encode($response));
}
$file = rtrim(str_replace("/files/", "", htmlspecialchars($_GET["url"])), "/");
$storage = new StorageClient([
'projectId' => $googleProjectId,
'keyFilePath' => $googleKeyFilePath,
]);
$bucket = $storage->bucket($googleBucketName);
$stmt = $conn->prepare("SELECT id, uid, uploaded, original_name, filetype FROM uploads WHERE id = ?");
$stmt->bind_param("s", $file);
$stmt->execute();
$stmt->bind_result($id, $uid, $uploaded, $original_filename, $fileType);
if (!$stmt->fetch()) {
?>
<!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 - File not found</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>
<?php
if (checkUserSession($conn)) {
$stmt = $conn->prepare("SELECT role FROM users WHERE session = ?");
$stmt->bind_param("s", $_COOKIE["session"]);
$stmt->execute();
$role = $stmt->get_result()->fetch_assoc()["role"];
?>
<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>
<?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="/dashboard/account.php" style="margin-top: auto;"><i class="fas fa-user-cog sidebar-item"></i></a>
<a href="javascript:logout()"><i class="fas fa-sign-out-alt sidebar-item"></i></a>
</div>
<?php
}
?>
<div id="notification-container"></div>
<div id="container">
<div id="discord-link">
<h1>File not found</h1>
<p>We searched everywhere, but we couldn't find that file.</p>
<button onclick="window.history.back()">Back</button>
</div>
</div>
</body>
</html>
<?php
$stmt->close();
$conn->close();
http_response_code(404);
die();
}
$stmt->close();
$fileUrl = "https://files.upload.xytriza.com/{$file}";
$stmt = $conn->prepare("SELECT display_name, timezone FROM users WHERE uid = ?");
$stmt->bind_param("s", $uid);
$stmt->execute();
$stmt->bind_result($username, $timezone);
$stmt->fetch();
$stmt->close();
$username = htmlspecialchars($username, ENT_QUOTES, 'UTF-8');
if (!isset($timezone) || empty($timezone) || !in_array($timezone, DateTimeZone::listIdentifiers(DateTimeZone::ALL))) {
$timezone = "America/Los_Angeles";
}
$date = new DateTime("@{$uploaded}");
$date->setTimezone(new DateTimeZone($timezone));
$utcOffset = $date->getOffset() / 3600;
$utcOffsetFormatted = $utcOffset > 0 ? "+{$utcOffset}" : $utcOffset;
$formattedDate = $date->format("m/d/Y, g:i:s A") . " UTC{$utcOffsetFormatted}";
$now = new DateTime();
$uploadedDate = DateTime::createFromFormat("U", $uploaded);
$interval = $now->diff($uploadedDate);
$timeDiff = "Uploaded by {$username} ";
$timeUnits = ['year', 'month', 'day', 'hour', 'minute', 'second'];
$timeValues = [$interval->y, $interval->m, $interval->d, $interval->h, $interval->i, $interval->s];
for ($i = 0; $i < count($timeUnits); $i++) {
if ($timeValues[$i] > 0) {
$timeDiff .= $timeValues[$i] . " " . $timeUnits[$i] . ($timeValues[$i] > 1 ? 's' : '') . ' ago';
break;
}
}
try {
$object = $bucket->object($id);
$objectData = $object->downloadAsString();
} catch (Exception $e) {
die("Error searching for file.");
}
if (in_array($fileType, ["image/png", "image/jpeg", "image/gif", "image/webp", "image/svg+xml"])) {
$objectInfo = getimagesizefromstring($objectData);
$width = $objectInfo[0];
$height = $objectInfo[1];
}
$original_filename = base64_decode($original_filename);
?>
<!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 name="robots" content="noindex">
<title><?php echo $original_filename . ' - ' . $username;?></title>
<link rel="icon" href="https://upload.xytriza.com/assets/logo.png" type="image/png">
<meta charset="UTF-8">
<meta name="description" content="<?php echo 'Uploaded ' . $formattedDate . ' by ' . $username;?>">
<meta property="og:title" content="<?php echo $original_filename?>">
<meta property="og:description" content="<?php echo 'Uploaded ' . $formattedDate . ' by ' . $username;?>">
<meta property="og:site_name" content="Xytriza's Uploading Service">
<?
if (in_array($fileType, ["image/png", "image/jpeg", "image/gif", "image/webp", "image/svg+xml"])) {
echo '<meta property="og:image" content="' . $fileUrl . '">
<meta property="og:image:alt" content="' . $original_filename . '">
<meta property="og:image:width" content="' . $width . '">
<meta property="og:image:height" content="' . $height . '">';
}
?>
<meta property="theme-color" content="#3c076e">
<meta property="twitter:card" content="summary_large_image">
<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://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>
img {
max-width: 50vw;
max-height: 50vh;
}
</style>
</head>
<body>
<?php
if (checkUserSession($conn)) {
$stmt = $conn->prepare("SELECT role FROM users WHERE session = ?");
$stmt->bind_param("s", $_COOKIE["session"]);
$stmt->execute();
$role = $stmt->get_result()->fetch_assoc()["role"];
?>
<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>
<?php
}
?>
<div id="notification-container"></div>
<div id="container">
<div id="content">
<div id="file-container">
<h1><? echo "{$original_filename} • {$timeDiff}"; ?></h1>
<?php
if (in_array($fileType, ["image/png", "image/jpeg", "image/gif", "image/webp", "image/svg+xml"])) {
echo '<img src="' . $fileUrl . '" alt="' . htmlspecialchars($file, ENT_QUOTES, 'UTF-8') . '">';
} elseif (in_array($fileType, ["video/mp4", "video/webm", "video/ogg"])) {
echo '<video width="100%" height="auto" controls><source src="' . $fileUrl . '" 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="' . $fileUrl . '" type="' . $fileType . '">Your browser does not support the audio element.</audio>';
} elseif (in_array($fileType, ["text/plain"])) {
$fileContent = $object['Body']->getContents();
if (strlen($fileContent) > 100000) {
$fileContent = substr($fileContent, 0, 100000) . "... Preview too long. Download the file to view the full content.";
}
echo '<textarea readonly class="file-textbox">' . htmlspecialchars($fileContent, ENT_QUOTES, 'UTF-8') . '</textarea>';
} else {
echo '<p>Unable to display file "' . $fileType . '". Suggest support for this type in our Discord.</p>';
}
?>
</div>
<button class="button" onclick="downloadFile('<?php echo $fileUrl; ?>', '<?php echo $original_filename; ?>', '<?php echo $fileType; ?>')">Download</button>
<button class="button" onclick="copyToClipboard('<?php echo $fileUrl; ?>', 'File URL copied to clipboard', 0)">Copy link</button>
<?php
if (in_array($fileType, ["text/plain"])) {
echo '<button class="button" onclick="copyToClipboard(\'' . $fileContent . '\', \'File content copied to clipboard\', 0)">Copy</button>';
}
if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], "https://upload.xytriza.com/dashboard/gallery.php") !== false) {
echo '<button class="button" onclick="window.history.back()">Back</button>';
}
?>
</div>
</div>
</div>
<script>
if (window.location.search.includes("download=1")) {
downloadFile("<?php echo $fileUrl; ?>", "<?php echo $original_filename; ?>", "<?php echo $fileType; ?>");
}
</script>
</body>
</html>
<?php
$conn->close();
?>
+89
View File
@@ -0,0 +1,89 @@
<?php
require '../config/config.php';
require '../incl/main.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$apiKey = isset($_POST['key']) ? $_POST['key'] : null;
$session = isset($_COOKIE['session']) ? $_COOKIE['session'] : null;
$password = null;//isset($_POST['password']) ? $_POST['password'] : null;
$spoiler = isset($_POST['spoiler']) ? $_POST['spoiler'] : null;
$filename = isset($_POST['filename']) ? $_POST['filename'] : null;
$fileId = isset($_POST['fileId']) ? $_POST['fileId'] : null;
$query = "UPDATE uploads SET ";
$params = [];
$paramTypes = "";
if ($password !== null) {
if (strlen($password) > 6) {
$password = null;
} else {
$query .= "password = ?, ";
array_push($params, $password);
$paramTypes .= "s";
}
}
if ($filename !== null) {
if (strlen($filename) > 255) {
$filename = null;
} else {
$query .= "original_name = ?, ";
array_push($params, base64_encode($filename));
$paramTypes .= "s";
}
}
if ($password !== null || $filename !== null) {
$query = substr($query, 0, -2);
if ($apiKey !== null) {
$query .= " WHERE id = ? AND uid = (SELECT uid FROM users WHERE api_key = ?)";
array_push($params, $fileId, $apiKey);
$paramTypes .= "ss";
} elseif ($session !== null) {
$query .= " WHERE id = ? AND uid = (SELECT uid FROM users WHERE session = ?)";
array_push($params, $fileId, $session);
$paramTypes .= "ss";
}
$stmt = $conn->prepare($query);
$stmt->bind_param($paramTypes, ...$params);
$stmt->execute();
if ($stmt->affected_rows > 0) {
$response = [
'success' => 'true',
'response' => 'File preferences updated',
];
http_response_code(200);
} else {
$response = [
'success' => 'false',
'response' => 'No update was made',
];
http_response_code(400);
}
$stmt->close();
} else {
$response = [
'success' => 'false',
'response' => 'Invalid parameters',
];
http_response_code(400);
}
header('Content-Type: application/json');
die(json_encode($response));
+88
View File
@@ -0,0 +1,88 @@
<?php
require '../config/config.php';
include '../incl/main.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$apikey = isset($_SERVER['HTTP_KEY']) ? $_SERVER['HTTP_KEY'] : '';
$fileid = isset($_SERVER['HTTP_FILEID']) ? $_SERVER['HTTP_FILEID'] : '';
if (empty($apikey) || empty($fileid)) {
$response = [
'success' => 'false',
'response' => 'Invalid request',
];
http_response_code(400);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt = $conn->prepare("SELECT uid FROM users WHERE api_key = ?");
$stmt->bind_param("s", $apikey);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
$stmt = $conn->prepare("SELECT * FROM uploads WHERE id = ?");
$stmt->bind_param("s", $fileid);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows == 0) {
$response = [
'success' => 'false',
'response' => 'File not found',
];
http_response_code(404);
header('Content-Type: application/json');
die(json_encode($response));
}
$fileInfo = $result->fetch_assoc();
$info = [
'id' => $fileid,
'uploaderUid' => $fileInfo['uid'],
'size' => $fileInfo['size'],
'sizeFormatted' => formatUnitSize($fileInfo['size']),
'uploadedAt' => $fileInfo['uploaded'],
'fileName' => base64_decode($fileInfo['original_name']),
'fileType' => $fileInfo['filetype'],
];
$response = [
'success' => true,
'response' => 'Information for file "' . $fileid . '"',
'fileinfo' => $info,
];
http_response_code(200);
header('Content-Type: application/json');
die(json_encode($response));
} else {
$response = [
'success' => 'false',
'response' => 'Invalid API key',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt->close();
$conn->close();
?>
+66
View File
@@ -0,0 +1,66 @@
<?php
require '../config/config.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$apikey = isset($_SERVER['HTTP_KEY']) ? $_SERVER['HTTP_KEY'] : '';
$stmt = $conn->prepare("SELECT uid FROM users WHERE api_key = ?");
$stmt->bind_param("s", $apikey);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
$stmt = $conn->prepare("SELECT * FROM uploads WHERE uid = ?");
$stmt->bind_param("s", $user['uid']);
$stmt->execute();
$result = $stmt->get_result();
$uploads = [];
while ($row = $result->fetch_assoc()) {
$uploads[] = [
'id' => $row['id'],
'size' => $row['size'],
'uploaded' => $row['uploaded'],
'filename' => base64_decode($row['original_name']),
'filetype' => $row['filetype'],
'deletionkey' => $row['delete_key'],
];
}
$response = [
'success' => 'true',
'response' => 'Here are your uploads',
'uploads' => $uploads,
];
http_response_code(200);
header('Content-Type: application/json');
die(json_encode($response));
} else {
$response = [
'success' => 'false',
'response' => 'Invalid API key',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt->close();
$conn->close();
?>
+95
View File
@@ -0,0 +1,95 @@
<?php
require '../config/config.php';
include '../incl/main.php';
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$apikey = isset($_SERVER['HTTP_KEY']) ? $_SERVER['HTTP_KEY'] : '';
$uid = isset($_SERVER['HTTP_UID']) ? $_SERVER['HTTP_UID'] : '';
if (empty($apikey)) {
$response = [
'success' => 'false',
'response' => 'Invalid request',
];
http_response_code(400);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt = $conn->prepare("SELECT * FROM users WHERE api_key = ?");
$stmt->bind_param("s", $apikey);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$user = $result->fetch_assoc();
$stmt = $conn->prepare("SELECT * FROM users WHERE uid = ?");
$stmt->bind_param("i", $uid);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows == 0) {
$response = [
'success' => 'false',
'response' => 'User not found',
];
http_response_code(404);
header('Content-Type: application/json');
die(json_encode($response));
}
$userInfo = $result->fetch_assoc();
$role = $userInfo['role'] == 1 ? "Owner" : ($userInfo['role'] == 2 ? "Manager" : ($userInfo['role'] == 0 ? "User" : "Unknown"));
if ($userInfo['discord_id'] == null || $userInfo['discord_id'] == "") {
$userInfo['discord_id'] = "N/A";
}
if ($userInfo['discord_avatar'] == null || $userInfo['discord_avatar'] == "") {
$userInfo['discord_avatar'] = "N/A";
}
$info = [
'uid' => $userInfo['uid'],
'username' => $userInfo['username'],
'displayName' => $userInfo['display_name'],
'discordId' => $userInfo['discord_id'],
'role' => $role,
'registerTime' => $userInfo['register_time'],
'avatar' => $userInfo['discord_avatar'],
];
$response = [
'success' => true,
'response' => 'Information for user "' . $userInfo['display_name'] . '"',
'userinfo' => $info,
];
http_response_code(200);
header('Content-Type: application/json');
die(json_encode($response));
} else {
$response = [
'success' => 'false',
'response' => 'Invalid API key',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt->close();
$conn->close();
?>
+137
View File
@@ -0,0 +1,137 @@
<?php
require '../config/config.php';
require '../incl/main.php';
$ip = $_SERVER['REMOTE_ADDR'];
$token = isset($_POST['captcha_token']) ? $_POST['captcha_token'] : '';
$url = 'https://challenges.cloudflare.com/turnstile/v0/siteverify';
$data = [
'secret' => '0x4AAAAAAARIYYLl4IlaAeS9Q40g-Y6QZ9M',
'response' => $token,
'remoteip' => $ip,
];
$options = [
'http' => [
'header' => 'Content-type: application/x-www-form-urlencoded',
'method' => 'POST',
'content' => http_build_query($data),
],
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result !== false) {
$outcome = json_decode($result, true);
if (!isset($outcome['success']) || !$outcome['success']) {
$response = [
'success' => 'false',
'response' => 'Invalid captcha',
];
http_response_code(403);
header('Content-Type: application/json');
die(json_encode($response));
}
} else {
$response = [
'success' => 'false',
'response' => 'Unable to validate captcha',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
function generateRandomString($length) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[random_int(0, strlen($characters) - 1)];
}
return $randomString;
}
$request_username = $_POST['username'];
$request_password = $_POST['password'];
$stmt = $conn->prepare("SELECT * FROM users WHERE username = ?");
$stmt->bind_param("s", $request_username);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
if (password_verify($request_password, $row["password"])) {
$login_ip = $_SERVER['REMOTE_ADDR'];
$login_time = time();
$session_token = generateRandomString(255);
$session_expires = $login_time + (7 * 24 * 60 * 60);
$uid = $row['uid'];
$stmt = $conn->prepare("UPDATE users SET session = ?, session_expire = ?, latest_ip = ? WHERE uid = ?");
$stmt->bind_param("sssi", $session_token, $session_expires, $login_ip, $uid);
$stmt->execute();
$stmt = $conn->prepare("INSERT INTO logins (uid, session_token, session_expire, login_ip, login_time) VALUES (?, ?, ?, ?, ?)");
$stmt->bind_param("isssi", $uid, $session_token, $session_expires, $login_ip, $login_time);
$stmt->execute();
$row['session_token'] = $session_token;
$row['session_expires'] = $session_expires;
$response = [
'success' => 'true',
'session' => $session_token,
'session_expires' => $session_expires,
];
header('Content-Type: application/json');
die(json_encode($response));
} else {
$response = [
'success' => 'false',
'response' => 'Incorrect username or password',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
}
} else {
$response = [
'success' => 'false',
'response' => 'Incorrect username or password',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$stmt->close();
$conn->close();
?>
+242
View File
@@ -0,0 +1,242 @@
<?php
require '../config/config.php';
require '../incl/main.php';
$ip = $_SERVER['REMOTE_ADDR'];
$token = isset($_POST['captcha_token']) ? $_POST['captcha_token'] : '';
$url = 'https://challenges.cloudflare.com/turnstile/v0/siteverify';
$data = [
'secret' => '0x4AAAAAAARIYYLl4IlaAeS9Q40g-Y6QZ9M',
'response' => $token,
'remoteip' => $ip,
];
$options = [
'http' => [
'header' => 'Content-type: application/x-www-form-urlencoded',
'method' => 'POST',
'content' => http_build_query($data),
],
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result !== false) {
$outcome = json_decode($result, true);
if (!isset($outcome['success']) || !$outcome['success']) {
$response = [
'success' => 'false',
'response' => 'Invalid captcha',
];
http_response_code(403);
header('Content-Type: application/json');
die(json_encode($response));
}
} else {
$response = [
'success' => 'false',
'response' => 'Unable to validate captcha',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => 'false',
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$request_username = isset($_POST['username']) ? $_POST['username'] : '';
$request_displayname = (isset($_POST['displayname']) && !empty($_POST['displayname'])) ? $_POST['displayname'] : $request_username;
$request_password = isset($_POST['password']) ? $_POST['password'] : '';
$request_email = isset($_POST['email']) ? $_POST['email'] : '';
if (empty($request_username) || empty($request_password) || empty($request_email)) {
$response = [
'success' => 'false',
'response' => 'Missing username, password or email',
];
http_response_code(400);
die(json_encode($response));
}
if (!ctype_alnum($request_username)) {
$response = [
'success' => 'false',
'response' => 'Username must be alphanumeric',
];
http_response_code(400);
die(json_encode($response));
}
if (!filter_var($request_email, FILTER_VALIDATE_EMAIL)) {
$response = [
'success' => 'false',
'response' => 'Invalid email',
];
http_response_code(400);
die(json_encode($response));
}
if (strlen($request_password) < 8 || !preg_match("/[A-Za-z]/", $request_password) || !preg_match("/[0-9]/", $request_password)) {
$response = [
'success' => 'false',
'response' => 'Password must be at least 8 characters long and contain at least one letter and one number',
];
http_response_code(400);
die(json_encode($response));
}
if (strlen($request_username) < 3 || strlen($request_username) > 32) {
http_response_code(400);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'Userame must be between 3 and 32 characters']));
exit;
}
if (strlen($request_displayname) < 3 || strlen($request_displayname) > 32) {
http_response_code(400);
header('Content-Type: application/json');
die(json_encode(['success' => 'false', 'response' => 'Display Name must be between 3 and 32 characters']));
exit;
}
function generateRandomString($length) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[random_int(0, strlen($characters) - 1)];
}
return $randomString;
}
$hashed_password = password_hash($request_password, PASSWORD_DEFAULT);
$stmt = $conn->prepare("SELECT * FROM users WHERE username = ? OR email = ?");
$stmt->bind_param("ss", $request_username, $request_email);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$response = [
'success' => 'false',
'response' => 'Username or email already exists',
];
http_response_code(400);
die(json_encode($response));
} else {
$api_key = generateRandomString(32);
$emailconfirm = generateRandomString(255);
$emailcontent = '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Confirmation</title>
<style>
body {
font-family: "Arial", sans-serif;
background-color: #1f1f1f;
margin: 0;
padding: 0;
text-align: center;
}
.container {
background-color: #222;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin: 20px auto;
padding: 20px;
max-width: 600px;
}
h1 {
color: #fff;
}
p {
color: #fff;
font-size: 16px;
line-height: 1.6;
}
a {
display: inline-block;
padding: 12px 24px;
font-size: 16px;
text-align: center;
text-decoration: none;
color: #fff !important;
background-color: #3c076e;
border-radius: 5px;
}
</style>
</head>
<body>
<div class="container">
<h1>Email Confirmation</h1>
<p>Thank you for signing up with Xytriza\'s Uploading Service! We\'re excited to have you on board.</p>
<p>To complete the registration process, please click on the link below to confirm your email address:</p>
<a href="https://upload.xytriza.com/confirm-email/' . $emailconfirm . '">Confirm Your Email</a>
<p>If you did not sign up for Xytriza\'s Uploading Service, please disregard this email and the account will be unregistered within 2 hours.</p>
<p>Thank you,<br>Xytriza\'s Uploading Service Team</br></p>
</div>
</body>
</html>';
$emailresult = true;//sendEmail($noreply_email_address, $noreply_email_password, $noreply_email_address, $request_email, $request_username, "Action Required: Confirm Your Email Address with Xytriza\'s Uploading Service", $emailcontent, true, 'smtp.ionos.com');
// will do soon (real)
if (!$emailresult) {
$response = [
'success' => 'false',
'response' => 'Error sending conformation email, please try again later'
];
http_response_code(500);
echo json_encode($response);
}
$stmt = $conn->prepare("INSERT INTO users (username, display_name, password, email, api_key, emailconfirm, register_time) VALUES (?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("ssssssi", $request_username, $request_displayname, $hashed_password, $request_email, $api_key, $emailconfirm, time());
$stmt->execute();
$response = [
'success' => 'true',
'response' => 'Account created successfully'
];
http_response_code(200);
echo json_encode($response);
}
$stmt->close();
$conn->close();
?>
+172
View File
@@ -0,0 +1,172 @@
<?php
require '../../libs/vendor/autoload.php';
require '../config/config.php';
require '../incl/main.php';
use Google\Cloud\Storage\StorageClient;
function generateRandomString($length) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[random_int(0, strlen($characters) - 1)];
}
return $randomString;
}
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
$response = [
'success' => false,
'response' => 'Unable to access database',
];
http_response_code(500);
header('Content-Type: application/json');
die(json_encode($response));
}
$key = isset($_SERVER['HTTP_KEY']) ? $_SERVER['HTTP_KEY'] : '';
if ($_COOKIE['session']) {
$sql = "SELECT uid FROM users WHERE session = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $_COOKIE['session']);
} else {
$sql = "SELECT uid, role FROM users WHERE api_key = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $key);
}
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$uid = $row["uid"];
} else {
$response = [
'success' => false,
'response' => 'Invalid API Key',
];
http_response_code(401);
header('Content-Type: application/json');
die(json_encode($response));
}
$sql = "SELECT SUM(size) as totalSize FROM uploads WHERE uid = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $uid);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
$totalSize = $row['totalSize'];
//role1 is owner (150gb)
//role2 is admin (25gb)
//else (5gb)
if ($row['role'] === 1 && $totalSize > 161061273600) {
$response = [
'success' => false,
'response' => 'You cannot use more than 150GB of storage',
];
http_response_code(403);
header('Content-Type: application/json');
die(json_encode($response));
} elseif ($row['role'] === 2 && $totalSize > 26843545600) {
$response = [
'success' => false,
'response' => 'You cannot use more than 25GB of storage',
];
http_response_code(403);
header('Content-Type: application/json');
die(json_encode($response));
} else if ($totalSize > 5368709120) {
$response = [
'success' => false,
'response' => 'You cannot use more than 5GB of storage',
];
http_response_code(403);
header('Content-Type: application/json');
die(json_encode($response));
}
if ($_FILES['file']['error'] === UPLOAD_ERR_OK) {
do {
$randomString = generateRandomString(8);
$sql = "SELECT id FROM uploads WHERE id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $randomString);
$stmt->execute();
$result = $stmt->get_result();
} while ($result->num_rows > 0);
do {
$deleteKey = generateRandomString(24);
$sql = "SELECT id FROM uploads WHERE delete_key = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $deleteKey);
$stmt->execute();
$result = $stmt->get_result();
} while ($result->num_rows > 0);
$storage = new StorageClient([
'projectId' => $googleProjectId,
'keyFilePath' => $googleKeyFilePath,
]);
$bucket = $storage->bucket($googleBucketName);
$filePath = $_FILES['file']['tmp_name'];
$fileName = base64_encode(htmlspecialchars($_FILES['file']['name']));
$fileType = (new finfo(FILEINFO_MIME_TYPE))->buffer(file_get_contents($filePath));
$options = [
'name' => $randomString,
'metadata' => [
'cacheControl' => 'no-cache, no-store, must-revalidate',
'contentType' => $fileType,
],
];
$bucket->upload(
fopen($filePath, 'r'),
$options
);
$size = filesize($filePath);
$sql = "INSERT INTO uploads (id, uid, uploaded, delete_key, size, original_name, filetype) VALUES (?, ?, ?, ?, ?, ?, ?)";
$stmt = $conn->prepare($sql);
$currentTime = time();
$stmt->bind_param("siisiss", $randomString, $uid, $currentTime, $deleteKey, $size, $fileName, $fileType);
$stmt->execute();
$response = [
'success' => true,
'response' => 'File uploaded successfully',
'fileUrl' => 'https://upload.xytriza.com/files/'.$randomString,
'deletionUrl' => 'https://upload.xytriza.com/delete/'.$deleteKey,
'deletionKey' => $deleteKey,
];
http_response_code(200);
header('Content-Type: application/json');
die(json_encode($response));
} else {
$response = [
'success' => false,
'response' => 'Invalid file upload'
];
http_response_code(400);
header('Content-Type: application/json');
die(json_encode($response));
}
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

+168
View File
@@ -0,0 +1,168 @@
* {
font-family: 'Poppins', sans-serif;
}
body {
background-color: #1f1f1f;
color: #fff;
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
overflow-x: hidden;
min-height: 100vh;
}
.container {
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
}
.container img {
width: 100%;
height: auto;
}
.content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #1B1B1B;
padding: 5%;
border-radius: 10px;
width: 90%;
max-width: 800px;
}
h2, .purple {
color: #3c076e;
text-shadow: 2px 2px 4px #000;
}
h3 {
color: #fff;
text-shadow: 1px 1px 2px #000;
}
button, .button {
display: inline-block;
margin: 4px;
padding: 8px 16px;
background-color: #3c076e;
color: #fff;
text-decoration: none;
border-radius: 5px;
font-size: 20px;
transition: background-color 0.3s;
cursor: pointer;
text-shadow: 1px 1px 2px #000;
border: 2px solid #3c076e;
transition: transform 0.3s;
}
button:hover, .button:hover {
background-color: #370664;
border-color: #370664;
transform: scale(1.08);
}
.button-container {
display: flex;
justify-content: center;
margin-top: 2%;
margin-bottom: 2%;
}
textarea {
background-color: #131313;
color: #fff;
border: 2px solid #3c076e;
border-radius: 5px;
padding: 8px;
font-size: 16px;
resize: none;
overflow: auto;
transition: border-color 0.3s ease;
height: auto;
max-height: 80vh;
min-height: 20vh;
width: 100%;
}
textarea:focus {
outline: none;
}
textarea:hover {
border-color: #370664;
}
@media only screen and (max-width: 600px) {
.content {
padding: 8%;
width: 100%;
}
}
@media only screen and (min-width: 601px) and (max-width: 1024px) {
.content {
padding: 6%;
width: 90%;
}
}
@media only screen and (min-width: 1025px) {
.content {
padding: 5%;
width: 80%;
}
}
#notification-container {
position: fixed;
bottom: 0;
right: 0;
z-index: 10000;
transition: all 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: all 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;
}
+112
View File
@@ -0,0 +1,112 @@
document.addEventListener("DOMContentLoaded", function() {
var waitingText = document.getElementById("waiting-text");
var content = document.getElementById("content");
if (waitingText && content) {
window.onload = function() {
document.getElementById("waiting-text").style.display = "none";
document.getElementById("content").style.display = "block";
};
}
});
function copyToClipboard(text) {
var replacementText = "... Content too long to copy. Download the file to view the full content.";
var searchText = "... Preview too long. Download the file to view the full content.";
if (text.length === 50073 && text.endsWith(searchText)) {
text = text.replace(searchText, replacementText);
}
var textArea = document.createElement("textarea");
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
document.execCommand("copy");
document.body.removeChild(textArea);
var btn = document.getElementById("copy");
if (btn.innerText === "Copy") {
btn.innerText = "Copied";
setTimeout(function() {
btn.innerText = "Copy";
}, 3000);
}
}
function downloadFile(fileId, originalName, fileType) {
originalName = atob(originalName);
$.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 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');
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

+22
View File
@@ -0,0 +1,22 @@
<?php
$dbservername = "127.0.0.1";
$dbusername = "";
$dbpassword = "";
$dbname = "";
$googleProjectId = "";
$googleBucketName = "";
$googleKeyFilePath = "";
$discordBotToken = "";
$discordChannelId = "";
$discordGuildId = "";
$discordClientId = "";
$discordClientSecret = "";
$discordRedirectUri = "";
if (empty($dbservername) || empty($dbusername) || empty($dbpassword) || empty($dbname) || empty($googleProjectId) || empty($googleBucketName) || empty($googleKeyFilePath)) {
http_response_code(500);
die("Please check your config file (are all fields filled in?)");
}
?>
+136
View File
@@ -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>
+169
View File
@@ -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>
+140
View File
@@ -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>
+703
View File
@@ -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;
}
+685
View File
@@ -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);
}
+154
View File
@@ -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>
+378
View File
@@ -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>
+221
View File
@@ -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>
+235
View File
@@ -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>
+183
View File
@@ -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>
+100
View File
@@ -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>
+88
View File
@@ -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>
+104
View File
@@ -0,0 +1,104 @@
<?php
chdir(dirname(__FILE__));
use PHPMailer\PHPMailer\PHPMailer;
function checkUserSession($conn) {
if (isset($_COOKIE['session'])) {
$session = $_COOKIE['session'];
$stmt = $conn->prepare("SELECT * FROM users WHERE session = ?");
$stmt->bind_param("s", $session);
$stmt->execute();
if ($stmt->get_result()->num_rows > 0) {
return true;
} else {
return false;
}
} else {
return false;
}
}
function formatUnitSize($unformattedsize) {
$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');
$i = 0;
while ($unformattedsize >= 1024 && $i < count($units) - 1) {
$unformattedsize /= 1024;
$i++;
}
$size = round($unformattedsize, 1) . ' ' . $units[$i];
return $size;
}
function sendEmail($email, $password, $sender, $target, $target_user, $subject, $body, $ishtml, $mailhost) {
require '../../libs/vendor/phpmailer/phpmailer/src/PHPMailer.php';
require '../../libs/vendor/vendor/phpmailer/phpmailer/src/Exception.php';
require '../../libs/vendor/vendor/phpmailer/phpmailer/src/SMTP.php';
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = $mailhost;
$mail->SMTPAuth = true;
$mail->Username = $email;
$mail->Password = $password;
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->setFrom($email, $sender);
$mail->addAddress($target, $target_user);
$mail->Subject = $subject;
$mail->isHTML($ishtml);
$mail->Body = $body;
$mail->send();
return true;
} catch (Exception $e) {
return false;
}
}
function checkDiscordLink($id) {
if ($id == null || $id == "") {
?>
<!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 - Discord link required</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="notification-container"></div>
<div id="container">
<div id="discord-link">
<h1>Discord link required</h1>
<p>You need to link your Discord account to use this service.</p>
<button onclick="setCookieAndRedirect()">Link Discord</button>
</div>
</div>
</body>
</html>
<?php
exit();
}
}
+263
View File
@@ -0,0 +1,263 @@
<!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</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">
<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;
}
#top-bar {
position: fixed;
top: 0;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
backdrop-filter: blur(5px);
z-index: 1000;
}
#top-bar .logo {
margin-left: 5%;
margin-top: 20px;
}
#top-bar .logo img {
width: 48px;
height: 48px;
}
#top-bar .nav-links {
margin-right: 5%;
margin-top: 20px;
}
#top-bar .nav-links a {
color: #fff;
text-decoration: none;
transition: 0.25s ease-in-out;
border-radius: 5px;
padding: 5px 8px;
}
#top-bar .nav-links a:hover {
background-color: #3f3f3f;
}
#main-container {
text-align: center;
margin-top: 10vh;
max-width: 90%;
}
h1, h2 {
color: #3c076e;
text-shadow: 2px 2px 4px #000;
}
p {
margin-top: 20px;
font-size: 16px;
text-shadow: 1px 1px 2px #000;
}
#btn {
display: inline-block;
margin: 4px;
padding: 10px 20px;
background-color: #3c076e;
color: #fff;
text-decoration: none;
border-radius: 5px;
font-size: 16px;
transition: background-color 0.3s, transform 0.3s;
cursor: pointer;
text-shadow: 1px 1px 2px #000;
}
#btn:hover {
background-color: #370664;
transform: scale(1.08);
}
.topic-box {
flex: 0 0 calc(100% - 20px);
width: 100%;
max-width: 270px;
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-description {
color: #fff;
font-size: 18px;
text-shadow: 1px 1px 2px #000;
transition: transform 0.3s;
}
.topic-wrapper {
display: flex;
}
.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-container {
margin-top: 15vh;
}
footer p {
text-align: center;
}
footer a {
color: #fff;
}
@media only screen and (max-width: 600px) {
.topic-box {
width: 70%;
max-width: none;
margin: 10px auto;
}
.topic-wrapper {
flex-direction: column;
}
}
</style>
</head>
<body>
<div id="top-bar">
<a href="/" class="logo">
<img src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service">
</a>
<div class="nav-links">
<?php
if (isset($_COOKIE['session'])) {
echo '<a href="/dashboard">Dashboard</a>';
} else {
echo '<a href="/dashboard/login.php">Login</a>
<a href="/dashboard/register.php">Register</a>';
}
?>
<a href="/discord">Discord</a>
</div>
</div>
<div id="main-container">
<h1>Xytriza's Uploading Service</h1>
<p>Secure & Fast File-Uploader</p>
<p><strong>Currently in beta</p>
<?php
if (isset($_COOKIE['session'])) {
echo '<a id="btn" href="/dashboard">Dashboard</a>';
} else {
echo '<a id="btn" href="/dashboard/register.php">Get started</a>';
}
?>
</div>
<div class="topic-container">
<h2 style="text-align: center;">Features</h2>
<div class="topic-wrapper">
<div class="topic-box">
<div class="topic-icon"><i class="fas fa-bolt" style="color: #fff;"></i></div>
<p class="topic-text">Efficient</p>
<p class="topic-description">High-speed servers ensure a swift and efficient upload experience.</p>
</div>
<div class="topic-box">
<div class="topic-icon"><i class="fas fa-check-circle" style="color: #fff;"></i></div>
<p class="topic-text">Dependable</p>
<p class="topic-description">Maintaining a 99.99% uptime record for a reliable and consistent service.</p>
</div>
<div class="topic-box">
<div class="topic-icon"><i class="fas fa-cogs" style="color: #fff;"></i></div>
<p class="topic-text">Customizable</p>
<p class="topic-description">Modern and customizable features cater to personalized image/video sharing preferences.</p>
</div>
</div>
<div class="topic-wrapper">
<div class="topic-box">
<div class="topic-icon"><i class="fas fa-hands-helping" style="color: #fff;"></i></div>
<p class="topic-text">Assistive</p>
<p class="topic-description">Community and staff ready to help with any issues/questions.</p>
</div>
<div class="topic-box">
<div class="topic-icon"><i class="fas fa-user-shield" style="color: #fff;"></i></div>
<p class="topic-text">Privacy Friendly</p>
<p class="topic-description">Respecting user privacy with clear data usage policies.</p>
</div>
<div class="topic-box">
<div class="topic-icon"><i class="fas fa-share-alt" style="color: #fff;"></i></div>
<p class="topic-text">Simple Setup</p>
<p class="topic-description">Integration support for apps like ShareX for seamless uploading.</p>
</div>
</div>
</div>
<footer>
<p>&copy; 2024 Xytriza | <a href="mailto:cryfxreal@gmail.com">Contact</a> | <a href="/privacy">Privacy</a> | <a href="/terms">Terms</a> | <a href="/discord">Discord</a></p>
</footer>
</body>
</html>
+293
View File
@@ -0,0 +1,293 @@
<!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 - Privacy Policy</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">
<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;
}
#top-bar {
position: fixed;
top: 0;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
backdrop-filter: blur(5px);
z-index: 1000;
}
#top-bar .logo {
margin-left: 5%;
margin-top: 20px;
}
#top-bar .logo img {
width: 48px;
height: 48px;
}
#top-bar .nav-links {
margin-right: 5%;
margin-top: 20px;
}
#top-bar .nav-links a {
color: #fff;
text-decoration: none;
transition: 0.25s ease-in-out;
border-radius: 5px;
padding: 5px 8px;
}
#top-bar .nav-links a:hover {
background-color: #3f3f3f;
}
#main-container {
text-align: center;
margin-top: 10vh;
max-width: 90%;
}
h1, h2 {
color: #3c076e;
text-shadow: 2px 2px 4px #000;
}
p {
margin-top: 20px;
font-size: 16px;
text-shadow: 1px 1px 2px #000;
}
#btn {
display: inline-block;
margin: 4px;
padding: 10px 20px;
background-color: #3c076e;
color: #fff;
text-decoration: none;
border-radius: 5px;
font-size: 16px;
transition: background-color 0.3s, transform 0.3s;
cursor: pointer;
text-shadow: 1px 1px 2px #000;
}
#btn:hover {
background-color: #370664;
transform: scale(1.08);
}
.topic-box {
flex: 0 0 calc(100% - 20px);
width: 100%;
max-width: 270px;
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-description {
color: #fff;
font-size: 18px;
text-shadow: 1px 1px 2px #000;
transition: transform 0.3s;
}
.topic-wrapper {
display: flex;
}
.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-container {
margin-top: 15vh;
}
footer p {
text-align: center;
}
footer a {
color: #fff;
}
.dropdown {
cursor: pointer;
border: none;
text-align: left;
outline: none;
color: #fff;
padding: 14px 16px;
transition: 0.4s;
font-size: 17px;
background-color: #3c076e;
border-radius: 5px;
}
.dropdown:hover {
background-color: #370664;
}
.dropdown-content {
display: none;
position: relative;
background-color: #1B1B1B;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
border-radius: 5px;
padding: 10px;
margin-top: 10px;
}
.dropdown-content p {
color: #fff;
text-decoration: none;
display: block;
}
.dropdown-content.show {
display: block;
}
@media only screen and (max-width: 600px) {
.topic-box {
width: 70%;
max-width: none;
margin: 10px auto;
}
.topic-wrapper {
flex-direction: column;
}
}
</style>
</head>
<body>
<div id="top-bar">
<a href="/" class="logo">
<img src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service">
</a>
<div class="nav-links">
<?php
if (isset($_COOKIE['session'])) {
echo '<a href="/dashboard">Dashboard</a>';
} else {
echo '<a href="/dashboard/login.php">Login</a>
<a href="/dashboard/register.php">Register</a>';
}
?>
<a href="/discord">Discord</a>
</div>
</div>
<div id="main-container">
<h1>Privacy Policy for Xytriza's Uploading Service</h1>
<p><strong>Effective Date:</strong> 1/21/2024</p>
<h2>1. Definitions</h2>
<p>- This Privacy Policy ("Policy") is designed to inform you about how Xytriza's Uploading Service ("we", "our", or "us") collects and uses your personal information. When we refer to "we", "our", or "us" in this Policy, we are referring to Xytriza's Uploading Service. When we refer to "you" or "your" in this Policy, we are referring to the individual using our services.</p>
<h2>2. Location of Servers:</h2>
<p>- Our servers are hosted in Santa Clara, California, United States.</p>
<h2>3. Storage Provider:</h2>
<p>- We use Digital Ocean Spaces to store files. It is important to note that no personal information is sent to Digital Ocean Spaces.</p>
<h2>4. Logged Information:</h2>
<p>- For security reasons, we log your most recent login IP and registration IP. This information is utilized to enhance the security of your account.</p>
<h2>5. Policy Changes:</h2>
<p>- We reserve the right to change this privacy policy with a 30-day notice. Any updates will be announced on the dashboard of Xytriza's Uploading Service.</p>
<h2>6. Age Restriction:</h2>
<p>- You must be 13 years or older to use our service. If you believe an underage user is using our service, please report it to us at cryfxreal@gmail.com.</p>
<h2>7. Contact Information:</h2>
<p>- You can contact us through our Discord server or via email at cryfxreal@gmail.com.</p>
<h2>8. Compliance with Law:</h2>
<p>- We may provide your data if required by law, subpoena, or other legal processes.</p>
<h2>9. Registration Data:</h2>
<p>- When you register, your data is stored on our servers to facilitate your use of Xytriza's Uploading Service.</p>
<h2>10. Account Deletion:</h2>
<p>- You have the right to delete your account at any time. Deleting your account will remove your personal information from our servers.</p>
<h2>11. File Uploads:</h2>
<p>- When you upload files, they are stored in Google Cloud Storage. We do not access or use the content of your uploaded files for any purpose other than providing the intended service.</p>
<h2>12. Server Host:</h2>
<p>- Our server host is Digital Ocean, ensuring a secure and reliable hosting environment.</p>
<p>By using Xytriza's Uploading Service, you acknowledge and agree to the practices described in this Privacy Policy. We are committed to protecting your privacy and providing a secure and reliable service.</p>
<p>If you have any questions or concerns regarding this Privacy Policy, please contact us at cryfxreal@gmail.com.</p>
<p>Thank you for choosing Xytriza's Uploading Service.</p>
</div>
<footer>
<p>&copy; 2024 Xytriza | <a href="mailto:cryfxreal@gmail.com">Contact</a> | <a href="/privacy">Privacy</a> | <a href="/terms">Terms</a> | <a href="/discord">Discord</a></p>
</footer>
</body>
</html>
+242
View File
@@ -0,0 +1,242 @@
<!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 - Terms of Service</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">
<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;
}
#top-bar {
position: fixed;
top: 0;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
backdrop-filter: blur(5px);
z-index: 1000;
}
#top-bar .logo {
margin-left: 5%;
margin-top: 20px;
}
#top-bar .logo img {
width: 48px;
height: 48px;
}
#top-bar .nav-links {
margin-right: 5%;
margin-top: 20px;
}
#top-bar .nav-links a {
color: #fff;
text-decoration: none;
transition: 0.25s ease-in-out;
border-radius: 5px;
padding: 5px 8px;
}
#top-bar .nav-links a:hover {
background-color: #3f3f3f;
}
#main-container {
text-align: center;
margin-top: 10vh;
max-width: 90%;
}
h1, h2 {
color: #3c076e;
text-shadow: 2px 2px 4px #000;
}
p {
margin-top: 20px;
font-size: 16px;
text-shadow: 1px 1px 2px #000;
}
#btn {
display: inline-block;
margin: 4px;
padding: 10px 20px;
background-color: #3c076e;
color: #fff;
text-decoration: none;
border-radius: 5px;
font-size: 16px;
transition: background-color 0.3s, transform 0.3s;
cursor: pointer;
text-shadow: 1px 1px 2px #000;
}
#btn:hover {
background-color: #370664;
transform: scale(1.08);
}
.topic-box {
flex: 0 0 calc(100% - 20px);
width: 100%;
max-width: 270px;
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-description {
color: #fff;
font-size: 18px;
text-shadow: 1px 1px 2px #000;
transition: transform 0.3s;
}
.topic-wrapper {
display: flex;
}
.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-container {
margin-top: 15vh;
}
footer p {
text-align: center;
}
footer a {
color: #fff;
}
@media only screen and (max-width: 600px) {
.topic-box {
width: 70%;
max-width: none;
margin: 10px auto;
}
.topic-wrapper {
flex-direction: column;
}
}
</style>
</head>
<body>
<div id="top-bar">
<a href="/" class="logo">
<img src="https://upload.xytriza.com/assets/logo.png" alt="Xytriza's Uploading Service">
</a>
<div class="nav-links">
<?php
if (isset($_COOKIE['session'])) {
echo '<a href="/dashboard">Dashboard</a>';
} else {
echo '<a href="/dashboard/login.php">Login</a>
<a href="/dashboard/register.php">Register</a>';
}
?>
<a href="/discord">Discord</a>
</div>
</div>
<div id="main-container">
<h1>Terms of Service for Xytriza's Uploading Service</h1>
<p><strong>Effective Date:</strong> 1/21/2024</p>
<h2>1. No Creating Alts or Ban Evading:</h2>
<p>- Users are prohibited from creating alternative accounts (alts) or attempting to evade bans imposed by Xytriza's Uploading Service.</p>
<h2>2. No Illegal Content:</h2>
<p>- Users must not upload, share, or engage in any activity involving illegal content of any kind, including but not limited to, copyrighted material, explicit adult content, or any content that violates applicable laws.</p>
<h2>3. No Account Sharing:</h2>
<p>- Sharing accounts is not allowed. Each user is responsible for maintaining the confidentiality of their account information.</p>
<h2>4. No IP Logging, Phishing, or Malware:</h2>
<p>- Users are strictly prohibited from engaging in IP logging, phishing, or using the service to spread malware.</p>
<h2>5. No Spamming our Services:</h2>
<p>- Spamming, including but not limited to, excessive promotional messages, is not allowed on Xytriza's Uploading Service.</p>
<h2>6. No Abusing Bugs on the Site:</h2>
<p>- Users must not exploit or abuse any bugs or vulnerabilities on the site. Any identified issues should be reported to cryfxreal@gmail.com.</p>
<h2>7. No Selling Premium Invites or Accounts:</h2>
<p>- Users are not allowed to sell premium invites or accounts for Xytriza's Uploading Service.</p>
<h2>8. Changes to Terms:</h2>
<p>- These terms may change with a 30-day notice on the dashboard of Xytriza's Uploading Service. It is the user's responsibility to stay informed about any updates.</p>
<p>By using Xytriza's Uploading Service, you acknowledge and agree to abide by these Terms of Service. Violation of these terms may result in account suspension or termination.</p>
<p>If you have any questions or concerns regarding these Terms of Service, please contact us at cryfxreal@gmail.com.</p>
<p>Thank you for choosing Xytriza's Uploading Service.</p>
</div>
<footer>
<p>&copy; 2024 Xytriza | <a href="mailto:cryfxreal@gmail.com">Contact</a> | <a href="/privacy">Privacy</a> | <a href="/terms">Terms</a> | <a href="/discord">Discord</a></p>
</footer>
</body>
</html>