datein hinzufügen
This commit is contained in:
71
app/pages/account-logs.php
Normal file
71
app/pages/account-logs.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
if ($_SESSION['username'] == "demodeveloper" || $_SESSION['username'] == "demoseller") {
|
||||
dashboard\primary\error("Due to privacy purposes, demo accounts do not have access to account logs!");
|
||||
die();
|
||||
}
|
||||
?>
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Account Logs</h1>
|
||||
<p class="text-xs text-gray-500">View the event history of your account.</p>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Alert Box -->
|
||||
<div id="alert" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
Check out <a
|
||||
href="https://vaultcord.com/?utm_source=keyauth" target="_blank"
|
||||
class="font-semibold underline hover:no-underline">VaultCord</a> - Free Discord backup bot. Backup all members & your entire Discord server! Avoid Discord term waves and server nukes <a
|
||||
href="https://vaultcord.com/?utm_source=keyauth" target="_blank"
|
||||
class="font-semibold underline hover:no-underline">(click here)</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_account_logs"
|
||||
class="w-full text-sm text-left text-gray-500">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Date</th>
|
||||
<th class="px-6 py-3">IP</th>
|
||||
<th class="px-6 py-3">User-Agent</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT * FROM `acclogs` WHERE `username` = ?", [$_SESSION['username']]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result))
|
||||
{
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
foreach ($rows as $row)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<script>
|
||||
document.write(convertTimestamp(<?= $row["date"]; ?>));
|
||||
</script>
|
||||
</td>
|
||||
|
||||
<td><a class="blur-sm hover:blur-none"><?= $row["ip"]; ?></a></td>
|
||||
<td><a class="blur-sm hover:blur-none"><?= $row["useragent"]; ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
607
app/pages/account-settings.php
Normal file
607
app/pages/account-settings.php
Normal file
@@ -0,0 +1,607 @@
|
||||
<?php
|
||||
if ($_SESSION['username'] == "demodeveloper" || $_SESSION['username'] == "demoseller")
|
||||
{
|
||||
dashboard\primary\error("Demo accounts do not have access here... view manage apps for your owner ID!");
|
||||
die();
|
||||
}
|
||||
|
||||
$twofactor = $row['twofactor'];
|
||||
|
||||
require_once '../auth/GoogleAuthenticator.php';
|
||||
$gauth = new GoogleAuthenticator();
|
||||
if ($row["googleAuthCode"] == NULL) {
|
||||
$code_2factor = $gauth->createSecret();
|
||||
misc\mysql\query("UPDATE `accounts` SET `googleAuthCode` = ? WHERE `username` = ?", [$code_2factor, $_SESSION['username']]);
|
||||
} else {
|
||||
$code_2factor = $row["googleAuthCode"];
|
||||
}
|
||||
|
||||
$google_QR_Code = $gauth->getQRCodeGoogleUrl($_SESSION['username'], $code_2factor, 'KeyAuth');
|
||||
|
||||
$query = misc\mysql\query("SELECT * FROM `accounts` WHERE `username` = ?", [$_SESSION['username']]);
|
||||
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
$acclogs = $row['acclogs'];
|
||||
$expiry = $row["expires"];
|
||||
$emailVerify = $row["emailVerify"];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['updatesettings'])) {
|
||||
$pfp = misc\etc\sanitize($_POST['pfp']);
|
||||
$acclogs = misc\etc\sanitize($_POST['acclogs']);
|
||||
$emailVerify = misc\etc\sanitize($_POST['emailVerify']);
|
||||
misc\mysql\query("UPDATE `accounts` SET `acclogs` = ? WHERE `username` = ?", [$acclogs, $_SESSION['username']]);
|
||||
|
||||
if ($acclogs == 0) {
|
||||
misc\mysql\query("DELETE FROM `acclogs` WHERE `username` = ?", [$_SESSION['username']]); // delete all account logs
|
||||
}
|
||||
|
||||
misc\mysql\query("UPDATE `accounts` SET `emailVerify` = ? WHERE `username` = ?", [$emailVerify, $_SESSION['username']]);
|
||||
if (isset($_POST['pfp']) && trim($_POST['pfp']) != '') {
|
||||
if (!filter_var($pfp, FILTER_VALIDATE_URL)) {
|
||||
dashboard\primary\error("Invalid Url For Profile Image!");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
if (strpos($pfp, "file:///") !== false) {
|
||||
dashboard\primary\error("Url must start with https://");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
$_SESSION['img'] = $pfp;
|
||||
misc\mysql\query("UPDATE `accounts` SET `img` = ? WHERE `username` = ?", [$pfp, $_SESSION['username']]);
|
||||
}
|
||||
|
||||
dashboard\primary\success("Updated Account Settings!");
|
||||
}
|
||||
|
||||
if (isset($_POST['dlacc'])) {
|
||||
echo "<meta http-equiv='Refresh' Content='0; url=download-types.php?type=account'>";
|
||||
}
|
||||
|
||||
if (isset($_POST['submit_code'])) {
|
||||
if($_SESSION['discordLogin']) {
|
||||
echo "<meta http-equiv='Refresh' Content='3;'>";
|
||||
dashboard\primary\error("You can't use 2FA when you sign-in with different website! Use 2FA on that website instead");
|
||||
return;
|
||||
}
|
||||
|
||||
$code = misc\etc\sanitize($_POST['scan_code1'] . ($_POST['scan_code2']) . ($_POST['scan_code3']) . ($_POST['scan_code4']) . ($_POST['scan_code5']) . ($_POST['scan_code6']));
|
||||
|
||||
$query = misc\mysql\query("SELECT `googleAuthCode` from `accounts` WHERE `username` = ?", [$_SESSION['username']]);
|
||||
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
$secret_code = $row['googleAuthCode'];
|
||||
}
|
||||
|
||||
$checkResult = $gauth->verifyCode($secret_code, $code, 2);
|
||||
|
||||
if ($checkResult) {
|
||||
$query = misc\mysql\query("UPDATE `accounts` SET `twofactor` = '1' WHERE `username` = ?", [$_SESSION['username']]);
|
||||
if ($query->affected_rows > 0) {
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
dashboard\primary\success("Two-factor security has been successfully activated on your account!");
|
||||
dashboard\primary\wh_log($logwebhook, "{$username} has enabled 2FA", $webhookun, "3586ee", "No ping");
|
||||
} else {
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
dashboard\primary\wh_log($logwebhook, "{$username} has disabled 2FA", $webhookun, "3586ee", "No ping");;
|
||||
dashboard\primary\success("Two-factor security has been successfully disabled on your account!");
|
||||
}
|
||||
} else {
|
||||
dashboard\primary\error("Invalid 2FA code! Make sure your device time settings are synced.");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['downloadSecWords'])){
|
||||
if ($secwords == NULL){
|
||||
|
||||
function getRandomWords($count = 10) {
|
||||
$url = "https://random-word-api.herokuapp.com/word?number={$count}";
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
if ($response) {
|
||||
return json_decode($response);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Get 10 random words
|
||||
$randomWords = getRandomWords(10);
|
||||
|
||||
if ($randomWords) {
|
||||
// Format the words into a comma-separated string
|
||||
$wordString = implode(', ', $randomWords);
|
||||
$query = misc\mysql\query("UPDATE `accounts` SET `secwords` =? WHERE `username` = ?", [$wordString, $_SESSION['username']]);
|
||||
if ($query->affected_rows > 0){
|
||||
dashboard\primary\success("Successfully generated new security words!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to generate new security words!");
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
dashboard\primary\error("Security words already generated. Contact staff if you need to reset them.");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['submit_code_disable']))
|
||||
{
|
||||
$code = misc\etc\sanitize($_POST['scan_code']);
|
||||
|
||||
$query = misc\mysql\query("SELECT `googleAuthCode` from `accounts` WHERE `username` = ?", [$_SESSION['username']]);
|
||||
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
$secret_code = $row['googleAuthCode'];
|
||||
}
|
||||
|
||||
$checkResult = $gauth->verifyCode($secret_code, $code, 2);
|
||||
|
||||
if ($checkResult)
|
||||
{
|
||||
$query = misc\mysql\query("UPDATE `accounts` SET `twofactor` = '0', `googleAuthCode` = NULL WHERE `username` = ?", [$_SESSION['username']]);
|
||||
|
||||
if ($query->affected_rows > 0) {
|
||||
dashboard\primary\success("Successfully disabled 2FA!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to disable 2FA!");
|
||||
}
|
||||
} else {
|
||||
dashboard\primary\error("Invalid 2FA code! Make sure your device time settings are synced.");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['deleteWebauthn']))
|
||||
{
|
||||
$name = misc\etc\sanitize($_POST['deleteWebauthn']);
|
||||
|
||||
$query = misc\mysql\query("DELETE FROM `securityKeys` WHERE `name` = ? AND `username` = ?", [$name, $_SESSION['username']]);
|
||||
|
||||
if ($query->affected_rows > 0) {
|
||||
$query = misc\mysql\query("SELECT 1 FROM `securityKeys` WHERE `username` = ?", [$_SESSION['username']]);
|
||||
if ($query->num_rows == 0) {
|
||||
misc\mysql\query("UPDATE `accounts` SET `securityKey` = 0 WHERE `username` = ?", [$_SESSION['username']]);
|
||||
}
|
||||
dashboard\primary\success("Successfully deleted security key");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to delete security key!");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Account Settings</h1>
|
||||
<p class="text-xs text-gray-500">Manage your account. Tip: You can press Ctrl + S to save settings!</p>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Alert Box -->
|
||||
<div id="alert" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
Check out <a
|
||||
href="https://vaultcord.com/?utm_source=keyauth" target="_blank"
|
||||
class="font-semibold underline hover:no-underline">VaultCord</a> - Free Discord backup bot. Backup all members & your entire Discord server! Avoid Discord term waves and server nukes <a
|
||||
href="https://vaultcord.com/?utm_source=keyauth" target="_blank"
|
||||
class="font-semibold underline hover:no-underline">(click here)</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
<form method="post">
|
||||
<div id="lol" class="grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-8 gap-2">
|
||||
<div class="relative">
|
||||
<select id="acclogs" name="acclogs"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="1" <?= $acclogs == 1 ? ' selected="selected"' : ''; ?>>Enabled
|
||||
</option>
|
||||
<option value="0" <?= $acclogs == 0 ? ' selected="selected"' : ''; ?>>Disabled
|
||||
</option>
|
||||
</select>
|
||||
<label for="acclogs"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Account
|
||||
Logs</label>
|
||||
</div>
|
||||
|
||||
<div class="relative">
|
||||
<select id="emailVerify" name="emailVerify"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="1" <?= $emailVerify == 1 ? ' selected="selected"' : ''; ?>>Enabled
|
||||
</option>
|
||||
<option value="0" <?= $emailVerify == 0 ? ' selected="selected"' : ''; ?>>Disabled
|
||||
</option>
|
||||
</select>
|
||||
<label for="emailVerify"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">New
|
||||
Location Alerts
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4 mt-4">
|
||||
<input type="text" name="username"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="<?= $_SESSION['username'];?>" readonly>
|
||||
<label for="username"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Username</label>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ($_SESSION["role"] != "Reseller"){ ?>
|
||||
<div class="relative mb-4 mt-4">
|
||||
<input type="text" name="ownerid"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on"
|
||||
value="<?= $_SESSION['ownerid'] ?? "Manager or Reseller accounts do not have OwnerIDs as they can't create applications.";?>"
|
||||
readonly>
|
||||
<label for="ownerid"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">OwnerID
|
||||
</label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="relative mb-4 mt-4">
|
||||
<input type="text" name="expires"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " value="<?php if ($_SESSION["role"] == "tester")?> Never "
|
||||
autocomplete="on" readonly>
|
||||
<?php if($_SESSION["role"] == "tester"){ ?>
|
||||
<label for="expires"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Subscription
|
||||
Expires: </label>
|
||||
<?php } ?>
|
||||
<label for="expires"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Subscription
|
||||
Expires </label>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var expiryInput = document.querySelector('input[name="expires"]');
|
||||
var expiryValue = <?= $expiry ?>;
|
||||
expiryInput.value = convertTimestamp(expiryValue);
|
||||
</script>
|
||||
|
||||
<div class="relative mb-4 mt-4">
|
||||
<input type="url" name="pfp" id="pfp"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " max="200" value="<?= $_SESSION['img']; ?>" autocomplete="on">
|
||||
<label for="pfp"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Profile
|
||||
Picture URL</label>
|
||||
</div>
|
||||
<?php if($_SESSION["role"] != "Manager"){?>
|
||||
<h1 class="text-sm font-semibold text-white-900 sm:text-sm mb-3">Security Words</h1>
|
||||
|
||||
<a class="block max-w-full p-6 bg-[#09090d] border-1 border-gray-300 rounded-lg shadow mb-5">
|
||||
<p class="text-regular text-white-500">Security Words: 10 random words
|
||||
that you can use to regain access to your account if you forget your order ID, email,
|
||||
password, and have no other way to verify the account belongs to you!</p>
|
||||
<br>
|
||||
<ul class="max space-y-1 text-gray-500 list-disc list-inside">
|
||||
<li>Can only be generated <b>1 TIME!</b> (unless you get a new list from an admin)</li>
|
||||
<li>Should be stored in 2 locations! (USB and PC for example)</li>
|
||||
<li>Should NOT be called something obvious like "KeyAuthSecurityWords.txt". Prevent
|
||||
theft! Be smart!</li>
|
||||
<li>Should never be shared!</li>
|
||||
<li>Only admins can give you new words</li>
|
||||
<li>Remember, your words will appear below once generated. Once you refresh the page,
|
||||
the words will disappear.</li>
|
||||
</ul>
|
||||
|
||||
<p class="text-md text-blue-700 pt-5">
|
||||
<?= $wordString; ?>
|
||||
</p>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<?php if ($secwords == NULL){ ?>
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
name="downloadSecWords">
|
||||
<i class="lni lni-download mr-2 mt-1"></i>Generate Words
|
||||
</button>
|
||||
<?php } else {?>
|
||||
<p class="text-sm text-red-700">
|
||||
You already generated your security words. Please contact support if you forgot
|
||||
them.
|
||||
</p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Button Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
name="updatesettings" id="updatesettings">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i>Save
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-popover-target="linkDiscord-popover"
|
||||
onclick="window.open('https://<?php echo ($_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME']) ?>/api-php/discord/','popup','width=600,height=600'); return false;">
|
||||
<i class="lni lni-discord-alt mr-2 mt-1"></i>Link Discord
|
||||
</button>
|
||||
<?php dashboard\primary\popover("linkDiscord-popover", "Link Discord", "Linking to Discord will allow you to get a role if you have a paid subscription and be able to talk in the Discord Server."); ?>
|
||||
|
||||
<?php if (!$twofactor){
|
||||
echo '<a class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200 cursor-pointer"
|
||||
data-modal-target="enable-2fa-modal" data-modal-toggle="enable-2fa-modal"><i class="lni lni-shield mr-2 mt-1"></i>Enable 2FA</a>';
|
||||
} else {
|
||||
echo '<a class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200 cursor-pointer"
|
||||
data-modal-target="disable-2fa-modal" data-modal-toggle="disable-2fa-modal"><i class="lni lni-shield mr-2 mt-1"></i>Disable 2FA</a>';
|
||||
}
|
||||
?>
|
||||
|
||||
<button name="dlacc"
|
||||
class="inline-flex text-white bg-purple-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200 cursor-none" disabled>
|
||||
<i class="lni lni-download mr-2 mt-1"></i>Export Account
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
class="inline-flex text-white bg-purple-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-target="fido2-modal" data-modal-toggle="fido2-modal">
|
||||
<i class="lni lni-shield mr-2 mt-1"></i>FIDO2 Webauthn (Security Key)
|
||||
</button>
|
||||
|
||||
<a href="https://<?= $_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME'] ?>/forgot/"
|
||||
target="_blank" type="button"
|
||||
class="inline-flex text-white bg-orange-500 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">
|
||||
<i class="lni lni-reload mr-2 mt-1"></i>Change Password
|
||||
</a>
|
||||
<a href="https://<?= $_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME']?>/changeEmail/"
|
||||
target="_blank" type="button"
|
||||
class="inline-flex text-white bg-orange-500 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">
|
||||
<i class="lni lni-reload mr-2 mt-1"></i>Change Email
|
||||
</a>
|
||||
<a href="https://<?= $_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME']?>/changeUsername/"
|
||||
target="_blank" type="button"
|
||||
class="inline-flex text-white bg-orange-500 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">
|
||||
<i class="lni lni-reload mr-2 mt-1"></i>Change Username
|
||||
</a>
|
||||
<a href="https://<?= $_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME']?>/deleteAccount/"
|
||||
target="_blank" type="button"
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete Account
|
||||
</a>
|
||||
</form>
|
||||
<!-- End Button Functions -->
|
||||
|
||||
<?php
|
||||
if (!$twofactor) {?>
|
||||
<!-- Enable 2fa Modal -->
|
||||
<div id="enable-2fa-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Enable 2FA (Two Factor
|
||||
Authentication)</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<label class="mb-5">Scan this QR code into your 2FA App.</label>
|
||||
<img class="mb-5 mt-5" src="<?= $google_QR_Code ?>" />
|
||||
<label class="mb-5">Can't scan the QR code? Manually set it instead, code:
|
||||
<code class="text-blue-700"><?= $code_2factor ?></code></label>
|
||||
<br><br>
|
||||
<div id="otp" class="tfa-container">
|
||||
<input type="text" inputmode="numeric" maxlength="1" id="scan_code1"
|
||||
name="scan_code1"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-lg text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" onpaste="handlePaste(event)"
|
||||
required>
|
||||
|
||||
<input type="text" inputmode="numeric" maxlength="1" id="scan_code2"
|
||||
name="scan_code2"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-lg text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
|
||||
<input type="text" inputmode="numeric" maxlength="1" id="scan_code3"
|
||||
name="scan_code3"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-lg text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
|
||||
<input type="text" inputmode="numeric" maxlength="1" id="scan_code4"
|
||||
name="scan_code4"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-lg text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
|
||||
<input type="text" inputmode="numeric" maxlength="1" id="scan_code5"
|
||||
name="scan_code5"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-lg text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
|
||||
<input type="text" inputmode="numeric" maxlength="1" id="scan_code6"
|
||||
name="scan_code6"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-lg text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
</div>
|
||||
|
||||
<script
|
||||
src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
|
||||
</script>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</div>
|
||||
<button name="submit_code" id="submit_code"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"
|
||||
>Enable 2FA</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Enable 2fa Modal -->
|
||||
<?php } ?>
|
||||
|
||||
<!-- Disable 2fa Modal -->
|
||||
<div id="disable-2fa-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border-[#1d4ed8] shadow">
|
||||
<button type="button"
|
||||
class="absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ml-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="disable-2fa-modal">
|
||||
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none" viewBox="0 0 14 14">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
||||
stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" />
|
||||
</svg>
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Disable 2FA (Two Factor
|
||||
Authentication)</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4 mt-5">
|
||||
<input type="text" id="scan_code" name="scan_code"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required="">
|
||||
<label for="scan_code"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">6
|
||||
Digit Code from your 2FA app</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="submit_code_disable"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Disable
|
||||
2FA</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Disable 2fa Modal -->
|
||||
|
||||
<!-- FIDO2 Modal -->
|
||||
<form class="space-y-6" method="POST">
|
||||
<div id="fido2-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">FIDO2 WebAuthn (Security
|
||||
Keys)</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="webauthn_name" name="webauthn_name"
|
||||
placeholder=" " maxlength="99"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on">
|
||||
<label for="webauthn_name"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">
|
||||
New Security Key Name</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" onclick="newregistration()"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center mb-5">Register
|
||||
New Security Key</button>
|
||||
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Existing Security Keys</h3>
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT * FROM `securityKeys` WHERE `username` = ?", [$_SESSION['username']]);
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
?>
|
||||
<button type="submit" name="deleteWebauthn" value="<?= $row["name"]; ?>"
|
||||
onclick="return confirm('Are you sure you want to delete your security key? This cannot be undone.')"
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center mb-5">Delete
|
||||
Security Key: <?= $row["name"]; ?></button>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- End FIDO2 Modal -->
|
||||
|
||||
<script>
|
||||
$(document).keydown(function(event) {
|
||||
if (event.ctrlKey && event.key === 's') {
|
||||
$("#updatesettings").click();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
function handlePaste(event) {
|
||||
event.preventDefault();
|
||||
var clipboardData = event.clipboardData || window.clipboardData;
|
||||
var pastedData = clipboardData.getData('text');
|
||||
var inputs = document.querySelectorAll(".tfa-container input");
|
||||
|
||||
// Check if the pasted data is exactly 6 digits long
|
||||
if (/^\d{6}$/.test(pastedData)) {
|
||||
for (var i = 0; i < 6; i++) {
|
||||
inputs[i].value = pastedData.charAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateButtonState(inputs) {
|
||||
var allNumeric = true;
|
||||
|
||||
// Check if all input fields have numeric values
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
if (!/^\d$/.test(inputs[i].value)) {
|
||||
allNumeric = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Enable or disable the button based on the input values
|
||||
var button = document.getElementById('submit_code');
|
||||
button.disabled = !allNumeric;
|
||||
}
|
||||
|
||||
// Add event listeners to each input field to monitor changes
|
||||
var inputs = document.querySelectorAll(".tfa-container input");
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
(function(index){
|
||||
inputs[index].addEventListener('input', function(e) {
|
||||
// Move to the next field if the current one has a value
|
||||
if (this.value.length === this.maxLength) {
|
||||
if (index < inputs.length - 1) {
|
||||
inputs[index + 1].focus(); // Move focus to the next input field
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
inputs[index].addEventListener('keydown', function(e) {
|
||||
// Move to the previous field if backspace is pressed on an empty field
|
||||
if (e.key === "Backspace" && this.value.length === 0) {
|
||||
if (index > 0) {
|
||||
inputs[index - 1].focus(); // Move focus to the previous input field
|
||||
}
|
||||
}
|
||||
});
|
||||
})(i);
|
||||
|
||||
inputs[i].addEventListener('input', function() {
|
||||
updateButtonState(inputs);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
806
app/pages/admin-panel.php
Normal file
806
app/pages/admin-panel.php
Normal file
@@ -0,0 +1,806 @@
|
||||
<?php
|
||||
if (!$admin) {
|
||||
ob_clean();
|
||||
http_response_code(403);
|
||||
require '../404_error.html';
|
||||
die();
|
||||
}
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
if (!$twofactor) {
|
||||
dashboard\primary\error("Admin accounts must have 2FA enabled.");
|
||||
die("Admin accounts must have 2FA enabled");
|
||||
}
|
||||
|
||||
if (isset($_POST['searchemail'])) {
|
||||
$email = misc\etc\sanitize($_POST['email']);
|
||||
header("Location:./?page=admin-panel&email=" . $email);
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['searchusername'])) {
|
||||
$un = misc\etc\sanitize($_POST['un']);
|
||||
header("Location: ./?page=admin-panel&username=" . urlencode($un));
|
||||
die();
|
||||
}
|
||||
|
||||
if (isset($_POST['searchownerid'])){
|
||||
$ownerid = misc\etc\sanitize($_POST['ownerid']);
|
||||
header("Location: ./?page=admin-panel&ownerid=" . urlencode($ownerid));
|
||||
die();
|
||||
}
|
||||
|
||||
if (isset($_POST['banacc'])) {
|
||||
if(misc\cache\rateLimit("KeyAuthAdminBans:" . $_SESSION['username'], 1, 3600, 3)) {
|
||||
misc\mysql\query("UPDATE `accounts` SET `admin` = 0 WHERE `username` = ?", [$_SESSION['username']]);
|
||||
dashboard\primary\wh_log($adminwebhook, " the admin `{$username}` has been removed for banning too many people", $adminwebhookun, "41db10", "<@1268915723330392096>");
|
||||
dashboard\primary\error("You banned too many accounts too frequently, your admin is removed");
|
||||
return;
|
||||
}
|
||||
|
||||
$un = misc\etc\sanitize($_POST['banacc']);
|
||||
$reason = misc\etc\sanitize($_POST['reason']);
|
||||
|
||||
$query = misc\mysql\query("SELECT `admin`, `banned` FROM `accounts` WHERE `username` = ?", [$un]);
|
||||
if ($query->num_rows < 1) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("Account not found!");
|
||||
return;
|
||||
}
|
||||
if (!is_null(mysqli_fetch_array($query->result)['banned'])) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("User is already banned!");
|
||||
return;
|
||||
}
|
||||
if (mysqli_fetch_array($query->result)['admin']) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("User is an admin!");
|
||||
return;
|
||||
}
|
||||
|
||||
misc\mysql\query("UPDATE `accounts` SET `banned` = ? WHERE `username` = ?", [$reason, $un]); // set account to banned
|
||||
misc\mysql\query("UPDATE `apps` SET `banned` = '1' WHERE `owner` = ?", [$un]); // ban all apps owned by account
|
||||
|
||||
dashboard\primary\wh_log($adminwebhook, "Admin `{$username}` has banned user `{$un}` for reason `{$reason}`", $adminwebhookun, "41db10", "No ping");
|
||||
|
||||
dashboard\primary\success("Account Banned!");
|
||||
|
||||
$query = misc\mysql\query("SELECT `name`, `ownerid` FROM `apps` WHERE `owner` = ?", [$un]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result)) {
|
||||
$rows[] = $r;
|
||||
}
|
||||
foreach ($rows as $row) {
|
||||
misc\cache\purge('KeyAuthApp:' . $row['name'] . ':' . $row['ownerid']);
|
||||
}
|
||||
|
||||
$query = misc\mysql\query("SELECT `role` FROM `accounts` WHERE `username` = ?", [$un]);
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
if ($row['role'] == "seller") {
|
||||
$query = misc\mysql\query("SELECT `sellerkey` FROM `apps` WHERE `owner` = ?", [$un]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result)) {
|
||||
$rows[] = $r;
|
||||
}
|
||||
foreach ($rows as $row) {
|
||||
misc\cache\purge('KeyAuthAppSeller:' . $row['sellerkey']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['unbanacc'])) {
|
||||
$un = misc\etc\sanitize($_POST['unbanacc']);
|
||||
|
||||
$query = misc\mysql\query("SELECT `admin`,`banned` FROM `accounts` WHERE `username` = ?", [$un]);
|
||||
if ($query->num_rows < 1) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("Account not found!");
|
||||
return;
|
||||
}
|
||||
if (is_null(mysqli_fetch_array($query->result)['banned'])) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("User isn't banned!");
|
||||
return;
|
||||
}
|
||||
if (mysqli_fetch_array($query->result)['admin']) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("User is an admin!");
|
||||
return;
|
||||
}
|
||||
|
||||
misc\mysql\query("UPDATE `accounts` SET `banned` = NULL WHERE `username` = ?", [$un]); // set account to not banned
|
||||
misc\mysql\query("UPDATE `apps` SET `banned` = '0' WHERE `owner` = ?", [$un]); // unban all apps owned by account
|
||||
|
||||
dashboard\primary\wh_log($adminwebhook, "Admin `{$username}` has unbanned user `{$un}`", $adminwebhookun, "41db10", "No ping");
|
||||
|
||||
dashboard\primary\success("Account Unbanned!");
|
||||
|
||||
$query = misc\mysql\query("SELECT `name`, `ownerid` FROM `apps` WHERE `owner` = ?", [$un]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result)) {
|
||||
$rows[] = $r;
|
||||
}
|
||||
foreach ($rows as $row) {
|
||||
misc\cache\purge('KeyAuthApp:' . $row['name'] . ':' . $row['ownerid']);
|
||||
}
|
||||
|
||||
$query = misc\mysql\query("SELECT `role` FROM `accounts` WHERE `username` = ?", [$un]);
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
if ($row['role'] == "seller") {
|
||||
$query = misc\mysql\query("SELECT `sellerkey` FROM `apps` WHERE `owner` = ?", [$un]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result)) {
|
||||
$rows[] = $r;
|
||||
}
|
||||
foreach ($rows as $row) {
|
||||
misc\cache\purge('KeyAuthAppSeller:' . $row['sellerkey']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['purgeRedis']))
|
||||
{
|
||||
$redisKey = misc\etc\sanitize($_POST['redisKey']);
|
||||
if(str_contains(strtolower($redisKey), "keyauthadminbans")) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("You're not allowed to purge this key");
|
||||
return;
|
||||
}
|
||||
if(str_contains(strtolower($redisKey), "keyauthadminedits")) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("You're not allowed to purge this key");
|
||||
return;
|
||||
}
|
||||
misc\cache\purge($redisKey);
|
||||
dashboard\primary\success("Purged redis key");
|
||||
dashboard\primary\wh_log($adminwebhook, "Admin `{$username}` has purged a redis key for `{$redisKey}`", $adminwebhookun, "41db10", "No ping");
|
||||
}
|
||||
|
||||
if (isset($_POST['purgeRedisPattern'])) {
|
||||
$redisKey = misc\etc\sanitize($_POST['redisKeyPattern']);
|
||||
if(str_contains(strtolower($redisKey), "keyauthadminbans")) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("You're not allowed to purge this key");
|
||||
return;
|
||||
}
|
||||
if(str_contains(strtolower($redisKey), "keyauthadminedits")) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("You're not allowed to purge this key");
|
||||
return;
|
||||
}
|
||||
misc\cache\purgePattern($redisKey);
|
||||
dashboard\primary\success("Purged redis key(s)");
|
||||
dashboard\primary\wh_log($adminwebhook, "Admin `{$username}` has purged a redis pattern for `{$redisKey}`", $adminwebhookun, "41db10", "No ping");
|
||||
}
|
||||
|
||||
if(isset($_POST['searchOrder']))
|
||||
{
|
||||
$orderID = misc\etc\sanitize($_POST['orderID']);
|
||||
$query = misc\mysql\query("SELECT `username` FROM `orders` WHERE `orderID` = ?", [$orderID]);
|
||||
if($query->num_rows < 1) {
|
||||
dashboard\primary\error("Order not found!");
|
||||
} else {
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['saveacc'])) {
|
||||
if(misc\cache\rateLimit("KeyAuthAdminEdits:" . $_SESSION['username'], 1, 3600, 3)) {
|
||||
misc\mysql\query("UPDATE `accounts` SET `admin` = 0 WHERE `username` = ?", [$_SESSION['username']]);
|
||||
dashboard\primary\wh_log($adminwebhook, "the admin `{$username}` has been removed for editing too many people", $adminwebhookun, "db1010", "<@1268915723330392096> ");
|
||||
dashboard\primary\error("You edited too many accounts too frequently, your admin is removed");
|
||||
return;
|
||||
}
|
||||
|
||||
$un = misc\etc\sanitize($_POST['saveacc']);
|
||||
$email = misc\etc\sanitize($_POST['email']);
|
||||
$role = misc\etc\sanitize($_POST['role']);
|
||||
$secKey = misc\etc\sanitize($_POST['secKey']);
|
||||
$totp = misc\etc\sanitize($_POST['totp']);
|
||||
$staff = misc\etc\sanitize($_POST['staff']);
|
||||
$alertMsg = misc\etc\sanitize($_POST['alert']);
|
||||
$formBanned = misc\etc\sanitize($_POST['formBanned']);
|
||||
|
||||
$query = misc\mysql\query("SELECT `role`,`admin` FROM `accounts` WHERE `username` = ?", [$un]);
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
|
||||
if ($row['admin']) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("User is an admin!");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($row['role'] == "seller" || $role == "seller") { // purge cache for SellerAPI check if user was seller and getting downgraded, or was another plan and getting upgraded to seller.
|
||||
misc\cache\purge('KeyAuthSellerCheck:' . $un);
|
||||
}
|
||||
|
||||
switch ($role) {
|
||||
case 'seller':
|
||||
$expires = time() + (int) $_POST['expiry'];
|
||||
break;
|
||||
case 'developer':
|
||||
$expires = time() + (int) $_POST['expiry'];
|
||||
break;
|
||||
case 'tester':
|
||||
$expires = NULL;
|
||||
break;
|
||||
case 'reseller':
|
||||
$expires = NULL;
|
||||
break;
|
||||
case 'manager':
|
||||
$expires = NULL;
|
||||
break;
|
||||
default:
|
||||
dashboard\primary\error("Invalid role!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
misc\mysql\query("UPDATE `accounts` SET `role` = ?, `securityKey` = ?, `twofactor` = ?, `alert` = ? WHERE `username` = ?", [$role, $secKey, $totp, $alertMsg, $un]);
|
||||
if (strlen($email) != 40) {
|
||||
misc\mysql\query("UPDATE `accounts` SET `email` = SHA1(?) WHERE `username` = ?", [$email, $un]);
|
||||
}
|
||||
|
||||
if ($row['role'] != $role) {
|
||||
misc\mysql\query("UPDATE `accounts` SET `expires` = NULLIF(?, '') WHERE `username` = ?", [$expires, $un]);
|
||||
}
|
||||
|
||||
if ($row['staff'] != $staff){
|
||||
misc\mysql\query("UPDATE `accounts` SET `staff` = NULLIF(?, '') WHERE `username` = ?", [$staff, $un]);
|
||||
}
|
||||
|
||||
if ($row['formBanned'] != $formBanned){
|
||||
misc\mysql\query("UPDATE `accounts` SET `formBanned` = NULLIF(?, '') WHERE `username` = ?", [$formBanned, $un]);
|
||||
}
|
||||
|
||||
if (isset($_POST['resetSecWordsCB'])){
|
||||
misc\mysql\query("UPDATE `accounts` SET `secWords` = NULL WHERE `username` = ?", [$un]);
|
||||
}
|
||||
|
||||
dashboard\primary\wh_log($adminwebhook, "Admin `{$username}` has updated user `{$un}` \n email to: `{$email}`, \n role to: `{$role}`, \n 2FA status to: `{$totp}`, \n staff status to: `{$staff}`, \n form banned status to: `{$formBanned}`, \n alert to: `{$alertMsg}`", $adminwebhookun, "41db10", "No ping");
|
||||
|
||||
dashboard\primary\success("Updated Account!");
|
||||
}
|
||||
|
||||
if (isset($_POST['editacc'])) {
|
||||
$un = misc\etc\sanitize($_POST['editacc']);
|
||||
|
||||
$query = misc\mysql\query("SELECT * FROM `accounts` WHERE `username` = ?", [$un]);
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
$role = $row['role'];
|
||||
$secKey = $row['securityKey'];
|
||||
$totp = $row['twofactor'];
|
||||
$formBanned = $row['formBanned'];
|
||||
$alertMsg = $row['alert'];
|
||||
$secWords = $row['secWords'];
|
||||
$staff = $row['staff'];
|
||||
$admin = $row['admin'];
|
||||
if ($admin) {
|
||||
echo '<meta http-equiv="refresh" content="2">';
|
||||
dashboard\primary\error("User is an admin!");
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<!-- Edit Acc Modal -->
|
||||
<div id="edit-acc" aria-hidden="true"
|
||||
class="fixed grid place-items-center h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Admin - Edit User</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="email" name="email"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="<?= $row['email']; ?>" required>
|
||||
<label for="email"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Email</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="role" name="role"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="seller" <?= $role == 'seller' ? 'selected="selected"' : ''; ?>>
|
||||
Seller
|
||||
</option>
|
||||
<option value="developer" <?= $role == 'developer' ? 'selected="selected"' : ''; ?>>
|
||||
Developer
|
||||
</option>
|
||||
<option value="tester" <?= $role == 'tester' ? 'selected="selected"' : ''; ?>>
|
||||
Tester
|
||||
</option>
|
||||
<option value="reseller" <?= $role == 'reseller' ? 'selected="selected"' : ''; ?>>
|
||||
Reseller
|
||||
</option>
|
||||
<option value="manager" <?= $role == 'manager' ? 'selected="selected"' : ''; ?>>
|
||||
Manager
|
||||
</option>
|
||||
</select>
|
||||
<label for="role"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Role</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="expiry" name="expiry"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="31556926">
|
||||
Yearly
|
||||
</option>
|
||||
<option value="2629743">
|
||||
Monthly
|
||||
</option>
|
||||
</select>
|
||||
<label for="expiry"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Expiration</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="secKey" name="secKey"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="0" <?= $secKey == 0 ? 'selected="selected"' : ''; ?>>
|
||||
false
|
||||
</option>
|
||||
<option value="1" <?= $secKey == 1 ? 'selected="selected"' : ''; ?>>
|
||||
true
|
||||
</option>
|
||||
</select>
|
||||
<label for="secKey"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Security Key</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="totp" name="totp"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="0" <?= $totp == 0 ? 'selected="selected"' : ''; ?>>
|
||||
false
|
||||
</option>
|
||||
<option value="1" <?= $totp == 1 ? 'selected="selected"' : ''; ?>>
|
||||
true
|
||||
</option>
|
||||
</select>
|
||||
<label for="totp"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">2FA
|
||||
Status</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="staff" name="staff"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="0" <?= $staff == 0 ? 'selected="selected"' : ''; ?>>
|
||||
false
|
||||
</option>
|
||||
<option value="1" <?= $staff == 1 ? 'selected="selected"' : ''; ?>>
|
||||
true
|
||||
</option>
|
||||
</select>
|
||||
<label for="staff"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Staff
|
||||
Status</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="formBanned" name="formBanned"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"
|
||||
data-popover-target="formBanned-popover">
|
||||
<option value="0" <?= $formBanned == 0 ? 'selected="selected"' : ''; ?>>
|
||||
false
|
||||
</option>
|
||||
<option value="1" <?= $formBanned == 1 ? 'selected="selected"' : ''; ?>>
|
||||
true
|
||||
</option>
|
||||
</select>
|
||||
<label for="formBanned"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Form
|
||||
Banned</label>
|
||||
|
||||
<?php dashboard\primary\popover("formBanned-popover", "Form Banned", "Used to ban the user from submitting any forms (suggestion, bug, staff, etc)."); ?>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="alert" name="alert"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="<?= $row['alert']; ?>"
|
||||
data-popover-target="alert-popover">
|
||||
<label for="alert"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Alert</label>
|
||||
|
||||
<?php dashboard\primary\popover("alert-popover", "Alert", "Used to send a message to the users manage-apps page."); ?>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input datepicker datepicker-autohide type="datetime-local"
|
||||
name="expiryType" class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5 "
|
||||
placeholder="Subscription Expiry"
|
||||
value="<?= date('Y-m-d H:i:s', $row['expires']);?>" required readonly>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<p class="text-xs text-white-500"><b>Security Words:</b> <?= $secWords ?? "N/A"; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($secWords != null) {?>
|
||||
<div class="flex items-center mb-4">
|
||||
<input id="resetSecWordsCB" name="resetSecWordsCB" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
unchecked data-popover-target="resetSecWordsCB-popover">
|
||||
<label for="resetSecWordsCB"
|
||||
class="ml-2 text-sm font-medium text-white-900">
|
||||
Reset Security Words?</label>
|
||||
|
||||
<?php dashboard\primary\popover("resetSecWordsCB-popover", "Reset Security Words", "If a user forgot their security words, or gave them to you to verify their account, they must be reset. "); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<button name="saveacc" value="<?= $un; ?>"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Update
|
||||
Account</button>
|
||||
<button onClick="window.location.href=window.location.href"
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Edit Acc Modal -->
|
||||
<?php }
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Admin Panel</h1>
|
||||
<p class="text-xs text-gray-500">Welcome <a class="text-blue-700"><?= $username; ?></a> To The Admin Panel!
|
||||
</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Admin Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="search-by-email-modal" data-modal-target="search-by-email-modal">
|
||||
<i class="lni lni-search mr-2 mt-1"></i>Search By Email
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="search-by-username-modal" data-modal-target="search-by-username-modal">
|
||||
<i class="lni lni-search mr-2 mt-1"></i>Search By Username
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="search-by-ownerid-modal" data-modal-target="search-by-ownerid-modal">
|
||||
<i class="lni lni-search mr-2 mt-1"></i>Search By Owner ID
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="search-by-orderid-modal" data-modal-target="search-by-orderid-modal">
|
||||
<i class="lni lni-search mr-2 mt-1"></i>Search By Order ID
|
||||
</button>
|
||||
<!-- End Admin Functions -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Admin Redis Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-orange-500 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="purge-redis-key-modal" data-modal-target="purge-redis-key-modal">
|
||||
<i class="lni lni-eraser mr-2 mt-1"></i>Purge Redis Key
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-orange-500 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="purge-redis-pattern-modal" data-modal-target="purge-redis-pattern-modal">
|
||||
<i class="lni lni-eraser mr-2 mt-1"></i>Purge Redis Pattern
|
||||
</button>
|
||||
<!-- End Admin Redis Functions -->
|
||||
|
||||
<!-- Search By Email Modal -->
|
||||
<div id="search-by-email-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-blue-700 shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Search By Email</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="email" name="email"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required="">
|
||||
<label for="email"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Users
|
||||
Email</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="searchemail"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Search By Email Modal -->
|
||||
|
||||
<!-- Search By Username Modal -->
|
||||
<div id="search-by-username-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-blue-700 shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Search By Username</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="un" name="un"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required="">
|
||||
<label for="un"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Users
|
||||
Username</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="searchusername"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Search By Username Modal -->
|
||||
|
||||
<!-- Search By Ownerid Modal -->
|
||||
<div id="search-by-ownerid-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-blue-700 shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Search By Ownerid</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="ownerid" name="ownerid"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="ownerid"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Users
|
||||
Ownerid</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="searchownerid"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Search By Ownerid Modal -->
|
||||
|
||||
<!-- Search By OrderID Modal -->
|
||||
<div id="search-by-orderid-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-blue-700 shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Search By Order ID</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="orderID" name="orderID"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="orderID"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Users
|
||||
OrderID</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="searchOrder"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Search By OrderID Modal -->
|
||||
|
||||
<!-- Purge Redis Key Modal -->
|
||||
<div id="purge-redis-key-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-orange-700 shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Purge Redis Key</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="un" name="purgeRedis"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer focus:border-orange-700"
|
||||
placeholder=" " autocomplete="on" required="">
|
||||
<label for="purgeRedis"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-orange-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Redis
|
||||
Key</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="redisKey"
|
||||
class="w-full text-white bg-orange-700 hover:bg-orange-800 focus:ring-4 focus:outline-none focus:ring-orange-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Purge</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Purge Redis Key Modal -->
|
||||
|
||||
<!-- Purge Redis Key Pattern Modal -->
|
||||
<div id="purge-redis-pattern-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-orange-700 shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Purge Redis Key Pattern</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="un" name="purgeRedis"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer focus:border-orange-700"
|
||||
placeholder=" " autocomplete="on" required="">
|
||||
<label for="purgeRedis"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-orange-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Redis
|
||||
Key Pattern</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="redisKey"
|
||||
class="w-full text-white bg-orange-700 hover:bg-orange-800 focus:ring-4 focus:outline-none focus:ring-orange-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Purge</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Purge Redis Key Pattern Modal -->
|
||||
|
||||
<!-- Ban User Modal -->
|
||||
<div id="ban-user-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-blue-700 shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Ban User - Reason</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="reason" name="reason"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="reason"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Ban
|
||||
Reason</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="banacc"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center banacc">Ban
|
||||
User</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Ban User Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_admin" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Username</th>
|
||||
<th class="px-6 py-3">Owner ID</th>
|
||||
<th class="px-6 py-3">Email</th>
|
||||
<th class="px-6 py-3">Role</th>
|
||||
<th class="px-6 py-3">Staff</th>
|
||||
<th class="px-6 py-3">Ban Status</th>
|
||||
<th class="py-6 py-3">Security Key</th>
|
||||
<th class="px-6 py-3">2FA Status</th>
|
||||
<th class="px-6 py-3">Register IP</th>
|
||||
<th class="px-6 py-3">Last IP</th>
|
||||
<th class="px-6 py-3">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$un = misc\etc\sanitize($_GET['username']);
|
||||
$email = misc\etc\sanitize($_GET['email']);
|
||||
$ownerid = misc\etc\sanitize($_GET['ownerid']);
|
||||
$query = misc\mysql\query("SELECT * FROM `accounts` WHERE (`username` = ? OR `email` = SHA1(?)) OR `ownerid` = ? AND `admin` = 0", [$un, $email, $ownerid]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result)){
|
||||
$rows[] = $r;
|
||||
}
|
||||
foreach ($rows as $row){
|
||||
$un = $row['username'];
|
||||
$ban = $row['banned'] == NULL ? 'False' : 'True';
|
||||
$secKey = (($row['securityKey'] ? 1 : 0) ? 'True' : 'False');
|
||||
$totp = (($row['twofactor'] ? 1 : 0) ? 'True' : 'False');
|
||||
$staff = (($row['staff'] ? 1 : 0) ? 'True' : 'False');
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $un; ?></td>
|
||||
<td><?= $row["ownerid"]; ?></td>
|
||||
<td><?= $row["email"]; ?></td>
|
||||
<td><?= $row["role"]; ?></td>
|
||||
<td><?= $staff; ?></td>
|
||||
<td><?= $ban; ?></td>
|
||||
<td><?= $secKey; ?></td>
|
||||
<td><?= $totp; ?></td>
|
||||
<td><a class="blur-sm hover:blur-none"><?= $row["registrationip"] ?? "None"; ?></a>
|
||||
</td>
|
||||
<td><a class="blur-sm hover:blur-none"><?= $row["lastip"] ?? "None"; ?></a></td>
|
||||
<form method="POST">
|
||||
<td>
|
||||
|
||||
<div x-data="{ open: false }" class="z-0">
|
||||
<button x-on:click="open = true"
|
||||
class="flex items-center border border-gray-700 rounded-lg focus:opacity-60 text-white focus:text-white font-semibold rounded focus:outline-none focus:shadow-inner py-2 px-4"
|
||||
type="button">
|
||||
<span class="mr-1">Actions</span>
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20" style="margin-top:3px">
|
||||
<path
|
||||
d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
|
||||
</svg>
|
||||
</button>
|
||||
<ul x-show="open" x-on:click.away="open = false"
|
||||
class="bg-[#09090d] text-white rounded shadow-lg absolute py-2 mt-1"
|
||||
style="min-width:15rem">
|
||||
<li>
|
||||
<button type="button" data-modal-target="ban-user-modal" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-blue-700"
|
||||
data-modal-toggle="ban-user-modal"
|
||||
onclick="banacc('<?= $un; ?>')">
|
||||
Ban
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button name="unbanacc"
|
||||
class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-blue-700"
|
||||
value="<?= $un; ?>">
|
||||
Unban
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button name="editacc"
|
||||
class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-blue-700"
|
||||
value="<?= $un; ?>">
|
||||
Edit
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<script>
|
||||
function banacc(un) {
|
||||
var banacc = $('.banacc');
|
||||
banacc.attr('value', un);
|
||||
}
|
||||
</script>
|
||||
|
||||
2087
app/pages/app-settings.php
Normal file
2087
app/pages/app-settings.php
Normal file
File diff suppressed because it is too large
Load Diff
120
app/pages/audit-logs.php
Normal file
120
app/pages/audit-logs.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if ($role == "Manager") {
|
||||
misc\auditLog\send("Attempted (and failed) to view audit logs.");
|
||||
dashboard\primary\error("Managers aren't allowed to view audit logs.");
|
||||
die();
|
||||
}
|
||||
if (!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
if (isset($_POST['delauditLogs'])){
|
||||
$resp = misc\auditLog\deleteAll();
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete all audit logs"),
|
||||
'success' => dashboard\primary\success("Successfully deleted all audit logs!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
if (isset($_POST['exportAuditLogs'])) {
|
||||
echo "<meta http-equiv='Refresh' Content='0; url=download-types.php?type=auditLog'>";
|
||||
// get all rows, put in text file, download text file, delete text file.
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Audit Logs</h1>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<form method="POST">
|
||||
<!-- Audit Logs Functions -->
|
||||
<button name="exportAuditLogs"
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">
|
||||
<i class="lni lni-download mr-2 mt-1"></i>Export Audit Logs
|
||||
</button>
|
||||
<!-- End Audit Logs Functions -->
|
||||
<br>
|
||||
<!-- Delete Audit Logs Functions -->
|
||||
<button type="button"
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-audit-logs-modal"
|
||||
data-modal-target="delete-all-audit-logs-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Audit Logs
|
||||
</button>
|
||||
<!-- End Delete Audit Logs Functions -->
|
||||
</form>
|
||||
|
||||
<!-- Delete All Audit Logs Modal -->
|
||||
<div id="delete-all-audit-logs-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
Audit logs. Are you sure you want to continue?
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your Audit Logs? This can not be undone.</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-audit-logs-modal" name="delauditLogs"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-audit-logs-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Audit Logs Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_webhooks" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">User</th>
|
||||
<th class="px-6 py-3">Event</th>
|
||||
<th class="px-6 py-3">Time</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ($_SESSION['app']) {
|
||||
$query = misc\mysql\query("SELECT * FROM `auditLog` WHERE `app` = ?", [$_SESSION['app']]);
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
|
||||
echo "<tr>";
|
||||
|
||||
echo " <td>" . $row["user"] . "</td>";
|
||||
|
||||
echo " <td>" . $row["event"] . "</td>";
|
||||
|
||||
echo " <td><script>document.write(convertTimestamp(" . $row["time"] . "));</script></td>";
|
||||
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
239
app/pages/blacklists.php
Normal file
239
app/pages/blacklists.php
Normal file
@@ -0,0 +1,239 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if ($role == "Manager" && !($permissions & 512)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view blacklists.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page!");
|
||||
die();
|
||||
}
|
||||
if (!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
if (isset($_POST['addblack'])) {
|
||||
$resp = misc\blacklist\add($_POST['blackdata'], $_POST['blacktype']);
|
||||
match($resp){
|
||||
'invalid' => dashboard\primary\error("Invalid blacklist type!"),
|
||||
'failure' => dashboard\primary\error("Failed to add blacklists!"),
|
||||
'success' => dashboard\primary\success("Successfully added blacklists!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
if (isset($_POST['delblacks'])) {
|
||||
$resp = misc\blacklist\deleteAll();
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete all whitelists!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted all whitelists!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['deleteblack'])) {
|
||||
$resp = misc\blacklist\deleteSingular($_POST['deleteblack'], $_POST['type']);
|
||||
match($resp){
|
||||
'invalid' => dashboard\primary\error("Invalid blacklist type!"),
|
||||
'failure' => dashboard\primary\error("Failed to delete blacklist!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted blacklist!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST["selected"]) && isset($_POST["action"])) {
|
||||
if ($_POST["action"] == "delete") {
|
||||
$data = json_decode($_POST["selected"], true);
|
||||
|
||||
$array = array_map('urldecode', $data);
|
||||
|
||||
foreach ($array as $item) {
|
||||
$decoded = json_decode($item, true);
|
||||
$resp = misc\blacklist\deleteSingular($decoded['value'], $decoded['type']);
|
||||
match($resp){
|
||||
'invalid' => dashboard\primary\error("Invalid blacklist type!"),
|
||||
'failure' => dashboard\primary\error("Failed to delete blacklist!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted blacklist!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}else {
|
||||
dashboard\primary\error("Unhandled Error! Contact us if you need help - Action:BLPxDB");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Blacklists</h1>
|
||||
<p class="text-xs text-gray-500">Block access from certain IPs/HWIDs <a
|
||||
href="https://keyauthdocs.apidog.io/api/features/check-blacklist" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Blacklists Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="add-blacklist-modal" data-modal-target="add-blacklist-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i>Create Blacklist
|
||||
</button>
|
||||
<!-- End Blacklists Functions -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Delete Blacklists Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-blacklists-modal" data-modal-target="delete-all-blacklists-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Blacklists
|
||||
</button>
|
||||
|
||||
<button id="dropdownselection" data-dropdown-toggle="blacklistdropdown"
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200 hidden"
|
||||
type="button">Selection Options
|
||||
</button>
|
||||
|
||||
<div id="blacklistdropdown" class="z-10 hidden bg-[#09090d] divide-y divide-gray-100 rounded-lg shadow w-44">
|
||||
<ul class="py-2 text-sm text-white">
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Delete selected</a>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- End Delete Blacklists Functions -->
|
||||
|
||||
<!-- Add To Blacklist Modal -->
|
||||
<div id="add-blacklist-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Add Blacklist</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4 ">
|
||||
<select id="blacktype" name="blacktype"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="IP Address" selected>IP Address</option>
|
||||
<option value="Hardware ID">Hardware ID</option>
|
||||
<option value="region">Region/State</option>
|
||||
<option value="country">Country Code</option>
|
||||
<option value="asn">ASN Number</option>
|
||||
</select>
|
||||
<label for="blacktype"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Blacklist
|
||||
Type</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="blackdata" name="blackdata"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="blackdata"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">
|
||||
Enter blacklist data
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<button type="submit" name="addblack"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Blacklist</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Add Blacklist Modal -->
|
||||
|
||||
<!-- Delete All Blacklists Modal -->
|
||||
<div id="delete-all-blacklists-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
Blacklists. Are you sure you want to continue?
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your Blacklists? This can not be undone.</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-blacklists-modal" name="delblacks"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-blacklists-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Blacklists Modal -->
|
||||
|
||||
<!-- Dynamically change placeholder for blacklist, so users have examples of what data to enter -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#blacktype').on('change', function() {
|
||||
var selectedValue = $(this).val();
|
||||
var placeholderText = '';
|
||||
|
||||
switch (selectedValue) {
|
||||
case 'IP Address':
|
||||
placeholderText = 'IP Address (example: 142.250.64.206)';
|
||||
break;
|
||||
case 'Hardware ID':
|
||||
placeholderText = 'Hardware ID (example: S-1-5-21-1085031214-1563985344-725345543)';
|
||||
break;
|
||||
case 'region':
|
||||
placeholderText = 'Region/State (example: ENG for England)';
|
||||
break;
|
||||
case 'country':
|
||||
placeholderText = 'Country Code (example: IT for Italy)';
|
||||
break;
|
||||
case 'asn':
|
||||
placeholderText = 'ASN Number (example: 15169 for Google LLC)';
|
||||
break;
|
||||
default:
|
||||
placeholderText = ''; // Default placeholder if needed
|
||||
}
|
||||
|
||||
$('#blackdata').attr('placeholder', placeholderText);
|
||||
});
|
||||
|
||||
// Trigger change event on page load to set the initial placeholder
|
||||
$('#blacktype').trigger('change');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_blacklists"
|
||||
class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Selection</th>
|
||||
<th class="px-6 py-3">Blacklist Data</th>
|
||||
<th class="px-6 py-3">Blacklist Type</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
|
||||
631
app/pages/chats.php
Normal file
631
app/pages/chats.php
Normal file
@@ -0,0 +1,631 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if ($role == "Manager" && !($permissions & 8)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view chats.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page!");
|
||||
die();
|
||||
}
|
||||
if (!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
|
||||
if (isset($_POST['deletemsg'])) {
|
||||
$resp = misc\chat\deleteMessage($_POST['deletemsg']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete message!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted message!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
if (isset($_POST['muteuser'])) {
|
||||
$muted = misc\etc\sanitize($_POST['muted']);
|
||||
$time = misc\etc\sanitize($_POST['time']);
|
||||
$time = $time * $muted + time();
|
||||
|
||||
$resp = misc\chat\muteUser($_POST['user'], $time);
|
||||
match($resp){
|
||||
'missing' => dashboard\primary\error("User doesn't exist!"),
|
||||
'failure' => dashboard\primary\error("Failed to mute user!"),
|
||||
'success' => dashboard\primary\success("Successfully muted user!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
if (isset($_POST['unmuteuser'])) {
|
||||
$resp = misc\chat\unMuteUser($_POST['user']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to unmute user!"),
|
||||
'success' => dashboard\primary\success("Successfully unmuted user!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
if (isset($_POST['clearchannel'])) {
|
||||
$resp = misc\chat\clearChannel($_POST['channel']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to clear channel!"),
|
||||
'success' => dashboard\primary\success("Successfully cleared channel!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['deleteallchatchannels'])){
|
||||
$resp = misc\chat\deleteAllChannels();
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete all chat channels!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted all chat channels!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['editchan'])) {
|
||||
$chan = misc\etc\sanitize($_POST['editchan']);
|
||||
$query = misc\mysql\query("SELECT * FROM `chats` WHERE `name` = ? AND `app` = ?", [$chan, $_SESSION['app']]);
|
||||
if ($query->num_rows < 1) {
|
||||
dashboard\primary\error("Channel not found!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Edit Chat Channel Modal -->
|
||||
<div id="edit-chat-channel-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Edit Chat Channel</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<select id="unit" name="unit"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="1">Seconds</option>
|
||||
<option value="60">Minutes</option>
|
||||
<option value="3600">Hours</option>
|
||||
<option value="86400">Days</option>
|
||||
<option value="604800">Weeks</option>
|
||||
<option value="2629743">Months</option>
|
||||
<option value="31556926">Years</option>
|
||||
<option value="315569260">Lifetime</option>
|
||||
</select>
|
||||
<label for="unit"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Chat
|
||||
Cooldown Unit</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="delay" name="delay"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="delay"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Cooldown
|
||||
Time * By Unit</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button name="savechan" value="<?= $chan; ?>"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Save
|
||||
Changes</button>
|
||||
|
||||
<button onClick="window.location.href=window.location.href"
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Edit Chat Channel Modal -->
|
||||
|
||||
<?php
|
||||
}
|
||||
if (isset($_POST['savechan'])) {
|
||||
$chan = misc\etc\sanitize($_POST['savechan']);
|
||||
$unit = misc\etc\sanitize($_POST['unit']);
|
||||
$delay = misc\etc\sanitize($_POST['delay']);
|
||||
$delay = $delay * $unit;
|
||||
$query = misc\mysql\query("UPDATE `chats` SET `delay` = ? WHERE `app` = ? AND `name` = ?", [$delay, $_SESSION['app'], $chan]);
|
||||
if ($query->affected_rows > 0) { // check query impacted something, else show error
|
||||
dashboard\primary\success("Successfully updated channel!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed To update channel!");
|
||||
}
|
||||
}
|
||||
if (isset($_POST['deletechan'])) {
|
||||
$resp = misc\chat\deleteChannel($_POST['deletechan']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete channel!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted channel!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['addchannel'])) {
|
||||
if ($_SESSION['role'] != "seller") {
|
||||
dashboard\primary\error("You must upgrade to seller to create chat channels");
|
||||
} else {
|
||||
$unit = misc\etc\sanitize($_POST['unit']);
|
||||
$delay = misc\etc\sanitize($_POST['delay']);
|
||||
$delay = $delay * $unit;
|
||||
$resp = misc\chat\createChannel($_POST['name'], $delay);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to create channel!"),
|
||||
'success' => dashboard\primary\success("Successfully created channel!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Chats</h1>
|
||||
<p class="text-xs text-gray-500">Allow your users to chat with each other. <a
|
||||
href="https://keyauthdocs.apidog.io/api/features/chatroom/messages/send-messages" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.
|
||||
</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Chat Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="create-chat-channel-modal" data-modal-target="create-chat-channel-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i>Create Chat Channel
|
||||
</button>
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="unmute-user-modal" data-modal-target="unmute-user-modal">
|
||||
<i class="lni lni-volume-mute mr-2 mt-1"></i>Unmute User
|
||||
</button>
|
||||
<!-- End Chat Functions -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Delete Chat Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="clear-chat-channel-modal" data-modal-target="clear-chat-channel-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Clear Chat Channel
|
||||
</button>
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-chat-channels-modal" data-modal-target="delete-all-chat-channels-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Chat Channels
|
||||
</button>
|
||||
|
||||
<!-- Create Chat Channel Modal -->
|
||||
<div id="create-chat-channel-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Create Chat Channel</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="name" name="name"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="name"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Chat
|
||||
Channel Name</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="unit" name="unit"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="1">Seconds</option>
|
||||
<option value="60">Minutes</option>
|
||||
<option value="3600">Hours</option>
|
||||
<option value="86400">Days</option>
|
||||
<option value="604800">Weeks</option>
|
||||
<option value="2629743">Months</option>
|
||||
<option value="31556926">Years</option>
|
||||
<option value="315569260">Lifetime</option>
|
||||
</select>
|
||||
<label for="unit"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Chat
|
||||
Cooldown Unit</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="delay" name="delay"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="delay"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Cooldown
|
||||
Time * By Unit</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button name="addchannel"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Create
|
||||
Chat Cannel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Create Chat Channel Modal -->
|
||||
|
||||
<!-- Clear Chat Channel Modal -->
|
||||
<div id="clear-chat-channel-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to clear a chat
|
||||
channel. This will delete all messages in this channel. This can not be
|
||||
undone!
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to clear
|
||||
the chat channel? This can not be undone.</h3>
|
||||
<div class="relative mb-4">
|
||||
<select type="text" id="channel" name="channel"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT * FROM `chats` WHERE `app` = ?", [$_SESSION['app']]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result)) {
|
||||
$rows[] = $r;
|
||||
}
|
||||
foreach ($rows as $row) {
|
||||
?>
|
||||
|
||||
<option value="<?= $row["name"]; ?>"><?= $row["name"]; ?></option>
|
||||
|
||||
<?php
|
||||
} ?>
|
||||
</select>
|
||||
<label for="channel"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Select
|
||||
Channel</label>
|
||||
</div>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="clear-chat-channel-modal" name="clearchannel"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="clear-chat-channel-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unmute User Modal -->
|
||||
|
||||
<!-- Unmute User Channel Modal -->
|
||||
<div id="unmute-user-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<form method="POST">
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to
|
||||
unmute
|
||||
this user?</h3>
|
||||
<div class="relative mb-4">
|
||||
<select type="text" id="user" name="user"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT * FROM `chatmutes` WHERE `app` = ?", [$_SESSION['app']]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result)) {
|
||||
$rows[] = $r;
|
||||
}
|
||||
foreach ($rows as $row) {
|
||||
?>
|
||||
|
||||
<option value="<?= $row["user"]; ?>"><?= $row["user"]; ?></option>
|
||||
|
||||
<?php
|
||||
} ?>
|
||||
</select>
|
||||
<label for="user"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Select
|
||||
User To Unmute</label>
|
||||
</div>
|
||||
<button data-modal-hide="unmute-user-modal" name="unmuteuser"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="unmute-user-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Unmute User Modal -->
|
||||
|
||||
<!-- Delete All Chat Channels Modal -->
|
||||
<div id="delete-all-chat-channels-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
chat channels. This can not be undone!
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your chat channels?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-chat-channels-modal"
|
||||
name="deleteallchatchannels"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-chat-channels-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Chat Channels Modal -->
|
||||
|
||||
<!-- Mute User Modal -->
|
||||
<div id="mute-user-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center hidden h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Mute User</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<select id="muted" name="muted"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="1">Seconds</option>
|
||||
<option value="60">Minutes</option>
|
||||
<option value="3600">Hours</option>
|
||||
<option value="86400">Days</option>
|
||||
<option value="604800">Weeks</option>
|
||||
<option value="2629743">Months</option>
|
||||
<option value="31556926">Years</option>
|
||||
<option value="315569260">Lifetime</option>
|
||||
</select>
|
||||
<label for="muted"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Mute
|
||||
Unit</label>
|
||||
|
||||
<input type="hidden" class="muteuser" name="user">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="time" name="time"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="time"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Mute
|
||||
Duration:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button name="muteuser"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Mute
|
||||
User</button>
|
||||
|
||||
<button type="button" onclick="closeModal('mute-user-modal')"
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Mute User Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_chats" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Chat Name</th>
|
||||
<th class="px-6 py-3">Message Delay</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($_SESSION['app']) {
|
||||
$query = misc\mysql\query("SELECT * FROM `chats` WHERE `app` = ?", [$_SESSION['app']]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result)) {
|
||||
$rows[] = $r;
|
||||
}
|
||||
foreach ($rows as $row) {
|
||||
$chan = $row['name'];
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
<td><?= $chan; ?></td>
|
||||
|
||||
|
||||
|
||||
<td><?= dashboard\primary\time2str(time() - $row["delay"]); ?></td>
|
||||
|
||||
<form method="POST">
|
||||
<td>
|
||||
<div x-data="{ open: false }" class="z-0">
|
||||
<button x-on:click="open = true"
|
||||
class="flex items-center border border-gray-700 rounded-lg focus:opacity-60 text-white focus:text-white font-semibold rounded focus:outline-none focus:shadow-inner py-2 px-4"
|
||||
type="button">
|
||||
<span class="mr-1">Actions</span>
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20" style="margin-top:3px">
|
||||
<path
|
||||
d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
|
||||
</svg>
|
||||
</button>
|
||||
<ul x-show="open" x-on:click.away="open = false"
|
||||
class="bg-[#09090d] text-white rounded shadow-lg absolute py-2 mt-1"
|
||||
style="min-width:15rem">
|
||||
<li>
|
||||
<button name="deletechan"
|
||||
class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="<?= $chan; ?>">
|
||||
Delete Channel
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button name="editchan"
|
||||
class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-blue-700"
|
||||
value="<?= $chan; ?>">
|
||||
Edit Channel
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- END CHAT TABLE -->
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
|
||||
<br>
|
||||
|
||||
<!-- START MESSAGES TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_messages" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Author</th>
|
||||
<th class="px-6 py-3">Message</th>
|
||||
<th class="px-6 py-3">Time Sent</th>
|
||||
<th class="px-6 py-3">Channel</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
if ($_SESSION['app']) {
|
||||
$query = misc\mysql\query("SELECT * FROM `chatmsgs` WHERE `app` = ?", [$_SESSION['app']]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result)) {
|
||||
$rows[] = $r;
|
||||
}
|
||||
foreach ($rows as $row) {
|
||||
$user = $row['author'];
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?= $user; ?></td>
|
||||
<td><?= $row["message"]; ?></td>
|
||||
<td>
|
||||
<script>
|
||||
document.write(convertTimestamp(<?= $row["timestamp"]; ?>));
|
||||
</script>
|
||||
</td>
|
||||
<td><?= $row["channel"]; ?></td>
|
||||
|
||||
<form method="POST">
|
||||
<td>
|
||||
|
||||
<div x-data="{ open: false }" class="z-0">
|
||||
<button x-on:click="open = true"
|
||||
class="flex items-center border border-gray-700 rounded-lg focus:opacity-60 text-white focus:text-white font-semibold rounded focus:outline-none focus:shadow-inner py-2 px-4"
|
||||
type="button">
|
||||
<span class="mr-1">Actions</span>
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20" style="margin-top:3px">
|
||||
<path
|
||||
d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
|
||||
</svg>
|
||||
</button>
|
||||
<ul x-show="open" x-on:click.away="open = false"
|
||||
class="bg-[#09090d] text-white rounded shadow-lg absolute py-2 mt-1"
|
||||
style="min-width:15rem">
|
||||
<li>
|
||||
<button name="deletemsg"
|
||||
class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="<?= $row["id"]; ?>">
|
||||
Delete Message
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button"
|
||||
class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-blue-700"
|
||||
onclick="muteuser('<?= $user; ?>')">
|
||||
Mute User
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- END MESSAGES TABLE -->
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
|
||||
<script>
|
||||
function muteuser(key) {
|
||||
|
||||
var muteuser = $('.muteuser');
|
||||
|
||||
muteuser.attr('value', key);
|
||||
|
||||
openModal('mute-user-modal');
|
||||
}
|
||||
</script>
|
||||
474
app/pages/files.php
Normal file
474
app/pages/files.php
Normal file
@@ -0,0 +1,474 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if ($role == "Manager" && !($permissions & 64)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view files.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page.");
|
||||
die();
|
||||
}
|
||||
if (!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
|
||||
if (isset($_POST['addfile'])) {
|
||||
$authed = misc\etc\sanitize($_POST['authed']) == NULL ? 0 : 1;
|
||||
$resp = misc\upload\add($_POST['url'], $authed);
|
||||
match($resp){
|
||||
'invalid' => dashboard\primary\error("URL not valid!"),
|
||||
'no_local' => dashboard\primary\error("URL can't be a local path! Must be a remote URL accessible by the open internet!"),
|
||||
'failure' => dashboard\primary\error("Failed to add file!"),
|
||||
'success' => dashboard\primary\success("Successfully added file!"),
|
||||
'tester_file_exceed' => dashboard\primary\error("Tester plan may only upload files up to 10MB. Upgrade for larger file size!"),
|
||||
'dev_file_exceed' => dashboard\primary\error("File size limit is 50MB. Please upgrade for larger file size!"),
|
||||
'seller_file_exceed' => dashboard\primary\error("File size limit is 75MB. This is the MAX"),
|
||||
'name_too_large' => dashboard\primary\error("File name is too large. Rename it to something shorter"),
|
||||
'invalid_extension' => dashboard\primary\error("No HTML files. You must get the DIRECT URL which downloads INSTANTLY. No download page, direct file."),
|
||||
'bad_response' => dashboard\primary\error("File either not found or URL not allowed by the file host!"),
|
||||
'discord_cdn' => dashboard\primary\error("Discord's developers made files expire after 24 hours, use catbox.moe or pages.dev instead!"),
|
||||
'github_no_raw' => dashboard\primary\error("Click the \"Raw\" button on GitHub file. Only use raw.githubusercontent.com URLs"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['delfiles'])) {
|
||||
$resp = misc\upload\deleteAll();
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete all files!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted all files!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['deletefile'])) {
|
||||
$resp = misc\upload\deleteSingular($_POST['deletefile']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete all files!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted all files!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['editfile'])) {
|
||||
$file = misc\etc\sanitize($_POST['editfile']);
|
||||
|
||||
$result = misc\mysql\query("SELECT `url` FROM `files` WHERE `id` = ? AND `app` = ?", [$file, $_SESSION['app']]);
|
||||
$fileUrl = mysqli_fetch_array($result->result);
|
||||
|
||||
echo '
|
||||
<div id="edit-file-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Edit File</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="url" name="url"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $fileUrl['url']. '"required>
|
||||
<label for="url"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">File URL:</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="flex items-center mb-4">
|
||||
<input id="authed" name="authed" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked>
|
||||
<label for="authed"
|
||||
class="ml-2 text-sm font-medium text-white-900">Authenticated</label>
|
||||
</div>
|
||||
|
||||
<button name="savefile"
|
||||
value="' . $file . '"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Save
|
||||
Changes</button>
|
||||
<button
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center" onClick="window.location.href=window.location.href">Cancel
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Edit Files Modal -->';
|
||||
}
|
||||
|
||||
if (isset($_POST['savefile'])) {
|
||||
$fileid = misc\etc\sanitize($_POST['savefile']);
|
||||
$url = misc\etc\sanitize($_POST['url']);
|
||||
|
||||
if (!filter_var($url, FILTER_VALIDATE_URL)) {
|
||||
dashboard\primary\error("Invalid Url!");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
if (str_contains($url, "discord")) {
|
||||
dashboard\primary\error("Discord's developers made files expire after 24 hours, use catbox.moe or pages.dev instead!");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
if (str_contains($url, "github.com")) {
|
||||
dashboard\primary\error("Click the \"Raw\" button on GitHub file. Only use raw.githubusercontent.com URLs");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
if (str_contains($url, "localhost") || str_contains($url, "127.0.0.1") || str_contains($url, "file:/")) {
|
||||
dashboard\primary\error("URL can't be a local path! Must be a remote URL accessible by the open internet");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize cURL session
|
||||
$ch = curl_init($url);
|
||||
|
||||
// Set options
|
||||
curl_setopt($ch, CURLOPT_NOBODY, true); // Only fetch headers, no body
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return the transfer as a string
|
||||
curl_setopt($ch, CURLOPT_HEADER, true); // Include the header in the output
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla KeyAuth');
|
||||
|
||||
$response = curl_exec($ch);
|
||||
|
||||
$httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ($httpStatusCode == 403 || $httpStatusCode == 404) {
|
||||
dashboard\primary\error("File either not found or URL not allowed by the file host!");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
// Get content length
|
||||
$filesize = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
|
||||
$contType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
|
||||
|
||||
if(str_contains($contType, "html")) {
|
||||
dashboard\primary\error("No HTML files. You must get the DIRECT URL which downloads INSTANTLY. No download page, direct file.");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
if ($filesize > 10000000 && $role == "tester") {
|
||||
dashboard\primary\error("Users with tester plan may only upload files up to 10MB. Paid plans may upload up to 75MB.");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
} else if ($filesize > 50000000 && ($role == "developer" || $role == "Manager")) {
|
||||
dashboard\primary\error("File size limit is 50 MB. Upgrade your account to gain a total of 75mb.");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
} else if ($filesize > 75000000) {
|
||||
dashboard\primary\error("File size limit is 75 MB.");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
$fn = basename(parse_url($url, PHP_URL_PATH));
|
||||
$fs = misc\etc\formatBytes($filesize);
|
||||
|
||||
if(strlen($fn) > 49) {
|
||||
dashboard\primary\error("File name is too large! Rename it to have a shorter name.");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
$authed = misc\etc\sanitize($_POST['authed']) == NULL ? 0 : 1;
|
||||
|
||||
$query = misc\mysql\query("UPDATE `files` SET `name` = ?,`size` = ?,`url` = ?, `uploaddate` = ?, `authed` = ? WHERE `app` = ? AND `id` = ?", [$fn, $fs, $url, time(), $authed, $_SESSION['app'], $fileid]);
|
||||
|
||||
if ($query->affected_rows != 0) {
|
||||
misc\cache\purge('KeyAuthFile:' . ($secret ?? $_SESSION['app']) . ':' . $fileid);
|
||||
dashboard\primary\success("Successfully Updated File!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to update file");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST["selected"]) && isset($_POST["action"])) {
|
||||
$selected = json_decode($_POST['selected'], true);
|
||||
if ($_POST["action"] == "delete") {
|
||||
foreach ($selected as $value) {
|
||||
$resp = misc\upload\deleteSingular($value);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete file!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted file!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
else if ($_POST["action"] == "authEnable") {
|
||||
foreach ($selected as $value) {
|
||||
$query = misc\mysql\query("UPDATE `files` SET `authed` = 1 WHERE `app` = ? AND `id` = ?", [$_SESSION['app'], $value]);
|
||||
|
||||
if ($query->affected_rows != 0) {
|
||||
misc\cache\purge('KeyAuthFile:' . ($secret ?? $_SESSION['app']) . ':' . $fileid);
|
||||
dashboard\primary\success("Successfully updated files!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to update files");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ($_POST["action"] == "authDisable") {
|
||||
foreach ($selected as $value) {
|
||||
$query = misc\mysql\query("UPDATE `files` SET `authed` = 0 WHERE `app` = ? AND `id` = ?", [$_SESSION['app'], $value]);
|
||||
|
||||
if ($query->affected_rows != 0) {
|
||||
misc\cache\purge('KeyAuthFile:' . ($secret ?? $_SESSION['app']) . ':' . $fileid);
|
||||
dashboard\primary\success("Successfully updated files!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to update files");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
dashboard\primary\error("Invalid action");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Files</h1>
|
||||
<p class="text-xs text-gray-500">Let your users download files you upload here. <a
|
||||
href="https://keyauthdocs.apidog.io/api/features/download-file" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Alert Box -->
|
||||
<div id="alert" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
Please <a
|
||||
href="https://www.iorad.com/player/2327871/KeyAuth-upload-files-tutorial" target="_blank"
|
||||
class="font-semibold underline hover:no-underline">follow this guide</a> to upload files. FREE & super easy!
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
<!-- Files Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="create-file-modal" data-modal-target="create-file-modal">
|
||||
<i class="lni lni-upload mr-2 mt-1"></i>Upload File
|
||||
</button>
|
||||
<!-- End Files Functions -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Delete Files Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-files-modal" data-modal-target="delete-all-files-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Files
|
||||
</button>
|
||||
|
||||
<button
|
||||
id="dropdownselection" data-dropdown-toggle="filedropdown"
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200 hidden"
|
||||
type="button">
|
||||
Selection Options
|
||||
</button>
|
||||
|
||||
<div id="filedropdown" class="z-10 hidden bg-[#09090d] divide-y divide-gray-100 rounded-lg shadow w-44">
|
||||
<ul class="py-2 text-sm text-white">
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Delete selected</a>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="authEnable">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Turn on authenticated</a>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="authDisable">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Turn off authenticated</a>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- End Delete Files Functions -->
|
||||
|
||||
<!-- Create New File Modal -->
|
||||
<div id="create-file-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-blue-700 shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Upload A New File</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<div id="alert" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]" role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path>
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
Please <a href="https://www.iorad.com/player/2327871/KeyAuth-upload-files-tutorial" target="_blank" class="font-semibold underline hover:no-underline">follow this guide</a> to upload files. FREE & super easy!
|
||||
</div>
|
||||
</div>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="url" name="url"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="url"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">File
|
||||
Direct Download Link</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input checked id="authed" type="checkbox" name="authed"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2 ">
|
||||
<label for="authed"
|
||||
class="ml-2 text-sm font-medium text-white-900 ">Authenticated</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" name="addfile"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Add
|
||||
File</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Create A File Modal -->
|
||||
|
||||
<!-- Delete All Files Modal -->
|
||||
<div id="delete-all-files-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
file!. <b>This can
|
||||
NOT be undone</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure
|
||||
you want
|
||||
to
|
||||
delete all of your files?</h3>
|
||||
<form method="POST">
|
||||
<button name="delfiles"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-files-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Files Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_files" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Select</th>
|
||||
<th class="px-6 py-3">Filename</th>
|
||||
<th class="px-6 py-3">ID</th>
|
||||
<th class="px-6 py-3">Size</th>
|
||||
<th class="px-6 py-3">Upload Date</th>
|
||||
<th class="px-6 py-3">Authenticated</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ($_SESSION['app']){
|
||||
$query = misc\mysql\query("SELECT * FROM `files` WHERE `app` = ?", [$_SESSION['app']]);
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)){
|
||||
echo "<tr>";
|
||||
|
||||
echo '<td> <input type="checkbox" style="outline:none;"class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 checkbox" value="' . $row["id"] .'">' . '</td>';
|
||||
|
||||
echo " <td>" . $row["name"] . "</td>";
|
||||
|
||||
echo " <td>" . $row["id"] . "</td>";
|
||||
|
||||
echo " <td>" . $row["size"] . "</td>";
|
||||
|
||||
echo " <td><script>document.write(convertTimestamp(" . $row["uploaddate"] . "));</script></td>";
|
||||
|
||||
echo "<td><span class='border " . ($row["authed"] ? 'border-green-700 text-green-700' : 'border-red-700 text-red-700') . " text-xs font-medium mr-2 px-2.5 py-0.5 rounded'>" . ($row["authed"] ? 'True' : 'False') . "</span></td>";
|
||||
|
||||
echo '<form method="POST">
|
||||
<td>
|
||||
|
||||
<div x-data="{ open: false }" class="z-0">
|
||||
<button x-on:click="open = true" class="flex items-center border border-gray-700 rounded-lg focus:opacity-60 text-white focus:text-white font-semibold rounded focus:outline-none focus:shadow-inner py-2 px-4" type="button">
|
||||
<span class="mr-1">Actions</span>
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" style="margin-top:3px">
|
||||
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<ul x-show="open" x-on:click.away="open = false" class="bg-[#09090d] text-white rounded shadow-lg absolute py-2 mt-1" style="min-width:15rem">
|
||||
<li>
|
||||
<button name="deletefile" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="' . $row["id"] . '">
|
||||
Delete File
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<a href="' . $row['url'] . '" target="_blank" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="' . urlencode($row["username"]) . '">
|
||||
Download File
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<button name="editfile" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-blue-700"
|
||||
value="' . $row["id"] . '">
|
||||
Edit File
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a
|
||||
class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
|
||||
<!-- Include the jQuery library -->
|
||||
641
app/pages/forms.php
Normal file
641
app/pages/forms.php
Normal file
@@ -0,0 +1,641 @@
|
||||
<?php
|
||||
if ($formBanned){
|
||||
dashboard\primary\error("You were banned from submitting forms.");
|
||||
die();
|
||||
}
|
||||
|
||||
include 'application-functions.php';
|
||||
|
||||
if (isset($_POST['submitStaffApplication'])){
|
||||
|
||||
if (isset($_POST['appliedBefore'])) {
|
||||
$appliedBeforeValue = "Yes";
|
||||
} else {
|
||||
$appliedBeforeValue = "No";
|
||||
}
|
||||
|
||||
if (isset($_POST['previousStaff'])) {
|
||||
$previousStaffValue = "Yes";
|
||||
} else {
|
||||
$previousStaffValue = "No";
|
||||
}
|
||||
|
||||
if (isset($_POST['ticketAssist'])) {
|
||||
$ticketAssistValue = "Yes";
|
||||
} else {
|
||||
$ticketAssistValue = "No";
|
||||
}
|
||||
|
||||
$color = 345342;
|
||||
$message =
|
||||
"\n **KeyAuth Username:** \n" . $_SESSION['username'] .
|
||||
"\n\n **Telegram, or Email:** \n" . $_POST['staffContactName'] .
|
||||
"\n\n **Member Duration:** \n" . $_POST['memberDuration'] .
|
||||
"\n\n **Timezone:** \n" . $_POST['timezone'] .
|
||||
"\n\n **Programming Languages:** \n" . $_POST['programLang'] .
|
||||
"\n\n **Join Reason:** \n" . $_POST['joinReason'] .
|
||||
"\n\n **Additional Info:** \n" . $_POST['additionalInfo'] .
|
||||
"\n\n **Applied Before?:** \n" . $appliedBeforeValue .
|
||||
"\n\n **Previous Staff?:** \n" . $previousStaffValue .
|
||||
"\n\n **Ticket Assistance?:** \n" . $ticketAssistValue .
|
||||
"\n\n ** --- MAKE SURE YOUR REACT IF YOU ACCEPT/DENY SOMEONE AND GIVE A REASON! --- **";
|
||||
sendStaffApplication($color, $_SESSION['username'], $message);
|
||||
}
|
||||
|
||||
if (isset($_POST['submitSuggestion'])){
|
||||
$suggestionTag = isset($_POST['suggestionType']) ? $_POST['suggestionType'] : '';
|
||||
match($suggestionTag){
|
||||
"Website" => $suggestionTag = "Website",
|
||||
"Telegram Bot" => $suggestionTag = "Telegram Bot",
|
||||
"Discord Bot" => $suggestionTag = "Discord Bot",
|
||||
"Documentation" => $suggestionTag = "Documentation",
|
||||
"Examples" => $suggestionTag = "Examples",
|
||||
"Telegram Server" => $suggestionTag = "Telegram Server",
|
||||
"API" => $suggestionTag = "API",
|
||||
"Seller API" => $suggestionTag = "Seller API",
|
||||
default => $suggestionTag = "Unhandled Error!"
|
||||
};
|
||||
MakeSuggestion($_POST['suggestionDescription'], "Videos/Images \n" . $_POST['suggestionLinks'] . "\n\nContact Information: \n" . $_POST['suggestionContactName'], $suggestionTag);
|
||||
}
|
||||
|
||||
if (isset($_POST['reportBug'])){
|
||||
$bugTag = isset($_POST['bugType']) ? $_POST['bugType'] : '';
|
||||
match($bugTag){
|
||||
"Website" => $bugTag = "Website",
|
||||
"Telegram Bot" => $bugTag = "Telegram Bot",
|
||||
"Discord Bot" => $bugTag = "Discord Bot",
|
||||
"Documentation" => $bugTag = "Documentation",
|
||||
"Examples" => $bugTag = "Examples",
|
||||
"API" => $bugTag = "API",
|
||||
"Seller API" => $bugTag = "Seller API",
|
||||
default => $bugTag = "Unhandled Error!"
|
||||
};
|
||||
ReportBug($_POST['bugDescription'], "Videos/Images \n" . $_POST['bugLinks'] . "\n\nContact Information: \n" . $_POST['bugContactName'], $bugTag);
|
||||
}
|
||||
|
||||
if (isset($_POST['submitReport'])){
|
||||
if (!isset($_POST['reportHonesty'])){
|
||||
dashboard\primary\error("You must be honest on your report!");
|
||||
}
|
||||
|
||||
if (!isset($_POST['reportUnderstanding'])){
|
||||
dashboard\primary\error("You must fully understand you being banned if you fail to be truthful to submit your report!");
|
||||
}
|
||||
|
||||
$color = 880808;
|
||||
$message =
|
||||
"\n **KeyAuth Username:** \n" . $_SESSION['username'] .
|
||||
"\n\n **Contact Method:** \n" . $_POST['reportcontactName'] .
|
||||
"\n\n **Staff or Member:** \n" . $_POST['reportType'] .
|
||||
"\n\n **Report Reason:** \n" . $_POST['reportReason'] .
|
||||
"\n\n **Users (Reported) Contact:** \n" . $_POST['usersContact'];
|
||||
sendReport($color, $_SESSION['username'], $message);
|
||||
}
|
||||
|
||||
if (isset($_POST['fileDmca'])){
|
||||
if (!isset($_POST["dmcaHonesty"])){
|
||||
dashboard\primary\error("You must be honest on your report!");
|
||||
}
|
||||
|
||||
if (!isset($_POST["dmcaalerted"])){
|
||||
dashboard\primary\error("You must attempt to reach out to the user before submitting a DMCA request!");
|
||||
}
|
||||
|
||||
if (isset($_POST['reachoutFailure'])) {
|
||||
$reachoutFailureValue = "Yes";
|
||||
} else {
|
||||
$reachoutFailureValue = "No";
|
||||
}
|
||||
|
||||
$color = 880808;
|
||||
$message =
|
||||
"\n **KeyAuth Username:** \n" . $_SESSION['username'] .
|
||||
"\n\n **Contact Method:** \n" . $_POST['dmcaContactName'] .
|
||||
"\n\n **DMCA Type:** \n" . $_POST['dmcaType'] .
|
||||
"\n\n **Report Reason:** \n" . $_POST['dmcaDescription'] .
|
||||
"\n\n **Proof:** \n" . $_POST['dmcaProof'] .
|
||||
"\n\n **User failed to respond to reach out?** \n" . $reachoutFailureValue;
|
||||
submitDMCA($color, $_SESSION['username'], $message);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Forms</h1>
|
||||
<p class="text-xs text-gray-500">Just about any form you need.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
|
||||
<!-- Alert Box -->
|
||||
<div id="alert-4" class="flex items-center p-4 mb-1 text-red-600 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium">
|
||||
Lying, spamming, or abusing any of these forms will result in you being banned from
|
||||
submitting any form.
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
|
||||
<div class="mt-3 gap-1.5 grid grid-cols-1 sm:grid-cols-2 md:block md:grid-cols-0">
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200"
|
||||
id="staffButton">
|
||||
<i class="lni lni-pencil-alt mr-2 mt-1"></i>
|
||||
Apply For Staff
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-purple-500 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200"
|
||||
id="suggestionButton">
|
||||
<i class="lni lni-bulb mr-2 mt-1"></i>
|
||||
Make A Suggestion
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-orange-500 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200"
|
||||
id="bugButton">
|
||||
<i class="lni lni-bug mr-2 mt-1"></i>
|
||||
Report A Bug
|
||||
</button>
|
||||
|
||||
<a href="?page=bug-bounty"
|
||||
class="inline-flex text-white bg-green-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200">
|
||||
<i class="lni lni-warning mr-2 mt-1"></i>
|
||||
Report A Vulnerability
|
||||
</a>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-cyan-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200"
|
||||
id="fileReportButton">
|
||||
<i class="lni lni-folder mr-2 mt-1"></i>
|
||||
File A Report
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200"
|
||||
id="dmcaButton">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>
|
||||
DMCA
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-[#09090d] block sm:flex items-center justify-between lg:mt-5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] mt-4 md:mt-2 rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
|
||||
<div id="sect1" class="hidden">
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Apply For Staff</h1>
|
||||
<p class="text-xs text-gray-500">Join our team! As a member of staff, you will be able to assist
|
||||
the community with any issues they are having, receive the seller subscription for free, and
|
||||
get $10 off of Enterprise.</p>
|
||||
<form method="POST">
|
||||
<div class="relative mb-4 mt-5">
|
||||
<input type="text" id="staffContactName" name="staffContactName"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="staffContactName"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Telegram Link,
|
||||
or Email</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4 ">
|
||||
<select id="memberDuration" name="memberDuration"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="Less than 1 week" selected>Less than 1 week</option>
|
||||
<option value="More than 1 month">More than 1 month</option>
|
||||
<option value="More than 3 months">More than 3 months</option>
|
||||
<option value="More than 6 months">More than 6 months</option>
|
||||
<option value="More than 9 months">More than 9 months</option>
|
||||
<option value="More than 1 year">More than 1 year</option>
|
||||
</select>
|
||||
<label for="memberDuration"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">How
|
||||
long have you been a KeyAuth member?</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="timezone" name="timezone"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="timezone"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">What
|
||||
is your timezone?</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="programLang" name="programLang"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="programLang"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">What programming
|
||||
languages do you know? (must be experienced in them for more than 6 months to be considered known)</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="joinReason" name="joinReason"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="joinReason"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Why
|
||||
do you want to join staff?</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="additionalInfo" name="additionalInfo"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="">
|
||||
<label for="additionalInfo"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Additional
|
||||
Info?</label>
|
||||
</div>
|
||||
|
||||
<input checked id="appliedBefore" name="appliedBefore" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="appliedBefore" class="ml-1 text-sm font-medium text-white-900">I have applied
|
||||
before</label>
|
||||
|
||||
<input checked id="previousStaff" name="previousStaff" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="previousStaff" class="ml-1 text-sm font-medium text-white-900">I am a previous
|
||||
staff member</label>
|
||||
|
||||
<input checked id="ticketAssist" name="ticketAssist" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="ticketAssist" class="ml-1 text-sm font-medium text-white-900">I understand I must assist with Web</label>
|
||||
<div class="flex justify-end">
|
||||
|
||||
<button type="submit"
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200"
|
||||
name="submitStaffApplication">
|
||||
<i class="lni lni-arrow-right mr-2 mt-1"></i>
|
||||
Submit Staff Application
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="sect2" class="hidden">
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Make A Suggestion</h1>
|
||||
<p class="text-xs text-gray-500">Have a suggestion? Feel free to let us know!</p>
|
||||
<br>
|
||||
<!-- Alert Box -->
|
||||
<div id="alert-4" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
This is for new feature requests.
|
||||
NOT anything else.
|
||||
If you need account support, please use the <b><u>Chat with us</u></b>
|
||||
on the right-hand side of your screen.
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
<form method="POST">
|
||||
<div class="relative mb-4 mt-5">
|
||||
<input type="text" id="suggestionContactName" name="suggestionContactName"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="suggestionContactName"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Telegram Link,
|
||||
or Email</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4 ">
|
||||
<select id="suggestionType" name="suggestionType"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="Website" selected>Website</option>
|
||||
<option value="Telegram Bot">Telegram Bot</option>
|
||||
<option value="Discord Bot">Discord Bot</option>
|
||||
<option value="Documentation">Documentation</option>
|
||||
<option value="Examples">Examples</option>
|
||||
<option value="Telegram Server">Telegram Server</option>
|
||||
<option value="API">API</option>
|
||||
<option value="Seller API">Seller API</option>
|
||||
</select>
|
||||
<label for="suggestionType"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">What
|
||||
are you making a suggestion for?</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="suggestionDescription" name="suggestionDescription"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="suggestionDescription"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Describe
|
||||
the suggestion</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="suggestionLinks" name="suggestionLinks"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="">
|
||||
<label for="suggestionLinks"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Provide
|
||||
links to images/videos (optional)</label>
|
||||
</div>
|
||||
|
||||
<input checked id="firstSuggestion" name="firstSuggestion" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="firstSuggestion" class="ml-1 text-sm font-medium text-white-900">This is my
|
||||
first
|
||||
time
|
||||
making this suggestion</label>
|
||||
|
||||
<input checked id="existingSuggestion" name="existingSuggestion" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="existingSuggestion" class="ml-1 text-sm font-medium text-white-900">This
|
||||
suggestion
|
||||
does
|
||||
NOT exist yet</label>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit"
|
||||
class="inline-flex text-white bg-purple-500 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200"
|
||||
name="submitSuggestion">
|
||||
<i class="lni lni-arrow-right mr-2 mt-1"></i>
|
||||
Submit Suggestion
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="sect3" class="hidden">
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Report A Bug</h1>
|
||||
<p class="text-xs text-gray-500">Found a bug? Report it so that we can fix it ASAP!</p>
|
||||
<br>
|
||||
<!-- Alert Box -->
|
||||
<div id="alert-4" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
This is ONLY for issues found with DEFAULT settings and happens after testing many ways.
|
||||
If you need account support, please use the <b><u>Chat with us</u></b>
|
||||
on the right-hand side of your screen.
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
<form method="POST">
|
||||
<div class="relative mb-4 mt-5">
|
||||
<input type="text" id="bugContactName" name="bugContactName"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="bugContactName"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Telegram Link,
|
||||
or Email</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4 ">
|
||||
<select id="bugType" name="bugType"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="Website" selected>Website</option>
|
||||
<option value="Telegram Bot">Telegram Bot</option>
|
||||
<option value="Discord Bot">Discord Bot</option>
|
||||
<option value="Documentation">Documentation</option>
|
||||
<option value="Examples">Examples</option>
|
||||
<option value="API">API</option>
|
||||
<option value="Seller API">Seller API</option>
|
||||
</select>
|
||||
<label for="bugType"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">What
|
||||
are you making a bug for?</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="bugDescription" name="bugDescription"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="bugDescription"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Describe
|
||||
the bug</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="bugLinks" name="bugLinks"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="">
|
||||
<label for="bugLinks"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Provide
|
||||
links to images/videos (optional)</label>
|
||||
</div>
|
||||
|
||||
<input checked id="firstBug" name="firstBug" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="firstBug" class="ml-1 text-sm font-medium text-white-900">This is my first time
|
||||
making this bug report</label>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button
|
||||
class="inline-flex text-white bg-orange-500 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200"
|
||||
name="reportBug">
|
||||
<i class="lni lni-arrow-right mr-2 mt-1"></i>
|
||||
Report Bug
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="sect4" class="hidden">
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">File A Report</h1>
|
||||
<p class="text-xs text-gray-500">Need to report a staff member or a member of the community?
|
||||
Feel free to do so here.</p>
|
||||
<form method="POST">
|
||||
<div class="relative mb-4 mt-5">
|
||||
<input type="text" id="reportcontactName" name="reportcontactName"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="reportcontactName"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Telegram Link,
|
||||
or Email</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4 ">
|
||||
<select id="reportType" name="reportType"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="A Community Member" selected>A Community Member</option>
|
||||
<option value="A Staff Member">A Staff Member</option>
|
||||
</select>
|
||||
<label for="reportType"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Who
|
||||
are you reporting?</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="reportReason" name="reportReason"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="reportReason"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Reason
|
||||
for the report?</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="usersContact" name="usersContact"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="usersContact"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Provide
|
||||
a way we can contact them.</label>
|
||||
</div>
|
||||
|
||||
<input checked id="reportHonesty" name="reportHonesty" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="reportHonesty" class="ml-1 text-sm font-medium text-white-900">My report is 100%
|
||||
honest!</label>
|
||||
|
||||
<input checked id="reportUnderstanding" name="reportUnderstanding" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="reportUnderstanding" class="ml-1 text-sm font-medium text-white-900">I
|
||||
understand I
|
||||
will be banned from submitting forms if I am caught lying on this form.</label>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit"
|
||||
class="inline-flex text-white bg-cyan-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200"
|
||||
name="submitReport">
|
||||
<i class="lni lni-arrow-right mr-2 mt-1"></i>
|
||||
Submit Report
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="sect5" class="hidden">
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">File A DMCA Request</h1>
|
||||
<p class="text-xs text-gray-500">Found someone breaking KeyAuth license/TOS or stealing your
|
||||
content? Report it so we can review it.</p>
|
||||
|
||||
<form method="POST">
|
||||
<div class="relative mb-4 mt-5">
|
||||
<input type="text" id="dmcaContactName" name="dmcaContactName"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="dmcaContactName"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Telegram Link,
|
||||
or Email</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4 ">
|
||||
<select id="dmcaType" name="dmcaType"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="KeyAuth Content" selected>KeyAuth Content</option>
|
||||
<option value="My Content">My Content</option>
|
||||
</select>
|
||||
<label for="dmcaType"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">What
|
||||
would you like to file a DMCA for?</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="dmcaProof" name="dmcaProof"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="dmcaProof"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Provide
|
||||
links to images/videos/sites.</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="dmcaDescription" name="dmcaDescription"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="dmcaDescription"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Explain
|
||||
the reason for the request</label>
|
||||
</div>
|
||||
|
||||
<input checked id="dmcaHonesty" name="dmcaHonesty" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="dmcaHonesty" class="ml-1 text-sm font-medium text-white-900">All info on this
|
||||
request is 100% honest</label>
|
||||
|
||||
<input checked id="dmcaalerted" name="dmcaalerted" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="dmcaalerted" class="ml-1 text-sm font-medium text-white-900">I have alerted the
|
||||
user
|
||||
to take it down already</label>
|
||||
|
||||
<input checked id="reachoutFailure" name="reachoutFailure" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="reachoutFailure" class="ml-1 text-sm font-medium text-white-900">The user
|
||||
acknowledged my reach out, but failed to respond</label>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit"
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 transition duration-200"
|
||||
name="fileDmca">
|
||||
<i class="lni lni-arrow-right mr-2 mt-1"></i>
|
||||
File DMCA
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Function to show the corresponding section based on the button clicked
|
||||
function showSection(sectionId) {
|
||||
// Hide all sections
|
||||
const sections = document.querySelectorAll('div[id^="sect"]');
|
||||
sections.forEach(section => {
|
||||
section.classList.add('hidden');
|
||||
});
|
||||
|
||||
// Show the selected section
|
||||
const selectedSection = document.getElementById(sectionId);
|
||||
if (selectedSection) {
|
||||
selectedSection.classList.remove('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
// Add event listeners to the buttons
|
||||
const staffButton = document.getElementById('staffButton');
|
||||
const sectSuggestion = document.getElementById('suggestionButton');
|
||||
const sectBug = document.getElementById('bugButton');
|
||||
const sectReport = document.getElementById('fileReportButton');
|
||||
const sectDmca = document.getElementById('dmcaButton');
|
||||
|
||||
staffButton.addEventListener('click', function() {
|
||||
showSection('sect1');
|
||||
});
|
||||
|
||||
suggestionButton.addEventListener('click', function() {
|
||||
showSection('sect2');
|
||||
});
|
||||
|
||||
bugButton.addEventListener('click', function() {
|
||||
showSection('sect3');
|
||||
});
|
||||
|
||||
sectReport.addEventListener('click', function() {
|
||||
showSection('sect4');
|
||||
});
|
||||
|
||||
dmcaButton.addEventListener('click', function() {
|
||||
showSection('sect5');
|
||||
});
|
||||
</script>
|
||||
974
app/pages/licenses.php
Normal file
974
app/pages/licenses.php
Normal file
@@ -0,0 +1,974 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
|
||||
if ($role == "Manager" && !($permissions & 1)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view licenses.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page!");
|
||||
die();
|
||||
}
|
||||
if (!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("You must select an app first.");
|
||||
header("location: ./?page=manage-apps");
|
||||
die();
|
||||
}
|
||||
|
||||
if (isset($_POST['unbankey'])) {
|
||||
$resp = misc\license\unban($_POST['unbankey']);
|
||||
match ($resp) {
|
||||
'failure' => dashboard\primary\error("Failed to unban license!"),
|
||||
'success' => dashboard\primary\success("Successfully unbanned license!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['genkeys'])) {
|
||||
if (empty(trim($_POST['mask']))) {
|
||||
dashboard\primary\error("You must specify a key mask.");
|
||||
} else {
|
||||
$key = misc\license\createLicense($_POST['amount'], $_POST['mask'], $_POST['duration'], $_POST['level'], $_POST['note'], $_POST['user'], $_POST['expiry']);
|
||||
switch ($key) {
|
||||
case 'max_keys':
|
||||
dashboard\primary\error("You can only generate 100 licenses at a time");
|
||||
break;
|
||||
case 'tester_limit':
|
||||
dashboard\primary\error("Tester plan only allows for 10 licenses, please upgrade!");
|
||||
break;
|
||||
case 'dupe_custom_key':
|
||||
dashboard\primary\error("Can't do custom key with amount greater than one");
|
||||
break;
|
||||
default:
|
||||
$mask = misc\etc\sanitize($_POST['mask']);
|
||||
$amount = intval($_POST['amount']);
|
||||
$level = misc\etc\sanitize($_POST['level']);
|
||||
$note = misc\etc\sanitize($_POST['note']);
|
||||
$user = misc\etc\sanitize($_POST['user']);
|
||||
$duration = misc\etc\sanitize($_POST['duration']);
|
||||
$expiry = misc\etc\sanitize($_POST['expiry']);
|
||||
|
||||
misc\mysql\query("UPDATE `apps` SET `format` = ?,`amount` = ?,`lvl` = ?,`note` = ?,`user` = ?,`duration` = ?,`unit` = ? WHERE `secret` = ?", [$mask, $amount, $level, $note, $user, $duration, $expiry, $_SESSION['app']]);
|
||||
$_SESSION['keys_array'] = $key;
|
||||
dashboard\primary\success("License(s) Created And Displayed Above!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST["action"]) && isset($_POST["selected"])) {
|
||||
$selected = json_decode($_POST['selected'], true);
|
||||
if ($_POST["action"] == "delete") {
|
||||
if ($_SESSION['role'] == "tester") {
|
||||
dashboard\primary\error("Free tester accounts can't delete keys, upgrade your account to delete keys!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
foreach ($selected as $value) {
|
||||
$resp = misc\license\deleteSingular($value, false, $_SESSION['app']);
|
||||
match ($resp) {
|
||||
'failure' => dashboard\primary\error("Failed to delete license!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted license!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
else if ($_POST["action"] == "banKeyMulti") {
|
||||
foreach ($selected as $value) {
|
||||
$resp = misc\license\ban($value, "You selected to ban multiple keys", 0);
|
||||
match ($resp) {
|
||||
'failure' => dashboard\primary\error("Failed to ban keys!"),
|
||||
'success' => dashboard\primary\success("Successfully banned keys!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
else {
|
||||
dashboard\primary\error("Invalid action");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['editkey'])) {
|
||||
$key = misc\etc\sanitize($_POST['editkey']);
|
||||
$query = misc\mysql\query("SELECT * FROM `keys` WHERE `key` = ? AND `app` = ?",[$key, $_SESSION['app']]);
|
||||
if ($query->num_rows < 1) {
|
||||
dashboard\primary\error("Key not Found!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
?>
|
||||
<!-- Edit User Modal -->
|
||||
<div id="edit-key-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Edit License</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="level" name="level"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " value="<?= $row['level']; ?>" autocomplete="on">
|
||||
<label for="level"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Level:</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="expiry" name="expiry"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="1">Seconds</option>
|
||||
<option value="60">Minutes</option>
|
||||
<option value="3600">Hours</option>
|
||||
<option value="86400">Days</option>
|
||||
<option value="604800">Weeks</option>
|
||||
<option value="2629743">Months</option>
|
||||
<option value="31556926">Years</option>
|
||||
<option value="315569260">Lifetime</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="duration" name="duration"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" ">
|
||||
<label for="duration"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Duration:</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="editNote" name="editNote"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" ">
|
||||
<label for="editNote"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">New
|
||||
Note:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;">
|
||||
|
||||
<button name="savekey"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"
|
||||
value="<?= $key; ?>">Save Changes</button>
|
||||
|
||||
<button
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"
|
||||
onClick="window.location.href=window.location.href">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Edit User Modal -->
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 lang class="text-xl font-semibold text-white-900 sm:text-2xl">Licenses</h1>
|
||||
<p class="text-xs text-gray-500">Licenses allow your users to register on your application.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<form method="POST">
|
||||
<!-- Key Functions -->
|
||||
<button type="button"
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="create-key-modal" data-modal-target="create-key-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i> Create Keys
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="add-time-modal" data-modal-target="add-time-modal">
|
||||
<i class="lni lni-timer mr-2 mt-1"></i>Add Time To Unused Keys
|
||||
</button>
|
||||
<?php
|
||||
if ($role != "tester"){?>
|
||||
<button type="button"
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="import-key-modal" data-modal-target="import-key-modal">
|
||||
<i class="lni lni-upload mr-2 mt-1"></i>Import Keys
|
||||
</button>
|
||||
<?php } ?>
|
||||
|
||||
<button name="dlkeys"
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">
|
||||
<i class="lni lni-download mr-2 mt-1"></i>Export Keys
|
||||
</button>
|
||||
</form>
|
||||
<!-- End Key Functions -->
|
||||
|
||||
<!-- Delete Key Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-keys-modal" data-modal-target="delete-all-keys-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Keys
|
||||
</button>
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-used-keys-modal" data-modal-target="delete-all-used-keys-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Used Keys
|
||||
</button>
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-unused-keys-modal"
|
||||
data-modal-target="delete-all-unused-keys-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i></i>Delete All Unused Keys
|
||||
</button>
|
||||
|
||||
<button id="dropdownselection" data-dropdown-toggle="licenseSelecteddropdown"
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200 hidden"
|
||||
type="button"><i class="lni lni-trash-can mr-2 mt-1"></i>Selection Options
|
||||
</button>
|
||||
|
||||
<div id="licenseSelecteddropdown" class="z-10 hidden bg-[#09090d] divide-y divide-gray-100 rounded-lg shadow w-44">
|
||||
<ul class="py-2 text-sm text-white">
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Delete selected</a>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="banKeyMulti">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Ban selected</a>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- End Delete Key Functions -->
|
||||
|
||||
<?php
|
||||
if (isset($_SESSION['keys_array'])) {
|
||||
$list = $_SESSION['keys_array'];
|
||||
$keys = NULL;
|
||||
for ($i = 0; $i < count($list); $i++) {
|
||||
$keys .= "" . $list[$i] . "<br>";
|
||||
}
|
||||
echo "<div class=\"card\"> <div class=\"card-body\" id=\"multi-keys\"> $keys </div> </div> <br>";
|
||||
echo "<button onclick=\"copyToClipboard()\" class=\"inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200\">Copy new license(s)</button>";
|
||||
unset($_SESSION['keys_array']);
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Create Key Modal -->
|
||||
<div id="create-key-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT `format`, `amount`, `lvl`, `note`, `user`, `duration`, `unit` FROM `apps` WHERE `secret` = ?", [$_SESSION['app']]);
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
|
||||
$format = $row['format'];
|
||||
$amt = $row['amount'];
|
||||
$lvl = $row['lvl'];
|
||||
$note = $row['note'];
|
||||
$user = $row['user'];
|
||||
$dur = $row['duration'];
|
||||
$unit = $row['unit'];
|
||||
?>
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="text-xl font-medium text-white-900">Create A New Key</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" min="1" max="100" id="amount"
|
||||
name="amount"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on"
|
||||
value="<?php if (!is_null($amt)) { echo $amt; } ?>"
|
||||
required data-popover-target="amount-popover">
|
||||
<label for="amount"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">License
|
||||
Amount</label>
|
||||
|
||||
<?php dashboard\primary\popover("amount-popover", "License Amount", "The amount of licenses you would like to create."); ?>
|
||||
</div>
|
||||
|
||||
<!-- Alert Box -->
|
||||
<div id="alert" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
Free user keys will say "<a
|
||||
href="https://vaultcord.com/?utm_source=keyauth" target="_blank"
|
||||
class="font-semibold underline hover:no-underline">VAULTCORD</a>" because of our partnership with the Free Discord backup bot. Backup all members & your entire Discord server!
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" maxlength="49" id="mask" name="mask"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder="*****-*****-*****-*****" autocomplete="on"
|
||||
value="<?php if (!is_null($format)) { echo $format; } else { echo "*****-*****-*****-*****-*****"; } ?>"
|
||||
required data-popover-target="mask-popover">
|
||||
<label for="mask"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">License
|
||||
Mask</label>
|
||||
|
||||
<?php dashboard\primary\popover("mask-popover", "License Mask", "The format of the license. You can use * to generate random characters."); ?>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div class="flex items-center">
|
||||
<input id="lowercaseLetters" name="lowercaseLetters" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked data-popover-target="lowercase-popover">
|
||||
<label for="lowercaseLetters" class="ml-2 text-sm font-medium text-white-900">
|
||||
Lowercase Letters</label>
|
||||
<?php dashboard\primary\popover("lowercase-popover", "Lowercase Letters", "Include lowercase letters in your license."); ?>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="capitalLetters" name="capitalLetters" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked data-popover-target="capital-popover">
|
||||
<label for="capitalLetters" class="ml-2 text-sm font-medium text-white-900">
|
||||
Uppercase Letters</label>
|
||||
<?php dashboard\primary\popover("capital-popover", "Capital Letters", "Include capital letters in your license."); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="relative mb-4 pt-2">
|
||||
<select id="level" name="level"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"
|
||||
data-popover-target="level-popover">
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT DISTINCT `level` FROM `subscriptions` WHERE `app` = ? ORDER BY `level` ASC", [$_SESSION['app']]);
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
$queryName = misc\mysql\query("SELECT `name` FROM `subscriptions` WHERE `level` = ? AND `app` = ?", [$row["level"], $_SESSION['app']]);
|
||||
$name = " (";
|
||||
$count = 0;
|
||||
while ($rowSubs = mysqli_fetch_array($queryName->result)) {
|
||||
$count++;
|
||||
if ($count > 1) {
|
||||
$name .= ", " . $rowSubs["name"];
|
||||
} else {
|
||||
$name .= $rowSubs["name"];
|
||||
}
|
||||
}
|
||||
$name .= ")";
|
||||
?>
|
||||
|
||||
<option <?= $lvl == $row["level"] ? 'selected="selected"' : ''; ?>
|
||||
value="<?= $row["level"]; ?>">
|
||||
<?= $row["level"] . $name; ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<?php dashboard\primary\popover("level-popover", "License Level", "The level/subscription you would like to assign to your license(s)."); ?>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" maxlength="69" id="note" name="note"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on"
|
||||
value="<?php if (!is_null($note)) { } ?>"
|
||||
data-popover-target="note-popover">
|
||||
<label for="note"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">License
|
||||
Note</label>
|
||||
|
||||
<?php dashboard\primary\popover("note-popover", "License Note", "A unique message for a license."); ?>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" maxlength="69" id="user" name="user"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on"
|
||||
value="<?php if (!is_null($user)) { } ?>"
|
||||
required data-popover-target="user-popover">
|
||||
<label for="user"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">License
|
||||
User</label>
|
||||
|
||||
<?php dashboard\primary\popover("user-popover", "License User", "Function to Group license by user from shop."); ?>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="expiry" name="expiry"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"
|
||||
data-popover-target="expiry-popover">
|
||||
<option value="1" <?= $unit == 1 ? 'selected="selected"' : ''; ?>>
|
||||
Seconds
|
||||
</option>
|
||||
<option value="60" <?= $unit == 60 ? 'selected="selected"' : ''; ?>>
|
||||
Minutes
|
||||
</option>
|
||||
<option value="3600"
|
||||
<?= $unit == 3600 ? 'selected="selected"' : ''; ?>>
|
||||
Hours
|
||||
</option>
|
||||
<option value="86400"
|
||||
<?= $unit == 86400 ? 'selected="selected"' : ''; ?>>
|
||||
Days
|
||||
</option>
|
||||
<option value="604800"
|
||||
<?= $unit == 604800 ? 'selected="selected"' : ''; ?>>
|
||||
Weeks
|
||||
</option>
|
||||
<option value="2629743"
|
||||
<?= $unit == 2629743 ? 'selected="selected"' : ''; ?>>
|
||||
Months
|
||||
</option>
|
||||
<option value="31556926"
|
||||
<?= $unit == 31556926 ? 'selected="selected"' : ''; ?>>
|
||||
Years
|
||||
</option>
|
||||
<option value="315569260"
|
||||
<?= $unit == 315569260 ? 'selected="selected"' : ''; ?>>
|
||||
Lifetime
|
||||
</option>
|
||||
</select>
|
||||
<label for="expiry"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">License
|
||||
Expiry Unit</label>
|
||||
|
||||
<?php dashboard\primary\popover("expiry-popover", "License Expiry (unit)", "The unit the license will expire in."); ?>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" maxlength="4" id="duration"
|
||||
name="duration"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" pattern="\d*"
|
||||
value="<?php if (!is_null($dur)) { } ?>"
|
||||
required data-popover-target="duration-popover">
|
||||
<label for="duration"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">License
|
||||
Duration</label>
|
||||
|
||||
<?php dashboard\primary\popover("duration-popover", "License Expiry (duration)", "The duration the license will expire in. (Unit * Duration = Expiry)"); ?>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" name="genkeys"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Generate
|
||||
Keys</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Create Key Modal -->
|
||||
|
||||
<!-- Add Time To Key Modal -->
|
||||
<div id="add-time-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Add Time To Unused Licenses</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4 ">
|
||||
<select id="expiry" name="expiry"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="1" selected>Seconds</option>
|
||||
<option value="60">Minutes</option>
|
||||
<option value="3600">Hours</option>
|
||||
<option value="86400">Days</option>
|
||||
<option value="604800">Weeks</option>
|
||||
<option value="2629743">Months</option>
|
||||
<option value="31556926">Years</option>
|
||||
<option value="315569260">Lifetime</option>
|
||||
</select>
|
||||
<label for="expiry"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Unit
|
||||
of Time To Add</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" min="1" id="time" name="time"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" placeholder="" required>
|
||||
<label for="time"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Time
|
||||
To Add</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<button name="addtime"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Add
|
||||
Time</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Add Time To Key Modal -->
|
||||
|
||||
<!-- Import Keys Modal -->
|
||||
<div id="import-key-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Import Licenses .json</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST" enctype="multipart/form-data">
|
||||
<div class="relative">
|
||||
<input
|
||||
class="block w-full text-sm text-gray-400 border border-gray-700 rounded-lg cursor-pointer focus:outline-none"
|
||||
id="file_input" name="file_input" type="file">
|
||||
</div>
|
||||
<button type="submit" name="importkeysFile"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Import
|
||||
Licenses</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Import Keys Modal -->
|
||||
|
||||
<!-- Delete All Keys Modal -->
|
||||
<div id="delete-all-keys-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> This will not delete users (prevent
|
||||
them from logging in). Go to https://keyauth.cc/app/?page=users for that.
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your keys? This can not be undone.</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-keys-modal" name="delkeys"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-keys-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Keys Modal -->
|
||||
|
||||
<!-- Delete All Used Keys Modal -->
|
||||
<div id="delete-all-used-keys-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> This will not delete users (prevent
|
||||
them from logging in). Go to https://keyauth.cc/app/?page=users for that.
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your used keys? This can not be undone.</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-used-keys-modal" name="deleteallused"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-used-keys-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Used Keys Modal -->
|
||||
|
||||
<!-- Delete All Unused Keys Modal -->
|
||||
<div id="delete-all-unused-keys-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> This will not delete users (prevent
|
||||
them from logging in). Go to https://keyauth.cc/app/?page=users for that.
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your unused keys? This can not be undone.</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-unused-keys-modal" name="deleteallunused"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-unused-keys-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Unused Keys Modal -->
|
||||
|
||||
<!-- Delete Key Modal -->
|
||||
<div id="del-key" tabindex="-1"
|
||||
class="modal fixed inset-0 flex items-center justify-center z-50 hidden">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> This will not delete the user
|
||||
(prevent them from logging in) unless you check Delete User Too
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
this key? This can not be undone.</h3>
|
||||
<form method="POST">
|
||||
<div class="flex items-center mb-4">
|
||||
<input id="delUserToo" name="delUserToo" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked>
|
||||
<label for="delUserToo"
|
||||
class="ml-2 text-sm font-medium text-white-900">Delete user too</label>
|
||||
</div>
|
||||
|
||||
<button name="deletekey"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2 delkey">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button type="button" onclick="closeModal('del-key')"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete Key Modal -->
|
||||
|
||||
<!-- Ban License Modal Actions-->
|
||||
<div id="ban-key-modal" tabindex="-1"
|
||||
class="modal fixed inset-0 flex items-center justify-center z-50 hidden">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-red-800 border border-red-700 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium text-red-400">Notice! This will not ban the user
|
||||
(prevent them from logging in) unless you check Ban User Too</b></span>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to ban this
|
||||
license?
|
||||
<form method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4 pt-4">
|
||||
<input type="text" id="reason" name="reason"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer focus:border-red-700"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="reason"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-red-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Ban
|
||||
Reason</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center mb-4 pt-4">
|
||||
<input id="banUserToo" name="banUserToo" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked>
|
||||
<label for="banUserToo"
|
||||
class="ml-2 text-sm font-medium text-white-900">Ban User
|
||||
Too?</label>
|
||||
</div>
|
||||
<button name="bankey"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2 bankey">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button type="button" onclick="closeModal('ban-key-modal')"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Ban License Modal Actions-->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_licenses" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="border-2 border-gray-200 text-blue-700 px-7">
|
||||
<th scope="col" class="px-6 py-3">Select</th>
|
||||
<th scope="col" class="px-6 py-3">Key</th>
|
||||
<th scope="col" class="px-6 py-3">User</th>
|
||||
<th scope="col" class="px-6 py-3">Creation Date</th>
|
||||
<th scope="col" class="px-6 py-3">Generated By</th>
|
||||
<th scope="col" class="px-6 py-3">Duration</th>
|
||||
<th scope="col" class="px-6 py-3">Note</th>
|
||||
<th scope="col" class="px-6 py-3">Used On</th>
|
||||
<th scope="col" class="px-6 py-3">Used By</th>
|
||||
<th scope="col" class="px-6 py-3">Status</th>
|
||||
<th scope="col" class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a
|
||||
class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
|
||||
<!-- Include the jQuery library -->
|
||||
|
||||
|
||||
<script>
|
||||
$(document).keydown(function(event) {
|
||||
if (event.key === 'Escape') {
|
||||
$('[data-modal]').each(function() {
|
||||
if (!$(this).hasClass('hidden')) {
|
||||
const modalName = $(this).data('modal');
|
||||
closeModal(modalName);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function bankey(key) {
|
||||
var bankey = $('.bankey');
|
||||
bankey.attr('value', key);
|
||||
|
||||
openModal('ban-key-modal');
|
||||
}
|
||||
|
||||
function delkey(key) {
|
||||
var delkey = $('.delkey');
|
||||
delkey.attr('value', key);
|
||||
|
||||
openModal('del-key');
|
||||
}
|
||||
|
||||
function copyToClipboard() {
|
||||
const cardBodyContent = document.getElementById('multi-keys').innerText;
|
||||
|
||||
const formattedContent = cardBodyContent.replace(/<br>/g, '\n');
|
||||
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = formattedContent;
|
||||
|
||||
textarea.style.position = 'fixed';
|
||||
textarea.style.opacity = 0;
|
||||
|
||||
document.body.appendChild(textarea);
|
||||
|
||||
textarea.select();
|
||||
document.execCommand('copy');
|
||||
|
||||
document.body.removeChild(textarea);
|
||||
|
||||
alert('Copied new licenses!');
|
||||
}
|
||||
</script>
|
||||
<!-- END TABLE -->
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if (isset($_POST['delkeys'])) {
|
||||
if ($_SESSION['role'] == "tester") {
|
||||
dashboard\primary\error("Free tester accounts can't delete keys, upgrade your account to delete keys!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
$resp = misc\license\deleteAll();
|
||||
match ($resp) {
|
||||
'failure' => dashboard\primary\error("Didn't find any keys!"),
|
||||
'success' => dashboard\primary\success("Deleted All Keys!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['addtime'])) {
|
||||
$resp = misc\license\addTime($_POST['time'], $_POST['expiry']);
|
||||
match ($resp) {
|
||||
'failure' => dashboard\primary\error("Failed to add time!"),
|
||||
'success' => dashboard\primary\success("Added time to unused licenses!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['deleteallunused'])) {
|
||||
if ($_SESSION['role'] == "tester") {
|
||||
dashboard\primary\error("Free tester accounts can't delete keys, upgrade your account to delete keys!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
$resp = misc\license\deleteAllUnused();
|
||||
match ($resp) {
|
||||
'failure' => dashboard\primary\error("Didn't find any unused keys!"),
|
||||
'success' => dashboard\primary\success("Deleted all unused keys!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['deleteallused'])) {
|
||||
if ($_SESSION['role'] == "tester") {
|
||||
dashboard\primary\error("Free tester accounts can't delete keys, upgrade your account to delete keys!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
$resp = misc\license\deleteAllUsed();
|
||||
match ($resp) {
|
||||
'failure' => dashboard\primary\error("Didn't find any used keys!"),
|
||||
'success' => dashboard\primary\success("Deleted all used keys!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['savekey'])) {
|
||||
$key = misc\etc\sanitize($_POST['savekey']);
|
||||
$level = misc\etc\sanitize($_POST['level']);
|
||||
$duration = misc\etc\sanitize($_POST['duration']);
|
||||
$note = misc\etc\sanitize($_POST['editNote']);
|
||||
if (!empty($duration)) {
|
||||
$expiry = misc\etc\sanitize($_POST['expiry']);
|
||||
$duration = $duration * $expiry;
|
||||
misc\mysql\query("UPDATE `keys` SET `expires` = ? WHERE `key` = ? AND `app` = ?",[$duration, $key, $_SESSION['app']]);
|
||||
}
|
||||
misc\mysql\query("UPDATE `keys` SET `note` = ?, `level` = ? WHERE `key` = ? AND `app` = ?",[$note, $level, $key, $_SESSION['app']]);
|
||||
misc\cache\purge('KeyAuthKey:' . $_SESSION['app'] . ':' . $key);
|
||||
misc\cache\purge('KeyAuthKeys:' . $_SESSION['app']);
|
||||
dashboard\primary\success("Successfully Updated Settings!");
|
||||
}
|
||||
|
||||
if (isset($_POST['importkeysFile'])) {
|
||||
if ($_FILES['file_input']['error'] == UPLOAD_ERR_OK) {
|
||||
$fileContent = file_get_contents($_FILES['file_input']['tmp_name']);
|
||||
$jsonArray = json_decode($fileContent, true);
|
||||
|
||||
if ($jsonArray === null) {
|
||||
dashboard\primary\error("Invalid JSON format!");
|
||||
echo "<meta http-equiv='Refresh' Content='1;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($jsonArray['keys'])) {
|
||||
dashboard\primary\error("Missing 'keys' array in JSON!");
|
||||
echo "<meta http-equiv='Refresh' Content='1;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($jsonArray['tokens'])) {
|
||||
dashboard\primary\error("Missing 'tokens' array in JSON!");
|
||||
echo "<meta http-equiv='Refresh' Content='1;'>";
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($jsonArray['keys'] as $keyData) {
|
||||
$key_format = $keyData['key'];
|
||||
$user_format = $keyData['user'];
|
||||
$note_format = $keyData['note'];
|
||||
$expiry_format = $keyData['expiry'];
|
||||
$status_format = $keyData['status'];
|
||||
$level_format = $keyData['level'];
|
||||
$genby_format = $keyData['genby'];
|
||||
$gendate_format = $keyData['gendate'];
|
||||
$usedon_format = $keyData['usedon'];
|
||||
$banned_format = $keyData['banned'];
|
||||
|
||||
/*if (!isset($key_format) || $key_format == '' || !isset($level_format) || $level_format == '' || !isset($expiry_format) || $expiry_format == '') {
|
||||
dashboard\primary\error("Invalid Format!");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}*/
|
||||
|
||||
misc\mysql\query("INSERT INTO `keys` (`key`, `user`, `note`, `expires`, `status`, `level`, `genby`, `gendate`, `usedon`, `app`, `banned`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", [$key_format, $note_format, $expiry_format, $status_format, $level_format, $genby_format, $gendate_format, $usedon_format, $_SESSION['app'], $bannned_format]);;
|
||||
}
|
||||
|
||||
foreach ($jsonArray['tokens'] as $tokenData){
|
||||
$token = $tokenData['token'];
|
||||
$assigned = $tokenData['assigned'];
|
||||
$banned = $tokenData['banned'];
|
||||
$reason = $tokenData['reason'];
|
||||
$hash = $tokenData['hash'];
|
||||
$type = $tokenData['type'];
|
||||
$status = $tokenData['status'];
|
||||
|
||||
misc\mysql\query("INSERT INTO `tokens` (`token`, `assigned`, `banned`, `reason`, `hash`, `type`, `status`, `app`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", [$token, $assigned, $banned, $reason, $hash, $type, $status, $_SESSION['app']]);
|
||||
}
|
||||
|
||||
dashboard\primary\success("Successfully imported licenses!");
|
||||
} else {
|
||||
dashboard\primary\error("File upload failed!");
|
||||
echo "<meta http-equiv='Refresh' Content='2;'>";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['deletekey'])) {
|
||||
if ($_SESSION['role'] == "tester") {
|
||||
dashboard\primary\error("Free tester accounts can't delete keys, upgrade your account to delete keys!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
$userToo = ($_POST['delUserToo'] == "on") ? 1 : 0;
|
||||
$resp = misc\license\deleteSingular($_POST['deletekey'], $userToo);
|
||||
match ($resp) {
|
||||
'failure' => dashboard\primary\error("Failed to delete license!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted license!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['dlkeys'])) {
|
||||
echo "<meta http-equiv='Refresh' Content='0; url=download-types.php?type=licenses'>";
|
||||
// get all rows, put in text file, download text file, delete text file.
|
||||
}
|
||||
|
||||
if (isset($_POST['bankey'])) {
|
||||
$userToo = ($_POST['banUserToo'] == "on") ? 1 : 0;
|
||||
$resp = misc\license\ban($_POST['bankey'], $_POST['reason'], $userToo);
|
||||
match ($resp) {
|
||||
'failure' => dashboard\primary\error("Failed to ban license!"),
|
||||
'success' => dashboard\primary\success("Successfully banned license!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
8
app/pages/logout.php
Normal file
8
app/pages/logout.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
echo "<meta http-equiv='Refresh' Content='0; url=../../../login/'>";
|
||||
session_destroy();
|
||||
exit();
|
||||
119
app/pages/logs.php
Normal file
119
app/pages/logs.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if($role == "Manager" && !($permissions & 256)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view logs.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page.");
|
||||
die();
|
||||
}
|
||||
if(!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
if (isset($_POST['dellogs'])) {
|
||||
$resp = misc\logging\deleteAll();
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete all logs!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted all logs!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
if (isset($_POST['dllogs'])){
|
||||
echo "<meta http-equiv='Refresh' Content='0; url=download-types.php?type=logs'>";
|
||||
}
|
||||
|
||||
if($_SESSION['role'] == "tester") {
|
||||
$query = misc\mysql\query("SELECT count(*) AS 'numLogs' FROM `logs` WHERE `logapp` = ?",[$_SESSION['app']]);
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
$numLogs = $row["numLogs"];
|
||||
if($numLogs >= 20) {
|
||||
?><div class="alert alert-danger" role="alert">You have hit 20 logs! Upgrade to developer or seller to store
|
||||
more logs.</div><?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Logs</h1>
|
||||
<br>
|
||||
<div id="alert" class="flex items-center p-4 mb-4 text-yellow-500 rounded-lg bg-[#09090d]" role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
The maximum log message length is 275 characters. Logs are automatically deleted after 1 month. If
|
||||
you set Discord webhook at <a
|
||||
href="https://keyauth.cc/app/?page=app-settings">https://keyauth.cc/app/?page=app-settings</a>,
|
||||
logs will go to Discord and not display on our site.
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<form method="POST">
|
||||
<!-- Logs Functions -->
|
||||
<button name="dllogs"
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">
|
||||
<i class="lni lni-download mr-2 mt-1"></i>Export Logs
|
||||
</button>
|
||||
<!-- End Logs Functions -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Delete Logs Functions -->
|
||||
<button type="button"
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-logs-modal" data-modal-target="delete-all-logs-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Logs
|
||||
</button>
|
||||
<!-- End Delete Logs Functions -->
|
||||
</form>
|
||||
<!-- Delete All Logs Modal -->
|
||||
<div id="delete-all-logs-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of
|
||||
your logs. <b>This can
|
||||
NOT be undone</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure
|
||||
you want
|
||||
to
|
||||
delete your logs?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-logs-modal" name="dellogs"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-logs-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Logs Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_logs" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Log Date</th>
|
||||
<th class="px-6 py-3">Log Data</th>
|
||||
<th class="px-6 py-3">Credential</th>
|
||||
<th class="px-6 py-3">Device Name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
690
app/pages/manage-accs.php
Normal file
690
app/pages/manage-accs.php
Normal file
@@ -0,0 +1,690 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if ($_SESSION['role'] == "tester") {
|
||||
dashboard\primary\error("Must have developer or seller plan to create sub-accounts.");
|
||||
die();
|
||||
}
|
||||
|
||||
if (isset($_POST['createacc'])) {
|
||||
$resp = misc\account\addAccount($_POST['username'], $_POST['role'], $_POST['email'], $_POST['pw'], $_POST['keylevels'], $_SESSION['username'], $_POST['app'], $_POST['permissions']);
|
||||
match($resp){
|
||||
'invalid_perms' => dashboard\primary\error("Invalid permission value. You msut have at least one permission flag enabled"),
|
||||
'invalid_role' => dashboard\primary\error("Role options are Manager or Reseller"),
|
||||
'invalid_email' => dashboard\primary\error("No email defined"),
|
||||
'username_taken' => dashboard\primary\error("Username already taken!"),
|
||||
'email_taken' => dashboard\primary\error("Email already taken!"),
|
||||
'failure' => dashboard\primary\error("Failed to add account!"),
|
||||
'success' => dashboard\primary\success("Successfully added account"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
if (isset($_POST['deleteacc'])) {
|
||||
$query = misc\mysql\query("DELETE FROM `accounts` WHERE `owner` = ? AND `username` = ?", [$_SESSION['username'], $_POST['deleteacc']]);
|
||||
if ($query->affected_rows > 0) {
|
||||
dashboard\primary\success("Account Successfully Deleted!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed To Delete Account!");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['deleteacckeys'])){
|
||||
$query = misc\mysql\query("DELETE FROM `keys` WHERE `genby` = ? AND `app` = ?", [$_POST['deleteacckeys'], $secret ?? $_SESSION['app']]);
|
||||
if ($query->affected_rows > 0) {
|
||||
dashboard\primary\success("Successfully deleted all keys generated by this user!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed To Delete Their Generated Keys!");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['deleteaccusers'])){
|
||||
$query = misc\mysql\query("DELETE FROM `users` WHERE `owner` = ? AND `app` = ?", [$_POST['deleteaccusers'], $secret ?? $_SESSION['app']]);
|
||||
if ($query->affected_rows > 0) {
|
||||
dashboard\primary\success("Successfully deleted all users generated by this user!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed To Delete Their Generated Users!");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['deleteresellers'])){
|
||||
$query = misc\mysql\query("DELETE FROM `accounts` WHERE `owner` = ? AND `role` = ?", [$_SESSION['username'], "Reseller"]);
|
||||
if ($query->affected_rows > 0){
|
||||
dashboard\primary\success("All Resellers deleted successfully!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to delete all Resellers!");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['deletemanagers'])){
|
||||
$query = misc\mysql\query("DELETE FROM `accounts` WHERE `owner` = ? AND `role` = ?", [$_SESSION['username'], "Manager"]);
|
||||
if ($query->affected_rows > 0){
|
||||
dashboard\primary\success("All Managers deleted successfully!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to delete all Managers!");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['editacc'])) {
|
||||
$account = misc\etc\sanitize($_POST['editacc']);
|
||||
|
||||
$query = misc\mysql\query("SELECT * FROM `accounts` WHERE `username` = ? AND `owner` = ?", [$_POST['editacc'], $_SESSION['username']]);
|
||||
if ($query->num_rows < 1) {
|
||||
dashboard\primary\error("Account not Found!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
|
||||
$username = $row['username'];
|
||||
$keylevels = $row['keylevels'];
|
||||
$balance = $row["balance"];
|
||||
$balance = explode("|", $balance);
|
||||
|
||||
$day = $balance[0];
|
||||
$week = $balance[1];
|
||||
$month = $balance[2];
|
||||
$threemonth = $balance[3];
|
||||
$sixmonth = $balance[4];
|
||||
$life = $balance[5];
|
||||
$year = $balance[6];
|
||||
|
||||
echo '<!-- Edit Account Modal -->
|
||||
<div id="edit-account-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Edit Account</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="grid grid-cols-2 gap-1">
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="daybalance" name="daybalance"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $day . '" maxlength="3"
|
||||
required>
|
||||
<input type="hidden" id="account" name="account"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $username . '">
|
||||
|
||||
<label for="daybalance"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Day
|
||||
Balance:</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="weekbalance" name="weekbalance"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $week . '" maxlength="3"
|
||||
required>
|
||||
<label for="weekbalance"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Week
|
||||
Balance:</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="monthbalance" name="monthbalance"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $month . '" maxlength="3"
|
||||
required>
|
||||
<label for="monthbalance"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Month
|
||||
Balance:</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="threemonthbalance"
|
||||
name="threemonthbalance"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $threemonth .'"
|
||||
maxlength="3" required>
|
||||
<label for="threemonthbalance"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Three
|
||||
Month Balance:</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="sixmonthbalance"
|
||||
name="sixmonthbalance"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $sixmonth .'"
|
||||
maxlength="3" required>
|
||||
<label for="sixmonthbalance"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Six
|
||||
Month Balance:</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="yearbalance"
|
||||
name="yearbalance"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $year .'"
|
||||
maxlength="3" required>
|
||||
<label for="yearbalance"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">
|
||||
Year Balance:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="lifebalance" name="lifebalance"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $life . '" maxlength="3"
|
||||
required>
|
||||
<label for="lifebalance"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Lifetime
|
||||
Balance:</label>
|
||||
</div>
|
||||
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="keylevels" name="keylevels"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $keylevels .'">
|
||||
<label for="keylevels"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Key
|
||||
Levels:</label>
|
||||
</div>
|
||||
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="email" id="email" name="email"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="email"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">New
|
||||
Email:</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="password" id="pw" name="pw"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="pw"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">New
|
||||
Password:</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="saveacc"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Save
|
||||
Changes</button>
|
||||
<button
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center" onClick="window.location.href=window.location.href">Cancel
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Edit Account Modal -->';
|
||||
}
|
||||
|
||||
if (isset($_POST['saveacc'])) {
|
||||
$account = misc\etc\sanitize($_POST['account']);
|
||||
|
||||
$day = misc\etc\sanitize($_POST['daybalance']);
|
||||
$week = misc\etc\sanitize($_POST['weekbalance']);
|
||||
$month = misc\etc\sanitize($_POST['monthbalance']);
|
||||
$threemonth = misc\etc\sanitize($_POST['threemonthbalance']);
|
||||
$sixmonth = misc\etc\sanitize($_POST['sixmonthbalance']);
|
||||
$year = misc\etc\sanitize($_POST['yearbalance']);
|
||||
$lifetime = misc\etc\sanitize($_POST['lifebalance']);
|
||||
$keylevels = misc\etc\sanitize($_POST['keylevels']) ?? "N/A";
|
||||
|
||||
$email = misc\etc\sanitize($_POST['email']);
|
||||
$pw = misc\etc\sanitize($_POST['pw']);
|
||||
|
||||
if (!empty($email)) {
|
||||
$query = misc\mysql\query("SELECT `username` FROM `accounts` WHERE `email` = SHA1(?)", [$email]);
|
||||
if ($query->num_rows > 0) {
|
||||
dashboard\primary\error("Email already taken!");
|
||||
echo '<meta http-equiv="refresh" content="5">';
|
||||
return;
|
||||
}
|
||||
misc\mysql\query("UPDATE `accounts` SET `email` = SHA1(?) WHERE `username` = ? AND `owner` = ?", [$email, $account, $_SESSION['username']]);
|
||||
}
|
||||
if (!empty($pw)) {
|
||||
$pw = password_hash($pw, PASSWORD_BCRYPT);
|
||||
misc\mysql\query("UPDATE `accounts` SET `password` = ? WHERE `username` = ? AND `owner` = ?", [$pw, $account, $_SESSION['username']]);
|
||||
}
|
||||
|
||||
$balance = "$day|$week|$month|$threemonth|$sixmonth|$lifetime|$year";
|
||||
|
||||
$query = misc\mysql\query("UPDATE `accounts` SET `balance` = ?, `keylevels` = ? WHERE `username` = ? AND `owner` = ?", [$balance, $keylevels, $account, $_SESSION['username']]);
|
||||
if ($query->affected_rows > 0) {
|
||||
dashboard\primary\success("Successfully updated settings!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to update settings " . $life . $day . $week . $threemonth);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Resellers & Managers</h1>
|
||||
<p class="text-xs text-gray-500">Access your Reseller and Manager accounts. <a
|
||||
href="https://keyauthdocs.apidog.io/sellerapi/reseller-manager/create-new-reseller-manager" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Alert Box -->
|
||||
<div id="alert" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
The balance is in Days|Weeks|Months|3Months|6Months|Lifetime|Years
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
<!-- Subscripion Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="create-acc-modal" data-modal-target="create-acc-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i>Create Account
|
||||
</button>
|
||||
<br>
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-resellers-modal" data-modal-target="delete-all-resellers-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Resellers
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-managers-modal" data-modal-target="delete-all-managers-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Managers
|
||||
</button>
|
||||
<!-- End Subscription Functions -->
|
||||
|
||||
<!-- Create Acc Modal -->
|
||||
<div id="create-acc-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Create Reseller or Manager
|
||||
Account</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<select id="role" name="role"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"
|
||||
onchange="handleSelectChange(this.value)">
|
||||
<option value="Reseller">
|
||||
Reseller
|
||||
</option>
|
||||
<option value="Manager">
|
||||
Manager
|
||||
</option>
|
||||
</select>
|
||||
<label for="role"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Account
|
||||
Type</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="app" name="app"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT * FROM `apps` WHERE `owner` = ? AND `ownerid` = ?",[$_SESSION['username'], $_SESSION['ownerid']]);
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
echo " <option value=\"" . $row["name"] . "\">" . $row["name"] . "</option>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
<label for="app"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Assigned
|
||||
Application</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="username" name="username"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder="" autocomplete="on" required>
|
||||
<label for="username"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Assign
|
||||
Username</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="email" id="email" name="email"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder="" autocomplete="on" required>
|
||||
<label for="email"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Assign
|
||||
Email</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="password" id="pw" name="pw"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder="" autocomplete="on" required>
|
||||
<label for="pw"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Assign
|
||||
Password</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="keylevels" name="keylevels"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="keylevels"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Assign
|
||||
License Levels</label>
|
||||
</div>
|
||||
|
||||
<div id="permDiv" hidden>
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">What pages can this
|
||||
Manager access?</h3>
|
||||
<div class="grid grid-cols-3 gap-4">
|
||||
<div class="flex items-center">
|
||||
<input id="licenses" name="licenses" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="licenses"
|
||||
class="ml-2 text-sm font-medium text-white-900">Licenses</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="users" name="users" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="users"
|
||||
class="ml-2 text-sm font-medium text-white-900">Users</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="tokens" name="tokens" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="tokens"
|
||||
class="ml-2 text-sm font-medium text-white-900">Tokens</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="subscriptions" name="subscriptions" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="subscriptions"
|
||||
class="ml-2 text-sm font-medium text-white-900">Subscriptions</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="chats" name="chats" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="chats"
|
||||
class="ml-2 text-sm font-medium text-white-900">Chats</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="sessions" name="sessions" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="sessions"
|
||||
class="ml-2 text-sm font-medium text-white-900">Sessions</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="files" name="files" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="files"
|
||||
class="ml-2 text-sm font-medium text-white-900">Files</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="vars" name="vars" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="vars"
|
||||
class="ml-2 text-sm font-medium text-white-900">Variables</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="logs" name="logs" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="logs"
|
||||
class="ml-2 text-sm font-medium text-white-900">Logs</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="blacklists" name="blacklists" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="blacklists"
|
||||
class="ml-2 text-sm font-medium text-white-900">Blacklists</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="whitelists" name="whitelists" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="whitelists"
|
||||
class="ml-2 text-sm font-medium text-white-900">Whitelists</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input id="appSettings" name="appSettings" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2">
|
||||
<label for="appSettings"
|
||||
class="ml-2 text-sm font-medium text-white-900">App
|
||||
Settings</label>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="permissionsLabel" class="mt-4 text-white-900 mb-2">Permissions
|
||||
Code For Seller API:
|
||||
<a class="mt-4 text-blue-900">0</a>
|
||||
</div>
|
||||
</div>
|
||||
<button name="createacc"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Create
|
||||
Account</button>
|
||||
<input type="hidden" id="permissions" name="permissions" value="2047">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Create Reseller/Manager Modal -->
|
||||
|
||||
<!-- Delete All Resellers Modal -->
|
||||
<div id="delete-all-resellers-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
resellers! This can not be undone!
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your resellers?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-resellers-modal" name="deleteresellers"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-resellers-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Resellers Modal -->
|
||||
|
||||
<!-- Delete All Managers Modal -->
|
||||
<div id="delete-all-managers-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
managers! This can not be undone!
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your managers?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-managers-modal" name="deletemanagers"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-managers-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Managers Modal -->
|
||||
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_manageaccs" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Username</th>
|
||||
<th class="px-6 py-3">Role</th>
|
||||
<th class="px-6 py-3">Application</th>
|
||||
<th class="px-6 py-3">Balance</th>
|
||||
<th class="px-6 py-3">Allowed Levels</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT * FROM `accounts` WHERE `owner` = ?", [$_SESSION['username']]);
|
||||
if ($query->num_rows > 0){
|
||||
while ($row = mysqli_fetch_array($query->result)){
|
||||
echo "<tr>";
|
||||
echo "<td>" . $row["username"] . "</td>";
|
||||
echo "<td>" . $row["role"] . "</td>";
|
||||
echo "<td>" . $row["app"] . "</td>";
|
||||
|
||||
if ($row["roles"] == "Manager"){
|
||||
echo "<td>N/A</td>";
|
||||
} else {
|
||||
echo "<td>" . $row["balance"] . "</td>";
|
||||
}
|
||||
echo "<td>" . $row["keylevels"] . "</td>";
|
||||
|
||||
echo '<form method="POST">
|
||||
<td>
|
||||
<div x-data="{ open: false }" class="z-0">
|
||||
<button x-on:click="open = true" class="flex items-center border border-gray-700 rounded-lg focus:opacity-60 text-white focus:text-white font-semibold rounded focus:outline-none focus:shadow-inner py-2 px-4" type="button">
|
||||
<span class="mr-1">Actions</span>
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" style="margin-top:3px">
|
||||
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<ul x-show="open" x-on:click.away="open = false" class="bg-[#09090d] text-white rounded shadow-lg absolute py-2 mt-1" style="min-width:15rem">
|
||||
<li>
|
||||
<button name="deleteacc" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="' . $row['username'] . '">
|
||||
Delete Account
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button name="deleteacckeys" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="' . $row['username'] . '">
|
||||
Delete Their Created Keys
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button name="deleteaccusers" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="' . $row['username'] . '">
|
||||
Delete Their Created Users
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button name="editacc" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-blue-700"
|
||||
value="' . $row['username'] . '">
|
||||
Edit Account
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td></tr></form>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a
|
||||
class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
|
||||
<!-- Include the jQuery library -->
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function handleSelectChange(value) {
|
||||
let element = document.getElementById("permDiv");
|
||||
if (value == "Manager") {
|
||||
element.removeAttribute("hidden");
|
||||
} else {
|
||||
element.setAttribute("hidden", "hidden");
|
||||
}
|
||||
}
|
||||
// credits https://discordapi.com/permissions.html
|
||||
var perms = {
|
||||
licenses: 1,
|
||||
users: 2,
|
||||
subscriptions: 4,
|
||||
chats: 8,
|
||||
sessions: 16,
|
||||
webhooks: 32,
|
||||
files: 64,
|
||||
vars: 128,
|
||||
logs: 256,
|
||||
blacklists: 512,
|
||||
appSettings: 1024,
|
||||
tokens: 2048,
|
||||
whitelists: 4096
|
||||
}
|
||||
|
||||
// Function to recalculate and update permissions
|
||||
function recalculate() {
|
||||
var totalPermissions = 0;
|
||||
|
||||
for (var s in perms) {
|
||||
var checkbox = document.getElementById(s);
|
||||
if (checkbox && checkbox.checked) {
|
||||
totalPermissions += perms[s];
|
||||
}
|
||||
}
|
||||
|
||||
// Update the label with the calculated totalPermissions
|
||||
var permissionsLabel = document.getElementById("permissionsLabel");
|
||||
if (permissionsLabel) {
|
||||
permissionsLabel.textContent = "Permissions Code For Seller API: " + totalPermissions;
|
||||
}
|
||||
// Update other elements as needed
|
||||
document.getElementById("permissions").value = totalPermissions;
|
||||
document.getElementById("permissionsSeller").textContent = totalPermissions;
|
||||
console.log(totalPermissions);
|
||||
}
|
||||
|
||||
// Add event listeners to all checkboxes
|
||||
var checkboxes = document.querySelectorAll('input[type="checkbox"]');
|
||||
checkboxes.forEach(function(checkbox) {
|
||||
checkbox.addEventListener('change', recalculate);
|
||||
});
|
||||
</script>
|
||||
1245
app/pages/manage-apps.php
Normal file
1245
app/pages/manage-apps.php
Normal file
File diff suppressed because it is too large
Load Diff
268
app/pages/reseller-balance.php
Normal file
268
app/pages/reseller-balance.php
Normal file
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
if ($_SESSION["role"] != 'Reseller'){
|
||||
dashboard\primary\error("Only resellers can access this page.");
|
||||
die();
|
||||
}
|
||||
?>
|
||||
|
||||
<script src="https://shoppy.gg/api/embed.js"></script>
|
||||
|
||||
<script src="https://cdn.sellix.io/static/js/embed.js"></script>
|
||||
|
||||
<link href="https://cdn.sellix.io/static/css/embed.css" rel="stylesheet" />
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 lang class="text-xl font-semibold text-white-900 sm:text-2xl">Reseller Balance</h1>
|
||||
<p class="text-xs text-gray-500">Check your balance here.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT * FROM `apps` WHERE `secret` = ?",[$_SESSION['app']]);
|
||||
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
|
||||
if ($row["sellappsecret"] != NULL) {
|
||||
|
||||
if ($row["sellappdayproduct"] != NULL) {
|
||||
$dayproduct_holder = '<a href="' . $row["sellappdayproduct"] . $_SESSION['username'] . '" target="_blank">
|
||||
<p class="text-sm text-yellow-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Day Keys (SellApp)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $dayproduct_holder = "N/A"; }
|
||||
|
||||
if ($row["sellappweekproduct"] != NULL) {
|
||||
$weekproduct_holder = '<a href="' . $row["sellappweekproduct"] . $_SESSION['username'] . '" target="_blank">
|
||||
<p class="text-sm text-yellow-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Week Keys (SellApp)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $weekproduct_holder = "N/A"; }
|
||||
|
||||
if ($row["sellappmonthproduct"] != NULL) {
|
||||
$monthproduct_holder = '<a href="' . $row["sellappmonthproduct"] . $_SESSION['username'] . '" target="_blank">
|
||||
<p class="text-sm text-yellow-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Month Keys (SellApp)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $monthproduct_holder = "N/A"; }
|
||||
|
||||
if ($row["sellapplifetimeproduct"] != NULL) {
|
||||
$lifetimeproduct_holder = '<a href="' . $row["sellapplifetimeproduct"] . $_SESSION['username'] . '" target="_blank">
|
||||
<p class="text-sm text-yellow-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Lifetime Keys (SellApp)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $lifetimeproduct_holder = "N/A"; }
|
||||
}
|
||||
|
||||
if ($row["sellixsecret"] != NULL) {
|
||||
|
||||
if ($row["sellixdayproduct"] != NULL) {
|
||||
$dayproduct_holder = '<a data-sellix-product="' . $row["sellixdayproduct"] . '" data-sellix-custom-Username=' . $_SESSION['username'] . '">
|
||||
<p class="text-sm text-purple-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Day Keys (Sellix)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $dayproduct_holder = "N/A"; }
|
||||
|
||||
if ($row["sellixweekproduct"] != NULL) {
|
||||
$weekproduct_holder = '<a data-sellix-product="' . $row["sellixweekproduct"] . '" data-sellix-custom-Username=' . $_SESSION['username'] . '">
|
||||
<p class="text-sm text-purple-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Week Keys (Sellix)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $weekproduct_holder = "N/A"; }
|
||||
|
||||
if ($row["sellixmonthproduct"] != NULL) {
|
||||
$monthproduct_holder = '<a data-sellix-product="' . $row["sellixmonthproduct"] . '" data-sellix-custom-Username=' . $_SESSION['username'] . '">
|
||||
<p class="text-sm text-purple-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Month Keys (Sellix)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $monthproduct_holder = "N/A"; }
|
||||
|
||||
if ($row["sellixlifetimeproduct"] != NULL) {
|
||||
$lifetimeproduct_holder = '<a data-sellix-product="' . $row["sellixlifetimeproduct"] . '" data-sellix-custom-Username=' . $_SESSION['username'] . '">
|
||||
<p class="text-sm text-purple-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Lifetime Keys (Sellix)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $lifetimeproduct_holder = "N/A"; }
|
||||
}
|
||||
|
||||
if ($row["shoppysecret"] != NULL) {
|
||||
|
||||
if ($row["shoppydayproduct"] != NULL) {
|
||||
$dayproduct_holder = '<a data-shoppy-product="' . $row["shoppydayproduct"] . '" data-shoppy-username=' . $_SESSION['username'] . '">
|
||||
<p class="text-sm text-green-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Day Keys (Shoppy)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $dayproduct_holder = "N/A"; }
|
||||
|
||||
if ($row["shoppyweekproduct"] != NULL) {
|
||||
$weekproduct_holder = '<a data-shoppy-product="' . $row["shoppyweekproduct"] . '" data-shoppy-username=' . $_SESSION['username'] . '">
|
||||
<p class="text-sm text-green-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Week Keys (Shoppy)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $weekproduct_holder = "N/A"; }
|
||||
|
||||
if ($row["shoppymonthproduct"] != NULL) {
|
||||
$monthproduct_holder = '<a data-shoppy-product="' . $row["shoppymonthproduct"] . '" data-shoppy-username=' . $_SESSION['username'] . '">
|
||||
<p class="text-sm text-green-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Month Keys (Shoppy)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $monthproduct_holder = "N/A"; }
|
||||
|
||||
if ($row["shoppylifetimeproduct"] != NULL) {
|
||||
$lifetimeproduct_holder = '<a data-shoppy-product="' . $row["shoppylifetimeproduct"] . '" data-shoppy-username=' . $_SESSION['username'] . '">
|
||||
<p class="text-sm text-green-700 hover:underline transition duration-200 cursor-pointer">
|
||||
<b>Purchase Lifetime Keys (Shoppy)</b>
|
||||
</p>
|
||||
</a>';
|
||||
} else { $lifetimeproduct_holder = "N/A"; }
|
||||
}
|
||||
|
||||
|
||||
if ($row["resellerstore"] != NULL) {
|
||||
echo '<a href="' . $row["resellerstore"] . '" target="resellerstore">
|
||||
<button class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">
|
||||
<i class="lni lni-money-protection mr-2 mt-1"></i>Purchase Lifetime Keys (General Store)
|
||||
</button>
|
||||
</a>';
|
||||
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT `balance` FROM `accounts` WHERE `username` = ?",[$_SESSION['username']]);
|
||||
|
||||
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
|
||||
|
||||
$balance = $row["balance"];
|
||||
|
||||
|
||||
$balance = explode("|", $balance);
|
||||
|
||||
|
||||
$day = $balance[0];
|
||||
|
||||
$week = $balance[1];
|
||||
|
||||
$month = $balance[2];
|
||||
|
||||
$threemonth = $balance[3];
|
||||
|
||||
$sixmonth = $balance[4];
|
||||
|
||||
$life = $balance[5];
|
||||
|
||||
$year = $balance[6];
|
||||
|
||||
echo '<br><br>
|
||||
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg">
|
||||
<table class="w-full text-sm text-left text-gray-500">
|
||||
<thead class="text-xs text-blue-700 uppercase">
|
||||
<tr>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Duration
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Amount
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3">
|
||||
Restock
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="border-b bg-[#0f0f17]">
|
||||
<th scope="row" class="px-6 py-4 font-medium text-white whitespace-nowrap">
|
||||
Day
|
||||
</th>
|
||||
<td class="px-6 py-4 text-white">
|
||||
' . $day . '
|
||||
</td>
|
||||
<td class="px-6 py-4 text-white">
|
||||
<p>' . $dayproduct_holder . '</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b bg-[#0f0f17]">
|
||||
<th scope="row" class="px-6 py-4 font-medium text-white whitespace-nowrap">
|
||||
Week
|
||||
</th>
|
||||
<td class="px-6 py-4 text-white">
|
||||
' . $week . '
|
||||
</td>
|
||||
<td class="px-6 py-4 text-white">
|
||||
<p>' . $weekproduct_holder . '</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b bg-[#0f0f17]">
|
||||
<th scope="row" class="px-6 py-4 font-medium text-white whitespace-nowrap">
|
||||
Month
|
||||
</th>
|
||||
<td class="px-6 py-4 text-white">
|
||||
' . $month . '
|
||||
</td>
|
||||
<td class="px-6 py-4 text-white">
|
||||
<p>' . $monthproduct_holder . '</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b bg-[#0f0f17]">
|
||||
<th scope="row" class="px-6 py-4 font-medium text-white whitespace-nowrap">
|
||||
Three Month
|
||||
</th>
|
||||
<td class="px-6 py-4 text-white">
|
||||
' . $threemonth . '
|
||||
</td>
|
||||
<td class="px-6 py-4 text-white">
|
||||
<p>N/A</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b bg-[#0f0f17]">
|
||||
<th scope="row" class="px-6 py-4 font-medium text-white whitespace-nowrap">
|
||||
Six Month
|
||||
</th>
|
||||
<td class="px-6 py-4 text-white">
|
||||
' . $sixmonth . '
|
||||
</td>
|
||||
<td class="px-6 py-4 text-white">
|
||||
<p>N/A</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b bg-[#0f0f17]">
|
||||
<th scope="row" class="px-6 py-4 font-medium text-white whitespace-nowrap">
|
||||
Year
|
||||
</th>
|
||||
<td class="px-6 py-4 text-white">
|
||||
' . $year . '
|
||||
</td>
|
||||
<td class="px-6 py-4 text-white">
|
||||
<p>N/A</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="border-b bg-[#0f0f17]">
|
||||
<th scope="row" class="px-6 py-4 font-medium text-white whitespace-nowrap">
|
||||
Lifetime
|
||||
</th>
|
||||
<td class="px-6 py-4 text-white">
|
||||
' . $life . '
|
||||
</td>
|
||||
<td class="px-6 py-4 text-white">
|
||||
<p>' . $lifetimeproduct_holder . '</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
';
|
||||
?>
|
||||
430
app/pages/reseller-licenses.php
Normal file
430
app/pages/reseller-licenses.php
Normal file
@@ -0,0 +1,430 @@
|
||||
<?php
|
||||
if ($_SESSION["role"] != 'Reseller'){
|
||||
dashboard\primary\error("Only resellers can access this page.");
|
||||
die();
|
||||
}
|
||||
|
||||
$query = misc\mysql\query("SELECT `keylevels` FROM `accounts` WHERE `username` = ?",[$_SESSION['username']]);
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
$keylevels = $row['keylevels'];
|
||||
|
||||
if (isset($_SESSION['keys_array'])) {
|
||||
$list = $_SESSION['keys_array'];
|
||||
$keys = NULL;
|
||||
for ($i = 0; $i < count($list); $i++) {
|
||||
$keys .= "" . $list[$i] . "<br>";
|
||||
}
|
||||
echo "<div class=\"card\"> <div class=\"card-body\" id=\"multi-keys\"> $keys </div> </div> <br>";
|
||||
echo "<button onclick=\"copyToClipboard()\" class=\"inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200\">Copy new license(s)</button>";
|
||||
unset($_SESSION['keys_array']);
|
||||
}
|
||||
if (isset($_POST['genkeys'])) {
|
||||
$key = misc\license\createLicense($_POST['amount'], $_POST['mask'], 1, $_POST['level'], $_POST['note'], $_POST['expiry']);
|
||||
switch ($key) {
|
||||
case 'max_keys':
|
||||
dashboard\primary\error("You can only generate 100 licenses at a time");
|
||||
break;
|
||||
case 'no_negative':
|
||||
dashboard\primary\error("Amount can't be negative!");
|
||||
break;
|
||||
case 'unauthed_level':
|
||||
dashboard\primary\error("Not authorized to make licenses with that level!");
|
||||
break;
|
||||
case 'invalid_exp':
|
||||
dashboard\primary\error("Invalid expiry!");
|
||||
break;
|
||||
case 'insufficient_balance':
|
||||
dashboard\primary\error("Not enough balance to create license(s)");
|
||||
break;
|
||||
case 'dupe_custom_key':
|
||||
dashboard\primary\error("Can't do custom key with amount greater than one");
|
||||
break;
|
||||
default:
|
||||
if (misc\etc\sanitize($_POST['amount']) > 1) {
|
||||
$_SESSION['keys_array'] = $key;
|
||||
echo "<meta http-equiv='Refresh' Content='0;'>";
|
||||
} else {
|
||||
echo "<script>navigator.clipboard.writeText('" . array_values($key)[0] . "');</script>";
|
||||
dashboard\primary\success("License Created And Copied To Clipboard!");
|
||||
misc\auditLog\send("Created a new license");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['deletekey'])) {
|
||||
$userToo = ($_POST['delUserToo'] == "on") ? 1 : 0;
|
||||
$resp = misc\license\deleteSingular($_POST['deletekey'], $userToo);
|
||||
switch ($resp) {
|
||||
case 'failure':
|
||||
dashboard\primary\error("Failed to delete license!");
|
||||
break;
|
||||
case 'nope':
|
||||
misc\auditLog\send("Attempted (and failed) to delete license he doesn't own " . $_POST['deletekey']);
|
||||
dashboard\primary\error("Nope, nice try!");
|
||||
break;
|
||||
case 'success':
|
||||
misc\auditLog\send("Deleted license key " . $_POST['deletekey']);
|
||||
dashboard\primary\success("Successfully deleted license!");
|
||||
break;
|
||||
default:
|
||||
dashboard\primary\error("Unhandled Error! Contact us if you need help");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isset($_POST['bankey'])) {
|
||||
$userToo = ($_POST['banUserToo'] == "on") ? 1 : 0;
|
||||
$resp = misc\license\ban($_POST['bankey'], $_POST['reason'], $userToo);
|
||||
switch ($resp) {
|
||||
case 'failure':
|
||||
dashboard\primary\error("Failed to ban license!");
|
||||
break;
|
||||
case 'nope':
|
||||
misc\auditLog\send("Attempted (and failed) to ban license he doesn't own " . $_POST['bankey']);
|
||||
dashboard\primary\error("Nope, nice try!");
|
||||
break;
|
||||
case 'success':
|
||||
misc\auditLog\send("Banned license key " . $_POST['bankey']);
|
||||
dashboard\primary\success("Successfully banned license!");
|
||||
break;
|
||||
default:
|
||||
dashboard\primary\error("Unhandled Error! Contact us if you need help");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isset($_POST['unbankey'])) {
|
||||
$resp = misc\license\unban($_POST['unbankey']);
|
||||
switch ($resp) {
|
||||
case 'failure':
|
||||
dashboard\primary\error("Failed to unban license!");
|
||||
break;
|
||||
case 'nope':
|
||||
misc\auditLog\send("Attempted (and failed) to unban license he doesn't own " . $_POST['unbankey']);
|
||||
dashboard\primary\error("Nope, nice try!");
|
||||
break;
|
||||
case 'success':
|
||||
misc\auditLog\send("Unbanned license key " . $_POST['unbankey']);
|
||||
dashboard\primary\success("Successfully unbanned license!");
|
||||
break;
|
||||
default:
|
||||
dashboard\primary\error("Unhandled Error! Contact us if you need help");
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 lang class="text-xl font-semibold text-white-900 sm:text-2xl">Reseller Licenses</h1>
|
||||
<p class="text-xs text-gray-500">Manage your licenses here.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
|
||||
<button type="button"
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="create-key-modal" data-modal-target="create-key-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i> Create Keys
|
||||
</button>
|
||||
|
||||
<!-- Create Key Modal -->
|
||||
<div id="create-key-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT `format`, `amount`, `lvl`, `note`, `duration`, `unit` FROM `apps` WHERE `secret` = ?",[$_SESSION['app']]);
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
|
||||
$format = $row['format'];
|
||||
$amt = $row['amount'];
|
||||
$lvl = $row['lvl'];
|
||||
$note = $row['note'];
|
||||
$dur = $row['duration'];
|
||||
$unit = $row['unit'];
|
||||
?>
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Create A New Key</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" min="1" max="100" id="amount"
|
||||
name="amount"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
autocomplete="on" required>
|
||||
<label for="amount"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">License
|
||||
Amount</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" maxlength="49" id="mask" name="mask"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder="*****-*****-*****-*****" autocomplete="on"
|
||||
value="*****-*****-*****-*****" required>
|
||||
<label for="mask"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">License
|
||||
Mask</label>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center mb-4">
|
||||
<input id="lowercaseLetters" name="lowercaseLetters" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked>
|
||||
<label for="lowercaseLetters"
|
||||
class="ml-2 text-sm font-medium text-white-900">Include
|
||||
Lowercase Letters</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input checked id="checked-checkbox" name="capitalLetters" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked>
|
||||
<label for="checked-checkbox"
|
||||
class="ml-2 text-sm font-medium text-white-900">Include
|
||||
Uppercase Letters</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4 pt-3">
|
||||
<select id="level" name="level"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<?php
|
||||
|
||||
if ($keylevels != "N/A") {
|
||||
|
||||
$keylevels = explode("|", $keylevels);
|
||||
|
||||
|
||||
|
||||
foreach ($keylevels as $levels) {
|
||||
?>
|
||||
<option value="<?= $levels; ?>"><?= $levels; ?>
|
||||
</option>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
$query = misc\mysql\query("SELECT DISTINCT `level` FROM `subscriptions` WHERE `app` = ? ORDER BY `level` ASC",[$_SESSION['app']]);
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
|
||||
$queryName = misc\mysql\query("SELECT `name` FROM `subscriptions` WHERE `level` = ? AND `app` = ?",[$row["level"], $_SESSION['app']]);
|
||||
|
||||
$name = " (";
|
||||
$count = 0;
|
||||
while ($rowSubs = mysqli_fetch_array($queryName->result)) {
|
||||
$count++;
|
||||
if($count > 1) {
|
||||
$name .= ", " . $rowSubs["name"];
|
||||
}
|
||||
else {
|
||||
$name .= $rowSubs["name"];
|
||||
}
|
||||
}
|
||||
$name .= ")";
|
||||
|
||||
?>
|
||||
<option value="<?= $row["level"]; ?>">
|
||||
<?= $row["level"] . $name; ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" maxlength="69" id="note" name="note"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="note"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">License
|
||||
Note</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<select id="expiry" name="expiry"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value="1 Day">
|
||||
1 Day
|
||||
</option>
|
||||
<option value="1 Week">
|
||||
1 Week
|
||||
</option>
|
||||
<option value="1 Month">
|
||||
1 Month
|
||||
</option>
|
||||
<option value="3 Month">
|
||||
3 Months
|
||||
</option>
|
||||
<option value="6 Month">
|
||||
6 Months
|
||||
</option>
|
||||
<option value="1 Year">
|
||||
1 Year
|
||||
</option>
|
||||
<option value="1 Lifetime">
|
||||
Lifetime
|
||||
</option>
|
||||
</select>
|
||||
<label for="expiry"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">License
|
||||
Expiry Unit</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" name="genkeys"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Generate
|
||||
Keys</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Create Key Modal -->
|
||||
|
||||
<!-- Ban License Modal Actions-->
|
||||
<div id="ban-key-modal" tabindex="-1"
|
||||
class="modal fixed inset-0 flex items-center justify-center z-50 hidden">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-red-800 border border-red-700 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium text-red-400">Notice! This will not ban the user
|
||||
(prevent them from logging in) unless you check Ban User Too</b></span>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to ban this
|
||||
license?
|
||||
<form method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="reason" name="reason"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer focus:border-red-700"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="reason"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Ban
|
||||
Reason</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center mb-4">
|
||||
<input id="banUserToo" name="banUserToo" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked>
|
||||
<label for="banUserToo"
|
||||
class="ml-2 text-sm font-medium text-white-900">Ban User
|
||||
Too?</label>
|
||||
</div>
|
||||
<button name="bankey"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2 bankey">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button type="button" onclick="closeModal('ban-key-modal')"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Ban License Modal Actions-->
|
||||
|
||||
<!-- Delete Key Modal -->
|
||||
<div id="del-key" tabindex="-1"
|
||||
class="modal fixed inset-0 flex items-center justify-center z-50 hidden">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> This will not delete the user
|
||||
(prevent them from logging in) unless you check Delete User Too
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
this key? This can not be undone.</h3>
|
||||
<div class="flex items-center mb-4">
|
||||
<input id="lowercaseLetters" name="lowercaseLetters" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked>
|
||||
<label for="lowercaseLetters"
|
||||
class="ml-2 text-sm font-medium text-white-900">Delete user too</label>
|
||||
</div>
|
||||
<form method="POST">
|
||||
<button name="deletekey"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2 delkey">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button type="button" onclick="closeModal('del-key')"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Unused Keys Modal -->
|
||||
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_reseller_licenses" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Key</th>
|
||||
<th class="px-6 py-3">Creation Date</th>
|
||||
<th class="px-6 py-3">Duration</th>
|
||||
<th class="px-6 py-3">Note</th>
|
||||
<th class="px-6 py-3">Used On</th>
|
||||
<th class="px-6 py-3">Used By</th>
|
||||
<th class="px-6 py-3">Status</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a
|
||||
class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
<script>
|
||||
function bankey(key) {
|
||||
var bankey = $('.bankey');
|
||||
bankey.attr('value', key);
|
||||
|
||||
openModal('ban-key-modal');
|
||||
}
|
||||
|
||||
function delkey(key) {
|
||||
var delkey = $('.delkey');
|
||||
delkey.attr('value', key);
|
||||
|
||||
openModal('del-key');
|
||||
}
|
||||
|
||||
function copyToClipboard() {
|
||||
const cardBodyContent = document.getElementById('multi-keys').innerText;
|
||||
|
||||
const formattedContent = cardBodyContent.replace(/<br>/g, '\n');
|
||||
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = formattedContent;
|
||||
|
||||
textarea.style.position = 'fixed';
|
||||
textarea.style.opacity = 0;
|
||||
|
||||
document.body.appendChild(textarea);
|
||||
|
||||
textarea.select();
|
||||
document.execCommand('copy');
|
||||
|
||||
document.body.removeChild(textarea);
|
||||
|
||||
alert('Copied new licenses!');
|
||||
}
|
||||
</script>
|
||||
394
app/pages/reseller-users.php
Normal file
394
app/pages/reseller-users.php
Normal file
@@ -0,0 +1,394 @@
|
||||
<?php
|
||||
if ($_SESSION["role"] != 'Reseller'){
|
||||
dashboard\primary\error("Only resellers can access this page.");
|
||||
die();
|
||||
}
|
||||
|
||||
if (isset($_POST['deleteuser'])) {
|
||||
$resp = misc\user\deleteSingular($_POST['deleteuser']);
|
||||
switch($resp) {
|
||||
case 'nope':
|
||||
misc\auditLog\send("Attempted (and failed) to delete user he doesn't own " . $_POST['deleteuser']);
|
||||
dashboard\primary\error("You don't own this user!");
|
||||
break;
|
||||
case 'success':
|
||||
misc\auditLog\send("Deleted user " . $_POST['deleteuser']);
|
||||
dashboard\primary\success("User Successfully Deleted!");
|
||||
break;
|
||||
case 'failure':
|
||||
dashboard\primary\error("Failed To Delete User!");
|
||||
break;
|
||||
default:
|
||||
dashboard\primary\error("Unhandled Error! Contact us if you need help");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isset($_POST['resetuser'])) {
|
||||
$resp = misc\user\resetSingular($_POST['resetuser']);
|
||||
switch($resp) {
|
||||
case 'nope':
|
||||
misc\auditLog\send("Attempted (and failed) to reset HWID of user he doesn't own " . $_POST['resetuser']);
|
||||
dashboard\primary\error("You don't own this user!");
|
||||
break;
|
||||
case 'success':
|
||||
misc\auditLog\send("Reset HWID for user " . $_POST['resetuser']);
|
||||
dashboard\primary\success("User Successfully Reset!");
|
||||
break;
|
||||
case 'failure':
|
||||
misc\auditLog\send("Attempted (and failed) to reset a user");
|
||||
dashboard\primary\error("Failed To Reset User!");
|
||||
break;
|
||||
default:
|
||||
dashboard\primary\error("Unhandled Error! Contact us if you need help");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isset($_POST['banuser'])) {
|
||||
$resp = misc\user\ban($_POST['un'], $_POST['reason']);
|
||||
switch($resp) {
|
||||
case 'nope':
|
||||
misc\auditLog\send("Attempted (and failed) to ban user he doesn't own " . $_POST['banuser']);
|
||||
dashboard\primary\error("You don't own this user!");
|
||||
break;
|
||||
case 'missing':
|
||||
dashboard\primary\error("User not Found!");
|
||||
break;
|
||||
case 'success':
|
||||
misc\auditLog\send("Banned user " . $_POST['banuser']);
|
||||
dashboard\primary\success("User Successfully Banned!");
|
||||
break;
|
||||
case 'failure':
|
||||
misc\auditLog\send("Attempted (and failed) to ban a user");
|
||||
dashboard\primary\error("Failed To Ban User!");
|
||||
break;
|
||||
default:
|
||||
dashboard\primary\error("Unhandled Error! Contact us if you need help");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['edituser'])) {
|
||||
$un = misc\etc\sanitize($_POST['edituser']);
|
||||
$query = misc\mysql\query("SELECT * FROM `users` WHERE `username` = ? AND `app` = ? AND `owner` = ?",[$un, $_SESSION['app'], $_SESSION['username']]);
|
||||
if ($query->num_rows < 1) {
|
||||
dashboard\primary\error("User not Found!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
?>
|
||||
<!-- Edit User Modal -->
|
||||
<div id="edit-user-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Edit User</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="password" id="pass" name="pass"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="pass"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Password:</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4 pt-3">
|
||||
<select id="sub" name="sub"
|
||||
class="bg-[#0f0f17] border border-gray-700 text-white-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT * FROM `subs` WHERE `user` = ? AND `app` = ? AND `expiry` > ?",[$un, $_SESSION['app'], time()]);
|
||||
$rows = array();
|
||||
while ($r = mysqli_fetch_assoc($query->result)) {
|
||||
$rows[] = $r;
|
||||
}
|
||||
foreach ($rows as $subrow) {
|
||||
$sub = $subrow['subscription'];
|
||||
$value = "[" . $subrow['subscription'] . "] - Expires: <script>document.write(convertTimestamp(" . $subrow["expiry"] . "));</script>";
|
||||
?>
|
||||
<option value="<?= $sub; ?>"><?= $value; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<label for="sub"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">User
|
||||
Subscription</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="hwid" name="hwid"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" ">
|
||||
<label for="hwid"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Additional
|
||||
HWID:</label>
|
||||
</div>
|
||||
|
||||
<p class="text-xs text-white-500">HWID: <?= $row['hwid'] ?? "N/A"; ?>
|
||||
</p>
|
||||
<p class="text-xs text-white-500">IP: <?= $row['ip']?? "N/A";?></p>
|
||||
|
||||
</div>
|
||||
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;">
|
||||
|
||||
<button name="deletesub"
|
||||
class="w-full text-white bg-orange-700 hover:bg-orange-800 focus:ring-4 focus:outline-none focus:ring-orange-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"
|
||||
value="<?= $un; ?>">Delete Subscription</button>
|
||||
|
||||
<button name="saveuser"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"
|
||||
value="<?= $un; ?>">Save Changes</button>
|
||||
|
||||
<button
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"
|
||||
onClick="window.location.href=window.location.href">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Edit User Modal -->
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['saveuser'])) {
|
||||
$un = misc\etc\sanitize($_POST['saveuser']);
|
||||
|
||||
$hwid = misc\etc\sanitize($_POST['hwid']);
|
||||
|
||||
$pass = misc\etc\sanitize($_POST['pass']);
|
||||
|
||||
if (isset($hwid) && trim($hwid) != '') {
|
||||
$query = misc\mysql\query("SELECT `hwid` FROM `users` WHERE `username` = ? AND `app` = ? AND `owner` = ?",[$un, $_SESSION['app'], $_SESSION['username']]);
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
$oldHwid = $row["hwid"];
|
||||
|
||||
$oldHwid = $oldHwid .= $hwid;
|
||||
|
||||
misc\mysql\query("UPDATE `users` SET `hwid` = ? WHERE `username` = ? AND `app` = ? AND `owner` = ?",[$oldHwid, $un, $_SESSION['app'], $_SESSION['username']]);
|
||||
}
|
||||
|
||||
if (isset($pass) && trim($pass) != '') {
|
||||
misc\mysql\query("UPDATE `users` SET `password` = ? WHERE `username` = ? AND `app` = ? AND `owner` = ?",[password_hash($pass, PASSWORD_BCRYPT), $un, $_SESSION['app'], $_SESSION['username']]);
|
||||
}
|
||||
|
||||
dashboard\primary\success("Successfully Updated User");
|
||||
misc\auditLog\send("Successfully Updated User $un");
|
||||
misc\cache\purge('KeyAuthUser:'.$_SESSION['app'].':'.$un);
|
||||
}
|
||||
|
||||
if (isset($_POST['deletesub'])) {
|
||||
$un = misc\etc\sanitize($_POST['deletesub']);
|
||||
|
||||
$query = misc\mysql\query("SELECT * FROM `users` WHERE `username` = ? AND `app` = ? AND `owner` = ?",[$un, $_SESSION['app'], $_SESSION['username']]);
|
||||
if ($query->num_rows < 1) {
|
||||
dashboard\primary\error("User not Found!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
$sub = misc\etc\sanitize($_POST['sub']);
|
||||
|
||||
function get_string_between($string, $start, $end)
|
||||
{
|
||||
$string = ' ' . $string;
|
||||
$ini = strpos($string, $start);
|
||||
if ($ini < 1) return '';
|
||||
$ini += strlen($start);
|
||||
$len = strpos($string, $end, $ini) - $ini;
|
||||
return substr($string, $ini, $len);
|
||||
}
|
||||
|
||||
$sub = get_string_between($sub, '[', ']');
|
||||
|
||||
$query = misc\mysql\query("DELETE FROM `subs` WHERE `app` = ? AND `user` = ? AND `subscription` = ?",[$_SESSION['app'], $un, $sub]);
|
||||
if ($query->affected_rows != 0) {
|
||||
misc\auditLog\send("Deleted the subscription \"{$sub}\" from $un");
|
||||
dashboard\primary\success("Successfully Deleted User's Subscription");
|
||||
} else {
|
||||
dashboard\primary\error("Failed To Delete User's Subscription!");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['delusers'])) {
|
||||
$query = misc\mysql\query("DELETE FROM `users` WHERE `app` = ? AND `owner` = ?",[$_SESSION['app'], $_SESSION['username']]);
|
||||
if ($query->affected_rows != 0) {
|
||||
misc\auditLog\send("Deleted all users");
|
||||
dashboard\primary\success("Users Successfully Deleted!");
|
||||
misc\cache\purgePattern('KeyAuthUser:' . $_SESSION['app']);
|
||||
misc\cache\purge('KeyAuthUsernames:' . $_SESSION['app']);
|
||||
misc\cache\purge('KeyAuthUsers:' . $_SESSION['app']);
|
||||
} else {
|
||||
dashboard\primary\error("Failed To Delete Users!");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['resetall'])) {
|
||||
$query = misc\mysql\query("UPDATE `users` SET `hwid` = '' WHERE `app` = ? AND `owner` = ?",[$_SESSION['app'], $_SESSION['username']]);
|
||||
if ($query->affected_rows != 0) {
|
||||
misc\auditLog\send("Reset all users' HWIDs");
|
||||
dashboard\primary\success("Users Successfully Reset!");
|
||||
misc\cache\purgePattern('KeyAuthUser:' . $_SESSION['app']);
|
||||
misc\cache\purge('KeyAuthUsernames:' . $_SESSION['app']);
|
||||
misc\cache\purge('KeyAuthUsers:' . $_SESSION['app']);
|
||||
} else {
|
||||
dashboard\primary\error("Failed To Reset Users!");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 lang class="text-xl font-semibold text-white-900 sm:text-2xl">Reseller Users</h1>
|
||||
<p class="text-xs text-gray-500">Manage your users here.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="del-all-users-modal" data-modal-target="del-all-users-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Users
|
||||
</button>
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="reset-all-users-hwid-modal" data-modal-target="reset-all-users-hwid-modal">
|
||||
<i class="lni lni-reload mr-2 mt-1"></i>Reset All Users HWID
|
||||
</button>
|
||||
|
||||
<!-- Delete All Users Modal -->
|
||||
<div id="del-all-users-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all your
|
||||
users. This can not be undone.
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your users?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="del-all-users-modal" name="delusers"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="del-all-users-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Users Modal -->
|
||||
|
||||
<!-- Reset All Users HWID Modal -->
|
||||
<div id="reset-all-users-hwid-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to reset all users
|
||||
HWIDs.
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to reset
|
||||
the HWID of all users?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="reset-all-users-hwid-modal" name="resetall"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="reset-all-users-hwid-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Reset All Users HWID Modal -->
|
||||
|
||||
<!-- Ban User Modal -->
|
||||
<div id="ban-user-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center hidden h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Ban User</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="reason" name="reason"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder="" autocomplete="on" maxlength="99" required>
|
||||
<input type="hidden" class="banuser" name="un">
|
||||
<label for="users"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Ban
|
||||
Reason:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;">
|
||||
<button onclick="closeModal('ban-user-modal')"
|
||||
class="w-full text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"
|
||||
style="margin-right: 10px;">Cancel</button>
|
||||
|
||||
<button name="banuser"
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"
|
||||
style="margin-right: 10px;">Ban User</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Ban User Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_reseller_users" class="w-full text-sm text-left white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Username</th>
|
||||
<th class="px-6 py-3">HWID</th>
|
||||
<th class="px-6 py-3">IP</th>
|
||||
<th class="px-6 py-3">Creation Date</th>
|
||||
<th class="px-6 py-3">Last Login Date</th>
|
||||
<th class="px-6 py-3">Status</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a
|
||||
class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
|
||||
<script>
|
||||
function banuser(username) {
|
||||
var banuser = $('.banuser');
|
||||
banuser.attr('value', username);
|
||||
|
||||
openModal('ban-user-modal');
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Include the jQuery library -->
|
||||
|
||||
103
app/pages/seller-logs.php
Normal file
103
app/pages/seller-logs.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] != "seller") {
|
||||
misc\auditLog\send("Attempted (and failed) to view seller logs.");
|
||||
dashboard\primary\error("Non-Sellers aren't allowed here.");
|
||||
die();
|
||||
}
|
||||
if(!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
|
||||
if (isset($_POST['enableLogs'])) {
|
||||
$query = misc\mysql\query("UPDATE `apps` SET `sellerLogs` = 1 WHERE `secret` = ?",[$_SESSION['app']]);
|
||||
if ($query->affected_rows > 0) {
|
||||
misc\cache\purge('KeyAuthAppSeller:' . $_SESSION['sellerkey']);
|
||||
dashboard\primary\success("Successfully enabled seller logs!");
|
||||
}
|
||||
else {
|
||||
dashboard\primary\success("Failed to enable seller logs.");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['disableLogs'])) {
|
||||
$query = misc\mysql\query("UPDATE `apps` SET `sellerLogs` = 0 WHERE `secret` = ?",[$_SESSION['app']]);
|
||||
if ($query->affected_rows > 0) {
|
||||
misc\cache\purge('KeyAuthAppSeller:' . $_SESSION['sellerkey']);
|
||||
dashboard\primary\success("Successfully disabled seller logs!");
|
||||
}
|
||||
else {
|
||||
dashboard\primary\success("Failed to disable seller logs.");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Seller Logs</h1>
|
||||
<p class="text-xs text-gray-500">View seller key activity. <a
|
||||
href="https://docs.keyauth.cc/website/seller/seller-logs" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<form method="post">
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT `sellerLogs` FROM `apps` WHERE `secret` = ?",[$_SESSION['app']]);
|
||||
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
$enabled = $row['sellerLogs'];
|
||||
|
||||
if (!$enabled){
|
||||
?>
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
name="enableLogs">
|
||||
<i class="lni lni-power-switch mr-2 mt-1"></i>Enable Logging
|
||||
</button>
|
||||
<?php } else { ?>
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
name="disableLogs">
|
||||
<i class="lni lni-power-switch mr-2 mt-1"></i>Disable Logging
|
||||
</button>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_seller_logs" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">IP Address</th>
|
||||
<th class="px-6 py-3">URL</th>
|
||||
<th class="px-6 py-3">Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ($_SESSION['app']) {
|
||||
$query = misc\mysql\query("SELECT * FROM `sellerLogs` WHERE `app` = ? ORDER BY `date` DESC",[$_SESSION['app']]);
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
|
||||
echo "<tr>";
|
||||
|
||||
echo " <td>" . $row["ip"] . "</td>";
|
||||
|
||||
echo " <td><a class=\"blur-sm hover:blur-none\" href=\"".$row["path"]."\" target=\"_blank\">". urldecode($row["path"]) . "</a></td>";
|
||||
|
||||
echo " <td><script>document.write(convertTimestamp(".$row["date"]."));</script></td>";
|
||||
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
1685
app/pages/seller-settings.php
Normal file
1685
app/pages/seller-settings.php
Normal file
File diff suppressed because it is too large
Load Diff
102
app/pages/sessions.php
Normal file
102
app/pages/sessions.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if($role == "Manager" && !($permissions & 16)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view sessions.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page!");
|
||||
die();
|
||||
}
|
||||
if(!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
if (isset($_POST['killall'])) {
|
||||
$resp = misc\session\killAll();
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to kill all sessions!"),
|
||||
'success' => dashboard\primary\success("Successfully killed all sessions!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
if (isset($_POST['kill'])) {
|
||||
$resp = misc\session\killSingular($_POST['kill']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to kill session!"),
|
||||
'success' => dashboard\primary\success("Successfully killed session!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Sessions</h1>
|
||||
<p class="text-xs text-gray-500">All of your active sessions. (Active Users) <a
|
||||
href="https://keyauthdocs.apidog.io/api/features/check-session" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Session Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="kill-all-sessions-modal" data-modal-target="kill-all-sessions-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Kill All Sessions
|
||||
</button>
|
||||
<!-- End Sessions Functions -->
|
||||
|
||||
<!--Kill All Sessions Modal -->
|
||||
<div id="kill-all-sessions-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to kill all of
|
||||
your active sessions. Requiring everyone to log into your app again.
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure
|
||||
you want
|
||||
to
|
||||
kill your active sessions?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="kill-all-sessions-modal" name="killall"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="kill-all-sessions-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Kill All Sessions Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_sessions" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">ID</th>
|
||||
<th class="px-6 py-3">Credentials</th>
|
||||
<th class="px-6 py-3">Expires</th>
|
||||
<th class="px-6 py-3">Authenticated</th>
|
||||
<th class="px-6 py-3">IP Address</th>
|
||||
<th class="px-6 py-3">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a
|
||||
class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
|
||||
146
app/pages/staff-panel.php
Normal file
146
app/pages/staff-panel.php
Normal file
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
if (!$staff)
|
||||
{
|
||||
ob_clean();
|
||||
http_response_code(403);
|
||||
require '../404_error.html';
|
||||
die();
|
||||
}
|
||||
|
||||
if (!$twofactor)
|
||||
{
|
||||
dashboard\primary\error("Staff accounts mut have 2FA enabled.");
|
||||
die("Staff accounts must have 2FA enabled");
|
||||
}
|
||||
|
||||
if (isset($_POST['changeEmail'])) {
|
||||
$orderId = misc\etc\sanitize($_POST['orderID']);
|
||||
$newEmail = misc\etc\sanitize($_POST['email']);
|
||||
|
||||
if (!is_null($orderId)) {
|
||||
$query = misc\mysql\query("SELECT `username` FROM `orders` WHERE `orderID` = ?", [$orderId]);
|
||||
if ($query->num_rows < 1) {
|
||||
dashboard\primary\error("Order ID not found. Should be from shoppy, sellapp, sellix, or orders.keyauth.cc. NOT PayPal etc. Contact us https://chatting.page/gjqkqirygnfslvce2m5eycuo7tfxrhxl");
|
||||
return;
|
||||
}
|
||||
$username = mysqli_fetch_array($query->result)['username'];
|
||||
|
||||
$query = misc\mysql\query("SELECT `username` FROM `accounts` WHERE `email` = SHA(?)", [$newEmail]);
|
||||
if ($query->num_rows < 1) {
|
||||
$query = misc\mysql\query("UPDATE `accounts` SET `email` = SHA1(?) WHERE `username` = ?", [$newEmail, $username]);
|
||||
if ($query->affected_rows > 0) {
|
||||
dashboard\primary\success("Successfully changed email.");
|
||||
return;
|
||||
} else {
|
||||
dashboard\primary\error("Failed to change email. Perhaps the user changed their username after purchasing. Contact us https://chatting.page/gjqkqirygnfslvce2m5eycuo7tfxrhxl");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
dashboard\primary\error("Email already used by username " . mysqli_fetch_array($query->result)['username'] . "");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$query = misc\mysql\query("SELECT 1 FROM `accounts` WHERE `email` = SHA1(?)", [$newEmail]);
|
||||
if ($query->num_rows > 0) {
|
||||
dashboard\primary\error("Email already used! You must specify another email");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (isset($_POST['checkExistence'])){
|
||||
$username = misc\etc\sanitize($_POST['username']);
|
||||
|
||||
$query = misc\mysql\query("SELECT `username` FROM `accounts` WHERE `username` = ?",[$username]);
|
||||
if ($query->num_rows > 0){
|
||||
dashboard\primary\success("User exists");
|
||||
} else{
|
||||
dashboard\primary\error("User does not exist!");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Staff Panel</h1>
|
||||
<p class="text-xs text-gray-500">Welcome Staff! If you need help, or don't understand something, please
|
||||
contact an Admin. Thank You!</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Staff Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="check-existence-modal" data-modal-target="check-existence-modal">
|
||||
<i class="lni lni-user mr-2 mt-1"></i>Check Existence
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="inline-flex text-white bg-orange-500 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="change-users-email-modal" data-modal-target="change-users-email-modal">
|
||||
<i class="lni lni-reload mr-2 mt-1"></i>Change Users Email
|
||||
</button>
|
||||
<!-- End Staff Functions -->
|
||||
|
||||
<!-- Search By OrderID Modal -->
|
||||
<div id="change-users-email-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-orange-700 shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Change Users Email</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="un" name="orderID"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border- border-gray-600 appearance-none focus:ring-0 peer focus:border-orange-700"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="orderID"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-orange-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Users
|
||||
OrderID</label>
|
||||
</div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="email" name="email"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border- border-gray-600 appearance-none focus:ring-0 peer focus:border-orange-700"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="email"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-orange-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">New Email</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="changeEmail"
|
||||
class="w-full text-white bg-orange-700 hover:bg-orange-800 focus:ring-4 focus:outline-none focus:ring-orange-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Change Email</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Search By OrderID Modal -->
|
||||
|
||||
<!-- Check Existence Modal -->
|
||||
<div id="check-existence-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Check User Existence</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="username" name="username"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-600 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="off" required="">
|
||||
<label for="username"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Username</label>
|
||||
</div>
|
||||
</div>
|
||||
<button name="checkExistence"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Check Existence</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Check Existance Modal -->
|
||||
369
app/pages/subscriptions.php
Normal file
369
app/pages/subscriptions.php
Normal file
@@ -0,0 +1,369 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if ($role == "Manager" && !($permissions & 4)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view subscriptions.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page.");
|
||||
die();
|
||||
}
|
||||
if (!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
if (isset($_POST['addsub'])) {
|
||||
if (!is_numeric($_POST['level'])) {
|
||||
dashboard\primary\error("Level must be a number!");
|
||||
} else {
|
||||
$resp = misc\sub\add($_POST['subname'], $_POST['level']);
|
||||
match($resp){
|
||||
'already_exists' => dashboard\primary\error("This subscription already exists!"),
|
||||
'failure' => dashboard\primary\error("Failed to create subscription!"),
|
||||
'success' => dashboard\primary\success("Successfully created subscription!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['deletesub'])) {
|
||||
$resp = misc\sub\deleteSingular($_POST['deletesub']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete subscription"),
|
||||
'success' => dashboard\primary\success("Successfully deleted subscription"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['delallsubs'])){
|
||||
$resp = misc\sub\deleteall();
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete subscriptions!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted all subscriptions!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['pausesub'])){
|
||||
$resp = misc\sub\pause($_POST['pausesub']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to pause subscription!"),
|
||||
'success' => dashboard\primary\success("Successfully paused subscription!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['unpausesub'])){
|
||||
$resp = misc\sub\unpause($_POST['unpausesub']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to unpause subscription!"),
|
||||
'success' => dashboard\primary\success("Successfully unpaused subscription!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['editsub'])) {
|
||||
$subscription = misc\etc\sanitize($_POST['editsub']);
|
||||
$query = misc\mysql\query("SELECT * FROM `subscriptions` WHERE `name` = ? AND `app` = ?", [$subscription, $_SESSION['app']]);
|
||||
if ($query->num_rows < 1) {
|
||||
dashboard\primary\error("Subscription not Found!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
$level = $row["level"];
|
||||
echo '
|
||||
<div id="edit-file-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Edit Subscription</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="level" name="level"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $level . '" maxlength="12" required>
|
||||
<input type="hidden" name="subscription" value="' . $subscription . '">
|
||||
<label for="level"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Subscription Level:</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<button name="savesub"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Save
|
||||
Changes</button>
|
||||
<button
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center" onClick="window.location.href=window.location.href">Cancel
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Edit Account Modal -->';
|
||||
}
|
||||
if (isset($_POST['savesub'])) {
|
||||
$subscription = misc\etc\sanitize($_POST['subscription']);
|
||||
$level = misc\etc\sanitize($_POST['level']);
|
||||
|
||||
if (!is_numeric($_POST['level'])) {
|
||||
dashboard\primary\error("Level must be a number!");
|
||||
} else {
|
||||
misc\mysql\query("UPDATE `subscriptions` SET `level` = ? WHERE `name` = ? AND `app` = ?", [$level, $subscription, $_SESSION['app']]);
|
||||
if ($_SESSION['role'] == "seller") {
|
||||
misc\cache\purge('KeyAuthSubscriptions:' . $_SESSION['app']);
|
||||
}
|
||||
dashboard\primary\success("Successfully Updated Subscription!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST["selected"]) && isset($_POST["action"])) {
|
||||
$selected = json_decode($_POST["selected"]);
|
||||
|
||||
if ($_POST["action"] == "delete") {
|
||||
foreach ($selected as $sub) {
|
||||
$resp = misc\sub\deleteSingular($sub);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete subscription"),
|
||||
'success' => dashboard\primary\success("Successfully deleted subscription"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
else if ($_POST["action"] == "pauseMulti") {
|
||||
foreach ($selected as $value) {
|
||||
$resp = misc\sub\pause($value);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to pause subscriptions!"),
|
||||
'success' => dashboard\primary\success("Successfully paused subscriptions!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
else if ($_POST["action"] == "unpauseMulti") {
|
||||
foreach ($selected as $value) {
|
||||
$resp = misc\sub\unpause($value);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to unpause subscriptions!"),
|
||||
'success' => dashboard\primary\success("Successfully unpaused subscriptions!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
else {
|
||||
dashboard\primary\error("Invalid action!");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Subscriptions</h1>
|
||||
<p class="text-xs text-gray-500">Subscriptions act as levels/tiers. <a
|
||||
href="https://keyauthdocs.apidog.io/sellerapi/subscriptions/create-new-subscription" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Subscripion Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="create-subscription-modal" data-modal-target="create-subscription-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i>Create Subscription
|
||||
</button>
|
||||
<!-- End Subscription Functions -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Delete Subscription Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-subs-modal" data-modal-target="delete-all-subs-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Subscriptions
|
||||
</button>
|
||||
|
||||
<button id="dropdownselection" data-dropdown-toggle="subscriptiondropdown"
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200 hidden"
|
||||
type="button">Selection Options
|
||||
</button>
|
||||
|
||||
<div id="subscriptiondropdown" class="z-10 hidden bg-[#09090d] divide-y divide-gray-100 rounded-lg shadow w-44">
|
||||
<ul class="py-2 text-sm text-white">
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Delete Selected</a>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="pauseMulti">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Pause Selected</a>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="unpauseMulti">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Unpause Selected</a>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- End Delete Subscription Functions -->
|
||||
|
||||
<!-- Create Subscription Modal -->
|
||||
<div id="create-subscription-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Create A Subscription</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="subname" name="subname"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="subname"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Subscription
|
||||
Name</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" inputmode="numeric" id="level" name="level"
|
||||
maxlength="12"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="level"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Subscription
|
||||
Level</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<button type="submit" name="addsub"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Create
|
||||
Subscription</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Create Subscription Modal -->
|
||||
|
||||
<!-- Delete All Subscriptions Modal -->
|
||||
<div id="delete-all-subs-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
subscriptions. This can not be undone.
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your subscriptions?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-subs-modal" name="delallsubs"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-subs-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Keys Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_subs" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Select</th>
|
||||
<th class="px-6 py-3">Subscription Name</th>
|
||||
<th class="px-6 py-3">License Level</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ($_SESSION['app']) {
|
||||
$query = misc\mysql\query("SELECT * FROM `subscriptions` WHERE `app` = ?", [$_SESSION['app']]);
|
||||
if ($query->num_rows > 0){
|
||||
while ($row = mysqli_fetch_array($query->result)){
|
||||
echo "<tr>";
|
||||
echo '<td> <input type="checkbox" style="outline:none;"class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 checkbox" value="' . $row["name"] .'">' . '</td>';
|
||||
echo "<td>" . $row["name"] . "</td>";
|
||||
echo "<td>" . $row["level"] . "</td>";
|
||||
|
||||
echo '<form method="POST">
|
||||
<td>
|
||||
<div x-data="{ open: false }" class="z-0">
|
||||
<button x-on:click="open = true" class="flex items-center border border-gray-700 rounded-lg focus:opacity-60 text-white focus:text-white font-semibold rounded focus:outline-none focus:shadow-inner py-2 px-4" type="button">
|
||||
<span class="mr-1">Actions</span>
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" style="margin-top:3px">
|
||||
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<ul x-show="open" x-on:click.away="open = false" class="bg-[#09090d] text-white rounded shadow-lg absolute py-2 mt-1" style="min-width:15rem">
|
||||
<li>
|
||||
<button name="deletesub" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="' . $row["name"] . '">
|
||||
Delete Subscription
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button name="pausesub" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="' . $row["name"] . '">
|
||||
Pause Subscription
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button name="unpausesub" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="' . $row["name"] . '">
|
||||
Unpause Subscription
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button name="editsub" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-blue-700"
|
||||
value="' . $row["name"] . '">
|
||||
Edit Subscription
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
23
app/pages/support.php
Normal file
23
app/pages/support.php
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
<style>
|
||||
div.scroll {
|
||||
width: 1000px;
|
||||
height: 330px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<!--begin::Container-->
|
||||
<div id="kt_content_container" class="container-xxl">
|
||||
<div class="card mb-xl-8">
|
||||
<div class="card-header border-0 pt-5">
|
||||
<h3 class="card-title align-items-start flex-column">
|
||||
<span class="card-label fw-bolder fs-3 mb-1">Support Chat</span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body py-3">
|
||||
Web tickets have been discontinued - Please use the chat box on the bottom right of the website.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
43
app/pages/tokens.php
Normal file
43
app/pages/tokens.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if($role == "Manager" && !($permissions & 1)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view tokens.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page!");
|
||||
die();
|
||||
}
|
||||
if(!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 lang class="text-xl font-semibold text-white-900 sm:text-2xl">Tokens</h1>
|
||||
<p class="text-xs text-gray-500">Given to users to manage blacklists.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_tokens" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">App</th>
|
||||
<th class="px-6 py-3">Token</th>
|
||||
<th class="px-6 py-3">Assigned</th>
|
||||
<th class="px-6 py-3">Banned</th>
|
||||
<th class="px-6 py-3">Reason</th>
|
||||
<th class="px-6 py-3">Hash</th>
|
||||
<th class="px-6 py-3">Type</th>
|
||||
<th class="px-6 py-3">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
839
app/pages/upgrade.php
Normal file
839
app/pages/upgrade.php
Normal file
@@ -0,0 +1,839 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller" || $_SESSION['role'] == "Manager"){
|
||||
misc\auditLog\send("Attempted (and failed) to view upgrade.");
|
||||
dashboard\primary\error("Resellers or Managers aren't allowed here.");
|
||||
echo "<meta http-equiv='Refresh' Content='3; url=?page=manage-apps'>";
|
||||
die();
|
||||
}
|
||||
|
||||
if ($_SESSION['username'] == "demoseller" || $_SESSION['username'] == "demodeveloper"){
|
||||
dashboard\primary\error("You can not upgrade a demo account!");
|
||||
echo "<meta http-equiv='Refresh' Content='3; url=?page=manage-apps'>";
|
||||
die();
|
||||
}
|
||||
|
||||
if (str_contains($ua, 'iPhone') || str_contains($ua, 'Mac OS') || str_contains($ua, 'Mobile')){
|
||||
dashboard\primary\error("Like Spotify, you can't uprade in the app. We know, it's not ideal.");
|
||||
echo "<meta http-equiv='Refresh' Content='3; url=?page=manage-apps'>";
|
||||
die();
|
||||
}
|
||||
?>
|
||||
<title>KeyAuth - Upgrade</title>
|
||||
<script src="https://cdn.sellix.io/static/js/embed.js"></script>
|
||||
<link href="https://cdn.sellix.io/static/css/embed.css" rel="stylesheet" />
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Upgrade</h1>
|
||||
<p class="text-xs text-gray-500">Upgrade your account today!</p>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Alert Box -->
|
||||
<div id="alert-4" class="flex items-center p-4 mb-4 text-red-600 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<div class="ml-3 text-sm font-medium">
|
||||
<b>Fraud Notice:</b> Committing fraud will result in your account being banned! There is also a risk rating on each payment. If it reaches a specific amount, we have the right to refund you and downgrade your account.
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
<!-- Alert Box -->
|
||||
<div id="alert-4" class="flex items-center p-4 mb-4 text-red-600 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<div class="ml-3 text-sm font-medium">
|
||||
<b>Russian Blockages Notice:</b> We do not block any users in Russia, but Paypal & credit
|
||||
cards do.
|
||||
Use Binance, Cryptocurrency, or Perfect Money instead.
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
<!-- Alert Box -->
|
||||
<div id="alert-4" class="flex items-center p-4 mb-4 text-green-600 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<div class="ml-3 text-sm font-medium">
|
||||
<b>Discount:</b> If you currently have the Developer subscription(yearly only!), you can use code
|
||||
<b>alreadydev</b> to get 50% off when purchasing the seller subscription.
|
||||
Attempting to use the code while having the tester subscription will result in you only
|
||||
receiving the developer subscription.
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
<section id="plans">
|
||||
<div class="max-w-screen-xl px-4 py-8 mx-auto lg:px-6 sm:py-16 lg:py-24">
|
||||
<div class="mx-auto max-w-screen-md text-center">
|
||||
<div class="flex items-center justify-center mb-12 -mt-6">
|
||||
<label class="relative inline-flex items-center mr-5 cursor-pointer">
|
||||
<input type="checkbox" id="pricing_anually_month" class="sr-only peer"
|
||||
checked>
|
||||
<div
|
||||
class="w-11 h-6 border-2 border-blue-700 bg-[#0f0f17] rounded-full peer peer-focus:ring-0 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-[#0C0C12] after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-[#0C0C12]">
|
||||
</div>
|
||||
<span class="ml-3 text-sm font-medium text-gray-300">Annual pricing <span
|
||||
class="text-xs">(save
|
||||
50% +)</span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap -m-7">
|
||||
<div class="w-full md:w-1/3 p-7 animate-on-scroll">
|
||||
<div class="h-full p-8 border border-white-700 rounded-xl bg-[#09090d]">
|
||||
<div class="flex flex-wrap justify-between border-b border-gray-800 pb-7 mb-7">
|
||||
<div class="w-full xl:w-auto">
|
||||
<h3 class="font-bold text-2xl text-white">Tester</h3>
|
||||
</div>
|
||||
<div class="w-full xl:w-auto xl:text-right">
|
||||
<h3 class="mb-0.5 font-bold text-2xl text-white">
|
||||
<span class="text-sm mr-0.5">$</span> <span id="tester_mode"></span>
|
||||
</h3>
|
||||
<p class="text-sm text-gray-400">
|
||||
Limited Access for those looking to experiment implementing KeyAuth
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="mb-8">
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Users: 10
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Upload Files: (10 MB)
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Global Variables: 5
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
User Variables
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Logs (includes Discord logs): 20
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Hardware/IP Blacklist/Whitelist
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Web Loader
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-red-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm4.207 12.793-1.414 1.414L12 13.414l-2.793 2.793-1.414-1.414L10.586 12 7.793 9.207l1.414-1.414L12 10.586l2.793-2.793 1.414 1.414L13.414 12l2.793 2.793Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Create Webhooks
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-red-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm4.207 12.793-1.414 1.414L12 13.414l-2.793 2.793-1.414-1.414L10.586 12 7.793 9.207l1.414-1.414L12 10.586l2.793-2.793 1.414 1.414L13.414 12l2.793 2.793Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Reseller & Manager Access
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-red-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm4.207 12.793-1.414 1.414L12 13.414l-2.793 2.793-1.414-1.414L10.586 12 7.793 9.207l1.414-1.414L12 10.586l2.793-2.793 1.414 1.414L13.414 12l2.793 2.793Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Chatrooms
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-red-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm4.207 12.793-1.414 1.414L12 13.414l-2.793 2.793-1.414-1.414L10.586 12 7.793 9.207l1.414-1.414L12 10.586l2.793-2.793 1.414 1.414L13.414 12l2.793 2.793Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
SellerAPI Access
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-red-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm4.207 12.793-1.414 1.414L12 13.414l-2.793 2.793-1.414-1.414L10.586 12 7.793 9.207l1.414-1.414L12 10.586l2.793-2.793 1.414 1.414L13.414 12l2.793 2.793Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Discord Bot
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php if ($_SESSION["role"] !== "tester"){ ?>
|
||||
<p class="text-sm text-gray-400">
|
||||
This is the default subsription. But you have the <?= $_SESSION["role"]; ?>
|
||||
subscription.
|
||||
</p>
|
||||
<?php } else { ?>
|
||||
<p class="text-sm text-gray-400">
|
||||
This is the default subsription, and your current one.
|
||||
</p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full md:w-1/3 p-7 animate-on-scroll-in-up">
|
||||
<div class="h-full p-8 border border-green-700 rounded-xl bg-[#09090d]">
|
||||
<div class="flex flex-wrap justify-between border-b border-gray-800 pb-7 mb-7">
|
||||
<div class="w-full xl:w-auto">
|
||||
<h3 class="font-bold text-2xl text-white">Developer</h3>
|
||||
</div>
|
||||
<div class="w-full xl:w-auto xl:text-right">
|
||||
<h3
|
||||
class="mb-0.5 font-bold text-2xl text-transparent bg-clip-text bg-gradient-to-r to-[#4fea74] from-[#1db233]">
|
||||
<span class="text-sm mr-0.5">$</span><span
|
||||
id="developer_mode"></span>
|
||||
</h3>
|
||||
<p class="text-sm text-gray-400">
|
||||
Ample limits plus full access to reseller system. Most folks start
|
||||
here.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="mb-8">
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Users: Unlimited
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Upload Files: (50 MB)
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Global Variables: Unlimited
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
User Variables
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Logs (includes Discord logs): Unlimited
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Hardware/IP Blacklist/Whitelist
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Web Loader
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Create Webhooks
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Reseller & Manager Access
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-red-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm4.207 12.793-1.414 1.414L12 13.414l-2.793 2.793-1.414-1.414L10.586 12 7.793 9.207l1.414-1.414L12 10.586l2.793-2.793 1.414 1.414L13.414 12l2.793 2.793Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Chatrooms
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-red-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm4.207 12.793-1.414 1.414L12 13.414l-2.793 2.793-1.414-1.414L10.586 12 7.793 9.207l1.414-1.414L12 10.586l2.793-2.793 1.414 1.414L13.414 12l2.793 2.793Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
SellerAPI Access
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-red-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm4.207 12.793-1.414 1.414L12 13.414l-2.793 2.793-1.414-1.414L10.586 12 7.793 9.207l1.414-1.414L12 10.586l2.793-2.793 1.414 1.414L13.414 12l2.793 2.793Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Discord Bot
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php if ($_SESSION["role"] == "seller") { ?>
|
||||
<p class="text-sm text-gray-400 mb-5">
|
||||
You already have this or a higher subscription.
|
||||
</p>
|
||||
<?php } ?>
|
||||
<button type="button"
|
||||
class="text-green-700 border-2 border-green-700 hover:bg-green-700 hover:text-white focus:ring-0 focus:outline-none transition duration-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center mb-3 w-full">
|
||||
<a href="https://paddle.keyauth.cc/developer/?ownerid=<?= urlencode($_SESSION['ownerid']); ?>" target="_blank">
|
||||
<span class="inline-flex">
|
||||
Purchase Developer Now (PayPal/Card)
|
||||
<svg class="w-3.5 h-3.5 ml-2 mt-0.5" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 10">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5h12m0 0L9 1m4 4L9 9" />
|
||||
</svg></span>
|
||||
</a>
|
||||
</button>
|
||||
|
||||
<button id="sellixButtonDeveloper" data-sellix-product="6011e41969f3d" type="submit" data-sellix-custom-username="'.urlencode($_SESSION['ownerid']).'"
|
||||
class="text-green-700 border-2 border-green-700 hover:bg-green-700 hover:text-white focus:ring-0 focus:outline-none transition duration-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center mb-3 w-full">
|
||||
<span class="inline-flex">
|
||||
Purchase Developer Now (Crypto)
|
||||
<svg class="w-3.5 h-3.5 ml-2 mt-0.5" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 10">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5h12m0 0L9 1m4 4L9 9" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
class="text-green-700 border-2 border-green-700 hover:bg-green-700 hover:text-white focus:ring-0 focus:outline-none transition duration-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center mb-3 w-full"
|
||||
data-modal-target="cashapp-purchase" data-modal-toggle="cashapp-purchase">
|
||||
<span class="inline-flex">
|
||||
Purchase Developer Now (Cashapp)
|
||||
<svg class="w-3.5 h-3.5 ml-2 mt-0.5" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 10">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5h12m0 0L9 1m4 4L9 9" />
|
||||
</svg></span>
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full md:w-1/3 p-7 animate-on-scroll-right">
|
||||
<div class="h-full p-8 border border-cyan-700 rounded-xl bg-[#09090d]">
|
||||
<div class="flex flex-wrap justify-between border-b border-gray-800 pb-7 mb-7">
|
||||
<div class="w-full xl:w-auto">
|
||||
<h3 class="font-bold text-2xl text-white">Seller</h3>
|
||||
</div>
|
||||
<div class="w-full xl:w-auto xl:text-right">
|
||||
<h3
|
||||
class="mb-0.5 font-bold text-2xl text-transparent bg-clip-text bg-gradient-to-r to-[#36e2dd] from-[#1e96fc]">
|
||||
<span class="text-sm mr-0.5">$</span><span id="seller_mode"></span>
|
||||
</h3>
|
||||
<p class="text-sm text-gray-400">
|
||||
Full-fledged supporter, we appreciate you for keeping our servers
|
||||
running!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="mb-8">
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Users: Unlimited
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Upload Files: (75 MB)
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Global Variables: Unlimited
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
User Variables
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Logs (includes Discord logs): Unlimited
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Hardware/IP Blacklist/Whitelist
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Web Loader
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Create Webhooks
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Reseller & Manager Access
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Chatrooms
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
SellerAPI Access
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor" viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Discord Bot
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php if ($_SESSION["role"] == "seller") { ?>
|
||||
<p class="text-sm text-gray-400 mb-5">
|
||||
You already have this or a higher subscription.
|
||||
</p>
|
||||
<?php } ?>
|
||||
<button type="button"
|
||||
class="text-cyan-700 border-2 border-cyan-700 hover:bg-cyan-700 hover:text-white focus:ring-0 focus:outline-none transition duration-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center mb-3 w-full">
|
||||
<a href="https://paddle.keyauth.cc/seller/?ownerid=<?= urlencode($_SESSION['ownerid']); ?>" target="_blank">
|
||||
<span class="inline-flex">
|
||||
Purchase Seller Now (PayPal/Card)
|
||||
<svg class="w-3.5 h-3.5 ml-2 mt-0.5" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 10">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5h12m0 0L9 1m4 4L9 9" />
|
||||
</svg></span>
|
||||
</a>
|
||||
</button>
|
||||
|
||||
<button id="sellixButtonSeller" data-sellix-product="6011e42262457" type="submit" data-sellix-custom-username="'.urlencode($_SESSION['ownerid']).'"
|
||||
class="text-cyan-700 border-2 border-cyan-700 hover:bg-cyan-700 hover:text-white focus:ring-0 focus:outline-none transition duration-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center mb-3 w-full">
|
||||
<span class="inline-flex">
|
||||
Purchase Seller Now (Crypto)
|
||||
<svg class="w-3.5 h-3.5 ml-2 mt-0.5" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 10">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5h12m0 0L9 1m4 4L9 9" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
class="text-cyan-700 border-2 border-cyan-700 hover:bg-cyan-700 hover:text-white focus:ring-0 focus:outline-none transition duration-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center mb-3 w-full"
|
||||
data-modal-target="cashapp-purchase" data-modal-toggle="cashapp-purchase">
|
||||
<span class="inline-flex">
|
||||
Purchase Seller Now (Cashapp)
|
||||
<svg class="w-3.5 h-3.5 ml-2 mt-0.5" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 10">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5h12m0 0L9 1m4 4L9 9" />
|
||||
</svg></span>
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full p-7 animate-on-scroll-in-up">
|
||||
<div class="h-full p-8 border border-yellow-700 rounded-xl bg-[#09090d]">
|
||||
<div class="flex flex-wrap justify-between border-b border-gray-800 pb-7 mb-7">
|
||||
<div class="w-full xl:w-auto">
|
||||
<h3 class="font-bold text-2xl text-white">Enterprise <span
|
||||
class="text-xs">(Source
|
||||
Code)</span></h3>
|
||||
</div>
|
||||
<div class="w-full xl:w-auto xl:text-right">
|
||||
<h3
|
||||
class="mb-0.5 font-bold text-2xl text-transparent bg-clip-text bg-gradient-to-r to-[#eeba0b] from-[#f4e409]">
|
||||
<span class="text-sm mr-0.5">$</span>79.99 / One-Time
|
||||
</h3>
|
||||
<p class="text-sm text-gray-400">
|
||||
Opt for large-scale projects at $79.99 one-time cost. <br>Access
|
||||
paid KeyAuth
|
||||
features' source code, one-on-one setup support, and more.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="mb-8 md:grid md:grid-cols-2">
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-red-500" fill="currentColor"
|
||||
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm4.207 12.793-1.414 1.414L12 13.414l-2.793 2.793-1.414-1.414L10.586 12 7.793 9.207l1.414-1.414L12 10.586l2.793-2.793 1.414 1.414L13.414 12l2.793 2.793Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Cloud Hosted Subscription (KeyAuth Servers)
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor"
|
||||
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Source code of paid KeyAuth features
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor"
|
||||
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
One-on-one setup support
|
||||
</p>
|
||||
</li>
|
||||
<li class="flex items-center mb-4 font-medium text-base text-white">
|
||||
<svg class="h-5 w-5 mr-2.5 text-green-500" fill="currentColor"
|
||||
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2Zm-1.999 14.413-3.713-3.705L7.7 11.292l2.299 2.295 5.294-5.294 1.414 1.414-6.706 6.706Z">
|
||||
</path>
|
||||
</svg>
|
||||
<p>
|
||||
Tutorial video showing how to host KeyAuth for 100% free
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
<?php
|
||||
echo '<button data-sellix-product="6361c20e415e9" type="submit"
|
||||
class="text-[#eeba0b] border-2 border-[#eeba0b] hover:bg-[#eeba0b] hover:text-white focus:ring-0 focus:outline-none transition duration-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center mb-3 w-full">
|
||||
<span class="inline-flex">
|
||||
Purchase Enterprise Now
|
||||
<svg class="w-3.5 h-3.5 ml-2 mt-0.5" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 10">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5h12m0 0L9 1m4 4L9 9" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
class="text-[#eeba0b] border-2 border-[#eeba0b] hover:bg-[#eeba0b] hover:text-black focus:ring-0 focus:outline-none transition duration-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center mb-3 w-full">
|
||||
<a href="https://paddle.keyauth.cc/enterprise/?ownerid=' . urlencode($_SESSION['username']) . '" target="_blank">
|
||||
<span class="inline-flex">
|
||||
Purchase Enterprise Now (PayPal)
|
||||
<svg class="w-3.5 h-3.5 ml-2 mt-0.5" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 14 10">
|
||||
<path stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5h12m0 0L9 1m4 4L9 9" />
|
||||
</svg>
|
||||
</span>
|
||||
</a>
|
||||
</button>';
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- cashapp-purchase Modal -->
|
||||
<div id="cashapp-purchase" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<form method="post">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> Paying with CashApp does not automatically upgrade you! <b>It can take up to 2 days to upgrade your account if you decide to purchase via CashApp</b>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<div class="grid place-items-center">
|
||||
<img class="h-auto max-w-xl rounded-lg shadow-xl" src="https://cdn.keyauth.cc/v3/imgs/KeyAuthLLC CashAppImg.png" alt="Failed to load CashTag QR Code">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="text-sm text-gray-400 mb-5">
|
||||
Scan the QR code to pay with CashApp. Make sure you include your owner ID in the note so that you are upgraded successfully!
|
||||
You must also contact support and send them a screenshot of your order, so that the process can go faster.
|
||||
</p>
|
||||
<button data-modal-hide="cashapp-purchase" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- cashapp-purchase Modal -->
|
||||
|
||||
<!--Flowbite JS-->
|
||||
<script src="https://cdn.keyauth.cc/v3/dist/flowbite.js"></script>
|
||||
|
||||
<!-- jqeury -->
|
||||
<script src="https://cdn.keyauth.cc/v3/scripts/jquery.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Function to update text and button attribute
|
||||
function updateTextAndButtonAttribute() {
|
||||
if ($("#pricing_anually_month").is(':checked')) {
|
||||
$("#tester_mode").text("0 / Year");
|
||||
$("#developer_mode").text("14.99 / Year");
|
||||
$("#seller_mode").text("24.99 / Year");
|
||||
$("#sellixButtonSeller").attr("data-sellix-product", "6011e42262457");
|
||||
$("#sellixButtonDeveloper").attr("data-sellix-product", "6011e41969f3d");
|
||||
} else {
|
||||
$("#tester_mode").text("0 / Year");
|
||||
$("#developer_mode").text("2.99 / Month");
|
||||
$("#seller_mode").text("4.99 / Month");
|
||||
$("#sellixButtonSeller").attr("data-sellix-product", "65475b6dbe8e2");
|
||||
$("#sellixButtonDeveloper").attr("data-sellix-product", "6547557555143");
|
||||
}
|
||||
}
|
||||
|
||||
// Initial setup
|
||||
updateTextAndButtonAttribute();
|
||||
|
||||
// Toggle event handler
|
||||
$("#pricing_anually_month").click(function() {
|
||||
updateTextAndButtonAttribute();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
312
app/pages/user-vars.php
Normal file
312
app/pages/user-vars.php
Normal file
@@ -0,0 +1,312 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if ($role == "Manager" && !($permissions & 2)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view user variables.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page.");
|
||||
die();
|
||||
}
|
||||
if(!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
|
||||
if (isset($_POST['setvar'])) {
|
||||
if(strlen($_POST['data']) > 500) {
|
||||
dashboard\primary\error("Variable data must be 500 characters or less!");
|
||||
}
|
||||
else {
|
||||
$readOnly = misc\etc\sanitize($_POST['readOnly']) == NULL ? 0 : 1;
|
||||
$resp = misc\user\setVariable(urldecode($_POST['user']), $_POST['var'], $_POST['data'], null, $readOnly);
|
||||
match($resp){
|
||||
'missing' => dashboard\primary\error("No users found!"),
|
||||
'failure' => dashboard\primary\error("Failed to set variable!"),
|
||||
'success' => dashboard\primary\success("Successfully set variable!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['delvars'])) {
|
||||
$query = misc\mysql\query("DELETE FROM `uservars` WHERE `app` = ?",[$_SESSION['app']]);
|
||||
if ($query->affected_rows > 0) {
|
||||
dashboard\primary\success("Successfully deleted all variables");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to delete all variables");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['deletevar'])) {
|
||||
$varId = misc\etc\sanitize($_POST['deletevar']);
|
||||
|
||||
$query = misc\mysql\query("DELETE FROM `uservars` WHERE `app` = ? AND `id` = ?", [$_SESSION['app'], $varId]);
|
||||
|
||||
if ($query->affected_rows > 0) {
|
||||
dashboard\primary\success("Successfully deleted variable");
|
||||
}
|
||||
else {
|
||||
dashboard\primary\error("Failed to delete variable");
|
||||
}
|
||||
}
|
||||
|
||||
// edit modal
|
||||
if (isset($_POST['editvar'])) {
|
||||
$varId = misc\etc\sanitize($_POST['editvar']);
|
||||
|
||||
$query = misc\mysql\query("SELECT * FROM `uservars` WHERE `id` = ? AND `app` = ?",[$varId, $_SESSION['app']]);
|
||||
if ($query->num_rows < 1) {
|
||||
dashboard\primary\error("Variable not Found!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
|
||||
$data = $row["data"];
|
||||
$readOnly = $row["readOnly"];
|
||||
|
||||
echo '
|
||||
<div id="edit-variable-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Edit Variable</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<label for="data" name="data"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">
|
||||
Variable Data</label>
|
||||
<textarea id="data" name="data" rows="4"
|
||||
class="block p-2.5 w-full text-sm text-white-900 bg-[#0f0f17] rounded-lg border border-gray-700 focus:ring-blue-500 focus:border-blue-500"
|
||||
placeholder="" maxlength="1000" required>' . $data . '</textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="flex items-center mb-4">
|
||||
<input id="readOnly" name="readOnly" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
' . ($readOnly ? "checked" : "") . '>
|
||||
<label for="readOnly"
|
||||
class="ml-2 text-sm font-medium text-white-900">Read only</label>
|
||||
</div>
|
||||
|
||||
<button name="savevar" value="' . $varId . '"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Save
|
||||
Changes</button>
|
||||
<button
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center" onClick="window.location.href=window.location.href">Cancel
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Edit Var Modal -->';
|
||||
}
|
||||
|
||||
if (isset($_POST['savevar'])) {
|
||||
|
||||
$readOnly = misc\etc\sanitize($_POST['readOnly']) == NULL ? 0 : 1;
|
||||
$varData = misc\etc\sanitize($_POST['data']);
|
||||
$varId = misc\etc\sanitize($_POST['savevar']);
|
||||
|
||||
if(strlen($varData) > 500) {
|
||||
dashboard\primary\error("Variable too long! Must be 500 characters or less");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
misc\mysql\query("UPDATE `uservars` SET `data` = ?, `readOnly` = ? WHERE `id` = ? AND `app` = ?", [$varData, $readOnly, $varId, $_SESSION['app']]);
|
||||
|
||||
if ($query->affected_rows > 0) {
|
||||
dashboard\primary\success("Successfully edited variable");
|
||||
}
|
||||
else {
|
||||
dashboard\primary\error("Failed to edit variable");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">User Variables</h1>
|
||||
<p class="text-xs text-gray-500">Pass, assign, obtain data uniquely for each user. <a
|
||||
href="https://keyauthdocs.apidog.io/sellerapi/users/retrive-user-variable-data" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.</p>
|
||||
<br>
|
||||
<div class="overflow-x-auto">
|
||||
|
||||
<!-- Alert Box -->
|
||||
<div id="alert-4" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
These are user variables. You must use getvar() and setvar() functions in the examples to access these.
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
<!-- User Variable Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="set-user-var-modal" data-modal-target="set-user-var-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i>Set User Variable
|
||||
</button>
|
||||
<!-- End User Variable Functions -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Delete User Variable Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-vars-modal" data-modal-target="delete-all-vars-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Variables
|
||||
</button>
|
||||
<!-- End Delete User Variable Functions -->
|
||||
|
||||
<!-- Set User Var Modal -->
|
||||
<div id="set-user-var-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Set User Variable</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="user" name="user"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder="Type username here" placeholder=" " autocomplete="on">
|
||||
<label for="user"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">User</label>
|
||||
</div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="var" name="var"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder="" autocomplete="on" list="vars" required>
|
||||
<datalist id="vars">
|
||||
<?php
|
||||
$query = misc\mysql\query("SELECT DISTINCT `name` FROM `uservars` WHERE `app` = ?", [$_SESSION['app']]);
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
echo " <option value=\"" . $row["name"] . "\">" . $row["name"] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</datalist>
|
||||
<label for="var"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Variable</label>
|
||||
</div>
|
||||
<div class="relative mb-4">
|
||||
<label for="data" name="data"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">User
|
||||
Variable Data</label>
|
||||
<textarea id="data" name="data" rows="4"
|
||||
class="block p-2.5 w-full text-sm text-white-900 bg-[#0f0f17] rounded-lg border border-gray-700 focus:ring-blue-500 focus:border-blue-500"
|
||||
placeholder="" maxlength="500" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center mb-4">
|
||||
<input id="readOnly" name="readOnly" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked>
|
||||
<label for="readOnly"
|
||||
class="ml-2 text-sm font-medium text-white-900">Readonly</label>
|
||||
</div>
|
||||
<button name="setvar"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Set
|
||||
User Var</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Set User Var Modal -->
|
||||
|
||||
<!-- Delete All Vars Modal -->
|
||||
<div id="delete-all-vars-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
user variables. This can not be undone.
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your user variables?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-vars-modal" name="delvars"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-vars-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Vars Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_user_vars" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Variable Name</th>
|
||||
<th class="px-6 py-3">Variable Data</th>
|
||||
<th class="px-6 py-3">Username</th>
|
||||
<th class="px-6 py-3">Read Only</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a
|
||||
class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
<script>
|
||||
// Target the specific scrollable container
|
||||
let scrollableElement = document.querySelector('.relative.overflow-x-auto.shadow-md.sm\\:rounded-lg.pt-5');
|
||||
|
||||
// Function to scroll to the bottom of the element
|
||||
function scrollToBottom(el) {
|
||||
el.scrollTop = el.scrollHeight;
|
||||
}
|
||||
|
||||
// Monitor clicks on the "Actions" button and apply a delay before checking scroll position
|
||||
document.querySelectorAll('#kt_datatable_user_vars button[type="button"]').forEach(function(button) {
|
||||
button.addEventListener('click', function() {
|
||||
// Wait for a second to account for any DOM updates or animations
|
||||
setTimeout(() => {
|
||||
// Check if the current scroll position is not at the bottom after updates
|
||||
if (scrollableElement.scrollHeight - scrollableElement.clientHeight > scrollableElement.scrollTop) {
|
||||
scrollToBottom(scrollableElement);
|
||||
}
|
||||
}, 1000); // Adjust this delay as necessary
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
1210
app/pages/users.php
Normal file
1210
app/pages/users.php
Normal file
File diff suppressed because it is too large
Load Diff
279
app/pages/vars.php
Normal file
279
app/pages/vars.php
Normal file
@@ -0,0 +1,279 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if($role == "Manager" && !($permissions & 128)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view vars.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page!");
|
||||
die();
|
||||
}
|
||||
if(!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
|
||||
if (isset($_POST['genvar'])) {
|
||||
if ($_SESSION['role'] == "tester") {
|
||||
if(strlen($_POST['vardata']) > 100) {
|
||||
dashboard\primary\error("Must upgrade to developer or seller to create variables longer than 100 characters!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
$query = misc\mysql\query("SELECT count(*) AS 'numVars' FROM `vars` WHERE `app` = ?",[$_SESSION['app']]);
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
$numVars = $row["numVars"];
|
||||
if($numVars >= 5) {
|
||||
dashboard\primary\error("Must upgrade to developer or seller to create more than 5 variables!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
}
|
||||
$authed = misc\etc\sanitize($_POST['authed']) == NULL ? 0 : 1;
|
||||
$resp = misc\variable\add($_POST['varname'], $_POST['vardata'], $authed);
|
||||
match($resp){
|
||||
'exists' => dashboard\primary\error("Variable name already exists!"),
|
||||
'too_long' => dashboard\primary\error("Variable too long! Must be 1000 characters or less"),
|
||||
'failure' => dashboard\primary\error("Failed to create variable"),
|
||||
'success' => dashboard\primary\success("Successfully created variable"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['delvars'])) {
|
||||
$resp = misc\variable\deleteAll();
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete all variables"),
|
||||
'success' => dashboard\primary\success("Successfully deleted all variables"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['deletevar'])) {
|
||||
$resp = misc\variable\deleteSingular($_POST['deletevar']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete variable"),
|
||||
'success' => dashboard\primary\success("Successfully deleted variable"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
// edit modal
|
||||
if (isset($_POST['editvar'])) {
|
||||
$variable = misc\etc\sanitize($_POST['editvar']);
|
||||
|
||||
$query = misc\mysql\query("SELECT * FROM `vars` WHERE `varid` = ? AND `app` = ?",[$variable, $_SESSION['app']]);
|
||||
if ($query->num_rows < 1) {
|
||||
dashboard\primary\error("Variable not Found!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
|
||||
$data = $row["msg"];
|
||||
$authed = $row["authed"];
|
||||
|
||||
echo '
|
||||
<div id="edit-variable-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Edit Variable</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<label for="msg" name="msg"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">
|
||||
Variable Data</label>
|
||||
<textarea id="msg" name="msg" rows="4"
|
||||
class="block p-2.5 w-full text-sm text-white-900 bg-[#0f0f17] rounded-lg border border-gray-700 focus:ring-blue-500 focus:border-blue-500"
|
||||
placeholder="" maxlength="1000" required>' . $data . '</textarea>
|
||||
<input type="hidden" name="variable" value="' . $variable . '">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="flex items-center mb-4">
|
||||
<input id="authed" name="authed" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
' . ($authed ? "checked" : "") . '>
|
||||
<label for="authed"
|
||||
class="ml-2 text-sm font-medium text-white-900">Authenticated</label>
|
||||
</div>
|
||||
|
||||
<button name="savevar"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Save
|
||||
Changes</button>
|
||||
<button
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center" onClick="window.location.href=window.location.href">Cancel
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Edit Var Modal -->';
|
||||
}
|
||||
|
||||
if (isset($_POST['savevar'])) {
|
||||
$authed = misc\etc\sanitize($_POST['authed']) == NULL ? 0 : 1;
|
||||
$resp = misc\variable\edit($_POST['variable'], $_POST['msg'], $authed);
|
||||
switch ($resp) {
|
||||
case 'success':
|
||||
misc\cache\purge('KeyAuthVar:' . $_SESSION['app'] . ':' . $_POST['variable']);
|
||||
dashboard\primary\success("Successfully edited variable!");
|
||||
break;
|
||||
}
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to edit variable!"),
|
||||
'too_long' => dashboard\primary\error("Variable too long! Must be 1000 characters or less"),
|
||||
'success' => dashboard\primary\success("Successfully edited variable!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Global Variables</h1>
|
||||
<p class="text-xs text-gray-500">Pass, assign, obtain data globally. <a
|
||||
href="https://keyauthdocs.apidog.io/api/features/retrieve-global-variable" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.</p>
|
||||
<br>
|
||||
<div class="overflow-x-auto">
|
||||
|
||||
<!-- Alert Box -->
|
||||
<div id="alert-4" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
These are global variables. You must use 'var()', not get/setvar()(aka user variables). Please
|
||||
view our <a href="https://keyauthdocs.apidog.io/api/features/retrieve-global-variable"
|
||||
class="font-semibold underline hover:no-underline">Documentation</a> to learn how to use
|
||||
global variables.
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
<!-- Global Variable Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="set-global-var-modal" data-modal-target="set-global-var-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i>Create Global Variable
|
||||
</button>
|
||||
<!-- End Global Variable Functions -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Delete Global Variable Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-vars-modal" data-modal-target="delete-all-vars-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Variables
|
||||
</button>
|
||||
<!-- End Delete Global Variable Functions -->
|
||||
|
||||
<!-- Set Global Var Modal -->
|
||||
<div id="set-global-var-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Set Global Variable</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="varname" name="varname"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="varname"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Variable
|
||||
Name</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<label for="vardata" name="vardata"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">
|
||||
Variable Data</label>
|
||||
<textarea id="vardata" name="vardata" rows="4"
|
||||
class="block p-2.5 w-full text-sm text-white-900 bg-[#0f0f17] rounded-lg border border-gray-700 focus:ring-blue-500 focus:border-blue-500"
|
||||
placeholder="" maxlength="1000" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center mb-4">
|
||||
<input id="authed" name="authed" type="checkbox"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
||||
checked>
|
||||
<label for="authed"
|
||||
class="ml-2 text-sm font-medium text-white-900">Authenticated</label>
|
||||
</div>
|
||||
<button name="genvar"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Set
|
||||
Global Var</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Create Global Var Modal -->
|
||||
|
||||
<!-- Delete All Vars Modal -->
|
||||
<div id="delete-all-vars-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
global variables. This can not be undone.
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your global variables?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-vars-modal" name="delvars"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-vars-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Vars Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_vars" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Variable Name</th>
|
||||
<th class="px-6 py-3">Variable Data</th>
|
||||
<th class="px-6 py-3">Authenticated</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a
|
||||
class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
407
app/pages/webhooks.php
Normal file
407
app/pages/webhooks.php
Normal file
@@ -0,0 +1,407 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if($role == "Manager" && !($permissions & 32)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view webhooks.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page.");
|
||||
die();
|
||||
}
|
||||
if(!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
|
||||
if (isset($_POST['genwebhook'])) {
|
||||
|
||||
if ($_SESSION['role'] == "tester") {
|
||||
dashboard\primary\error("You must upgrade to developer or seller to use webhooks!");
|
||||
} else {
|
||||
$authed = misc\etc\sanitize($_POST['authed']) == NULL ? 0 : 1;
|
||||
$resp = misc\webhook\add($_POST['webhookname'], $_POST['baselink'], $_POST['useragent'], $authed);
|
||||
match($resp){
|
||||
'invalid_url' => dashboard\primary\error("URL isn't a valid URL"),
|
||||
'no_local' => dashboard\primary\error("URL can't be a local path! Must be a remote URL accessible by the open internet!"),
|
||||
'failure' => dashboard\primary\error("Failed to add webhook!"),
|
||||
'success' => dashboard\primary\success("Successfully added webhook!"),
|
||||
'empty_webhookname' => dashboard\primary\error("Wehbook name can not be empty!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['deletewebhook'])) {
|
||||
$resp = misc\webhook\deleteSingular($_POST['deletewebhook']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete webhook!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted webhook!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['delallwebhooks'])){
|
||||
$resp = misc\webhook\deleteAll();
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete all webhooks!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted all webhooks!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['editwebhook'])) {
|
||||
$webhook = misc\etc\sanitize($_POST['editwebhook']);
|
||||
|
||||
$query = misc\mysql\query("SELECT * FROM `webhooks` WHERE `webid` = ? AND `app` = ?",[$webhook, $_SESSION['app']]);
|
||||
if ($query->num_rows < 1) {
|
||||
dashboard\primary\error("Webhook not Found!");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
$row = mysqli_fetch_array($query->result);
|
||||
|
||||
$baselink = $row["baselink"];
|
||||
$useragent = $row["useragent"];
|
||||
|
||||
echo '
|
||||
<div id="edit-webhook-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed grid place-items-center h-screen bg-black bg-opacity-60 z-50 p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Edit Webhook</h3>
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="baselink" name="baselink"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $baselink . '" required>
|
||||
<label for="baselink"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Base URL:</label>
|
||||
<input type="hidden" name="webhook" value="' . $webhook . '">
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="useragent" name="useragent"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" value="' . $useragent . '" required>
|
||||
<label for="useragent"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">User-Agent:</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<button name="savewebhook"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center" value="' . $file . '">Save
|
||||
Changes</button>
|
||||
<button
|
||||
class="w-full text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center" onClick="window.location.href=window.location.href">Cancel
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Edit Account Modal -->';
|
||||
}
|
||||
|
||||
if (isset($_POST['savewebhook'])) {
|
||||
$webhook = misc\etc\sanitize($_POST['webhook']);
|
||||
|
||||
$baselink = misc\etc\sanitize($_POST['baselink']);
|
||||
$useragent = misc\etc\sanitize($_POST['useragent']);
|
||||
|
||||
if (!filter_var($baselink, FILTER_VALIDATE_URL)) {
|
||||
dashboard\primary\error("URL isn't a valid URL");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
if(str_contains($baselink, "localhost") || str_contains($baselink, "127.0.0.1")) {
|
||||
dashboard\primary\error("URL can't be a local path! Must be a remote URL accessible by the open internet");
|
||||
echo "<meta http-equiv='Refresh' Content='2'>";
|
||||
return;
|
||||
}
|
||||
|
||||
misc\mysql\query("UPDATE `webhooks` SET `baselink` = ?,`useragent` = ? WHERE `webid` = ? AND `app` = ?",[$baselink, $useragent, $webhook, $_SESSION['app']]);
|
||||
|
||||
dashboard\primary\success("Successfully Updated Settings!");
|
||||
misc\cache\purge('KeyAuthWebhook:' . $_SESSION['app'] . ':' . $webhook);
|
||||
}
|
||||
|
||||
if (isset($_POST["selected"]) && isset($_POST["action"])) {
|
||||
$selected = json_decode($_POST["selected"]);
|
||||
if ($_POST["action"] == "delete") {
|
||||
foreach ($selected as $webhook) {
|
||||
$resp = misc\webhook\deleteSingular($webhook);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete webhook!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted webhook!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
}
|
||||
else if ($_POST["action"] == "authEnable") {
|
||||
foreach ($selected as $value) {
|
||||
$query = misc\mysql\query("UPDATE `webhooks` SET `authed` = 1 WHERE `app` = ? AND `webid` = ?", [$_SESSION['app'], $value]);
|
||||
|
||||
if ($query->affected_rows != 0) {
|
||||
misc\cache\purge('KeyAuthFile:' . ($secret ?? $_SESSION['app']) . ':' . $fileid);
|
||||
dashboard\primary\success("Successfully updated webhooks!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to update webhooks");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ($_POST["action"] == "authDisable") {
|
||||
foreach ($selected as $value) {
|
||||
$query = misc\mysql\query("UPDATE `webhooks` SET `authed` = 0 WHERE `app` = ? AND `webid` = ?", [$_SESSION['app'], $value]);
|
||||
|
||||
if ($query->affected_rows != 0) {
|
||||
misc\cache\purge('KeyAuthFile:' . ($secret ?? $_SESSION['app']) . ':' . $fileid);
|
||||
dashboard\primary\success("Successfully updated webhooks!");
|
||||
} else {
|
||||
dashboard\primary\error("Failed to update webhooks");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
dashboard\primary\error("Invalid action");
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Webhooks</h1>
|
||||
<p class="text-xs text-gray-500">Send and receive secure requests. <a
|
||||
href="https://keyauthdocs.apidog.io/api/features/webhook" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
|
||||
<!-- Alert Box -->
|
||||
<div id="alert-4" class="flex items-center p-4 mb-4 text-yellow-800 rounded-lg bg-[#09090d]"
|
||||
role="alert">
|
||||
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
|
||||
</svg>
|
||||
<span class="sr-only">Info</span>
|
||||
<div class="ml-3 text-sm font-medium text-yellow-500">
|
||||
People often this mistake this for Discord webhooks. Please view our <a
|
||||
href="https://keyauthdocs.apidog.io/api/features/webhook"
|
||||
class="font-semibold underline hover:no-underline">Documentation</a> to learn how to
|
||||
send Discord webhooks.
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Alert Box -->
|
||||
|
||||
<!-- Webhooks Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="create-webhook-modal" data-modal-target="create-webhook-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i>Create Webhook
|
||||
</button>
|
||||
<!-- End Webhooks Functions -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Delete Webhooks Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-webhooks-modal" data-modal-target="delete-all-webhooks-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Webhooks
|
||||
</button>
|
||||
|
||||
<button id="dropdownselection" data-dropdown-toggle="webhookdropdown"
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200 hidden"
|
||||
type="button">Selection Options
|
||||
</button>
|
||||
|
||||
<div id="webhookdropdown" class="z-10 hidden bg-[#09090d] divide-y divide-gray-100 rounded-lg shadow w-44">
|
||||
<ul class="py-2 text-sm text-white">
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Delete Selected</a>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="authEnable">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Turn on authenticated</a>
|
||||
</form>
|
||||
</li>
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="authDisable">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Turn off authenticated</a>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- End Delete Webhooks Functions -->
|
||||
|
||||
<!-- Create Create A Webhook Modal -->
|
||||
<div id="create-webhook-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-blue-700 shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Generate A Webhook</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="webhookname" name="webhookname"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="webhookname"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Webhook
|
||||
Name (optional)</label>
|
||||
</div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="baselink" name="baselink"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="baselink"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Webhook
|
||||
Endpoint</label>
|
||||
</div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="useragent" name="useragent"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on">
|
||||
<label for="useragent"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">User
|
||||
Agent (Default is KeyAuth)</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input checked id="authed" type="checkbox" name="authed"
|
||||
class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 focus:ring-2 ">
|
||||
<label for="authed"
|
||||
class="ml-2 text-sm font-medium text-white-900 ">Authenticated</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" name="genwebhook"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Generate
|
||||
Webhook</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Create A Webhook Modal -->
|
||||
|
||||
<!-- Delete All Webhooks Modal -->
|
||||
<div id="delete-all-webhooks-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
webhooks. This can not be undone.
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your webhooks?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-webhooks-modal" name="delallwebhooks"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-webhooks-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Webhooks Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_webhooks" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Select</th>
|
||||
<th class="px-6 py-3">ID</th>
|
||||
<th class="px-6 py-3">Endpoint</th>
|
||||
<th class="px-6 py-3">User-Agent</th>
|
||||
<th class="px-6 py-3">Authenticated</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ($_SESSION['app']) {
|
||||
$query = misc\mysql\query("SELECT * FROM `webhooks` WHERE `app` = ?",[$_SESSION['app']]);
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
|
||||
echo "<tr>";
|
||||
|
||||
echo '<td> <input type="checkbox" style="outline:none;"class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 checkbox" value="' . $row["webid"] .'">' . '</td>';
|
||||
|
||||
echo " <td>" . $row["webid"] . "</td>";
|
||||
|
||||
echo " <td><span class=\"blur-sm hover:blur-none\">" . $row["baselink"] . "</span></td>";
|
||||
|
||||
echo " <td>" . $row["useragent"] . "</td>";
|
||||
|
||||
echo " <td>" . (($row["authed"] ? 1 : 0) ? 'True' : 'False') . "</td>";
|
||||
|
||||
echo '<form method="POST">
|
||||
<td>
|
||||
|
||||
<div x-data="{ open: false }" class="z-0">
|
||||
<button x-on:click="open = true" class="flex items-center border border-gray-700 rounded-lg focus:opacity-60 text-white focus:text-white font-semibold rounded focus:outline-none focus:shadow-inner py-2 px-4" type="button">
|
||||
<span class="mr-1">Actions</span>
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" style="margin-top:3px">
|
||||
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<ul x-show="open" x-on:click.away="open = false" class="bg-[#09090d] text-white rounded shadow-lg absolute py-2 mt-1" style="min-width:15rem">
|
||||
<li>
|
||||
<button name="deletewebhook" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="' . $row["webid"] . '">
|
||||
Delete Webhook
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button name="editwebhook" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-blue-700"
|
||||
value="' . $row["webid"] . '">
|
||||
Edit Webhook
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</tr>
|
||||
</td>
|
||||
</form>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a
|
||||
class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
219
app/pages/webloader.php
Normal file
219
app/pages/webloader.php
Normal file
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] != "seller") {
|
||||
misc\auditLog\send("Attempted (and failed) to view webloader.");
|
||||
dashboard\primary\error("Non-Sellers aren't allowed here.");
|
||||
die();
|
||||
}
|
||||
if(!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
if (isset($_POST['addButton'])) {
|
||||
$resp = misc\button\addButton($_POST['text'], $_POST['value']);
|
||||
match($resp){
|
||||
'success' => dashboard\primary\success("Successfully added button!"),
|
||||
'failure' => dashboard\primary\error("Failed to add button!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST['delButton'])) {
|
||||
$resp = misc\button\deleteButton($_POST['delButton']);
|
||||
match($resp){
|
||||
'success' => dashboard\primary\success("Successfully deleted button!"),
|
||||
'failure' => dashboard\primary\error("Failed to delete button!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
|
||||
if (isset($_POST["selected"]) && isset($_POST["action"])) {
|
||||
$selected = json_decode($_POST["selected"]);
|
||||
|
||||
if ($_POST["action"] == "delete"){
|
||||
foreach ($selected as $buttons){
|
||||
$resp = misc\button\deleteButton($buttons);
|
||||
match($resp){
|
||||
'success' => dashboard\primary\success("Successfully deleted button!"),
|
||||
'failure' => dashboard\primary\error("Failed to delete button!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
} else {
|
||||
dashboard\primary\error("Invalid action!");
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl ">Web Loader</h1>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Webloader Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="create-button-modal" data-modal-target="create-button-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i>Create Button
|
||||
</button>
|
||||
<br>
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-buttons-modal" data-modal-target="delete-all-buttons-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Buttons
|
||||
</button>
|
||||
|
||||
<button id="dropdownselection" data-dropdown-toggle="webloaderdropdown"
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200 hidden"
|
||||
type="button">Selection Options
|
||||
</button>
|
||||
|
||||
<div id="webloaderdropdown" class="z-10 hidden bg-[#09090d] divide-y divide-gray-100 rounded-lg shadow w-44">
|
||||
<ul class="py-2 text-sm text-white">
|
||||
<li>
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<input type="hidden" id="selected" name="selected">
|
||||
<a href="#" onclick="this.parentNode.submit();" class="block px-4 py-2 focus:bold ml-2 hover:text-red-700">Delete Selected</a>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- End Webloader Functions -->
|
||||
|
||||
<!-- Create Button Modal -->
|
||||
<div id="create-button-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<button type="button"
|
||||
class="absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ml-auto inline-flex justify-center items-center"
|
||||
data-modal-hide="create-button-modal">
|
||||
<span class="sr-only">Close modal</span>
|
||||
</button>
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Create Webloader Button</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="text" name="text"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="text"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Name
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="value" name="value"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder=" " autocomplete="on" required>
|
||||
<label for="value"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">Value</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<button type="submit" name="addButton"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Create
|
||||
Webloader Button</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Create Button Modal -->
|
||||
|
||||
<!-- Delete All Buttons Modal -->
|
||||
<div id="delete-all-buttons-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of
|
||||
your webloader buttons. <b>This can
|
||||
NOT be undone</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure
|
||||
you want
|
||||
to
|
||||
delete your webloader buttons?</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-buttons-modal" name="delallbuttons"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-buttons-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Buttons Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_webloader" class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">Select</th>
|
||||
<th class="px-6 py-3">Button Text</th>
|
||||
<th class="px-6 py-3">Button Value</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ($_SESSION['app']) {
|
||||
$query = misc\mysql\query("SELECT * FROM `buttons` WHERE `app` = ?",[$_SESSION['app']]);
|
||||
if ($query->num_rows > 0) {
|
||||
while ($row = mysqli_fetch_array($query->result)) {
|
||||
|
||||
echo "<tr>";
|
||||
|
||||
echo '<td> <input type="checkbox" style="outline:none;"class="w-4 h-4 text-blue-600 bg-[#0f0f17] border-gray-300 rounded focus:ring-blue-500 checkbox" value="' . $row["value"] .'">' . '</td>';
|
||||
|
||||
echo " <td>" . $row["text"] . "</td>";
|
||||
|
||||
echo " <td>" . $row["value"] . "</td>";
|
||||
|
||||
echo '<form method="POST">
|
||||
<td>
|
||||
<div x-data="{ open: false }" class="z-0">
|
||||
<button x-on:click="open = true" class="flex items-center border border-gray-700 rounded-lg focus:opacity-60 text-white focus:text-white font-semibold rounded focus:outline-none focus:shadow-inner py-2 px-4" type="button">
|
||||
<span class="mr-1">Actions</span>
|
||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" style="margin-top:3px">
|
||||
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<ul x-show="open" x-on:click.away="open = false" class="bg-[#09090d] text-white rounded shadow-lg absolute py-2 mt-1" style="min-width:15rem">
|
||||
<li>
|
||||
<button name="delButton" class="block hover:opacity-60 whitespace-no-wrap py-2 px-4 hover:text-red-700"
|
||||
value="' . $row["value"] . '">
|
||||
Delete Button
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td></tr></form>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a
|
||||
class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
144
app/pages/whitelists.php
Normal file
144
app/pages/whitelists.php
Normal file
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
if ($_SESSION['role'] == "Reseller") {
|
||||
header("location: ./?page=reseller-licenses");
|
||||
die();
|
||||
}
|
||||
if ($role == "Manager" && !($permissions & 4096)) {
|
||||
misc\auditLog\send("Attempted (and failed) to view whitelists.");
|
||||
dashboard\primary\error("You weren't granted permission to view this page!");
|
||||
die();
|
||||
}
|
||||
if (!isset($_SESSION['app'])) {
|
||||
dashboard\primary\error("Application not selected");
|
||||
die("Application not selected.");
|
||||
}
|
||||
if (isset($_POST['addwhite'])) {
|
||||
$resp = misc\whitelist\addWhite($_POST['ip']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to add whitelist"),
|
||||
'success' => dashboard\primary\success("Successfully added whitelist"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
if (isset($_POST['deletewhite'])){
|
||||
$resp = misc\whitelist\deleteWhite($_POST['deletewhite']);
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete whitelist"),
|
||||
'success' => dashboard\primary\success("Successfully deleted whitelist"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
if (isset($_POST['delallwhites'])) {
|
||||
$resp = misc\whitelist\deleteAll();
|
||||
match($resp){
|
||||
'failure' => dashboard\primary\error("Failed to delete all whitelists!"),
|
||||
'success' => dashboard\primary\success("Successfully deleted all whitelists!"),
|
||||
default => dashboard\primary\error("Unhandled Error! Contact us if you need help")
|
||||
};
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="p-4 bg-[#09090d] block sm:flex items-center justify-between lg:mt-1.5">
|
||||
<div class="mb-1 w-full bg-[#0f0f17] rounded-xl">
|
||||
<div class="mb-4 p-4">
|
||||
<?php require '../app/layout/breadcrumb.php'; ?>
|
||||
<h1 class="text-xl font-semibold text-white-900 sm:text-2xl">Whitelists</h1>
|
||||
<p class="text-xs text-gray-500">Allow access from certain IPs <a
|
||||
href="https://keyauthdocs.apidog.io/sellerapi/whitelists/add-ip-to-whitelist" target="_blank"
|
||||
class="text-blue-600 hover:underline">Learn More</a>.</p>
|
||||
<br>
|
||||
<div class="p-4 flex flex-col">
|
||||
<div class="overflow-x-auto">
|
||||
<!-- Whitelists Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-blue-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="add-whitelist-modal" data-modal-target="add-whitelist-modal">
|
||||
<i class="lni lni-circle-plus mr-2 mt-1"></i>Create Whitelist
|
||||
</button>
|
||||
<!-- End Whitelists Functions -->
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Delete Whitelists Functions -->
|
||||
<button
|
||||
class="inline-flex text-white bg-red-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200"
|
||||
data-modal-toggle="delete-all-whitelists-modal" data-modal-target="delete-all-whitelists-modal">
|
||||
<i class="lni lni-trash-can mr-2 mt-1"></i>Delete All Whitelists
|
||||
</button>
|
||||
<!-- End Delete Blacklists Functions -->
|
||||
|
||||
<!-- Add To Whitelist Modal -->
|
||||
<div id="add-whitelist-modal" tabindex="-1" aria-hidden="true"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-[#0f0f17] rounded-lg border border-[#1d4ed8] shadow">
|
||||
<div class="px-6 py-6 lg:px-8">
|
||||
<h3 class="mb-4 text-xl font-medium text-white-900">Add Whitelist</h3>
|
||||
<hr class="h-px mb-4 mt-4 bg-gray-700 border-0">
|
||||
<form class="space-y-6" method="POST">
|
||||
<div>
|
||||
<div class="relative mb-4">
|
||||
<input type="text" id="ip" name="ip"
|
||||
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-white bg-transparent rounded-lg border-1 border-gray-700 appearance-none focus:ring-0 peer"
|
||||
placeholder="" autocomplete="on" required>
|
||||
<label for="ip"
|
||||
class="absolute text-sm text-gray-400 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-[#0f0f17] px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">IP
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" name="addwhite"
|
||||
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Whitelist</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Add Whitelist Modal -->
|
||||
|
||||
<!-- Delete All Whitelists Modal -->
|
||||
<div id="delete-all-whitelists-modal" tabindex="-1"
|
||||
class="fixed top-0 left-0 right-0 z-50 hidden p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative w-full max-w-md max-h-full">
|
||||
<div class="relative bg-[#0f0f17] border border-red-700 rounded-lg shadow">
|
||||
<div class="p-6 text-center">
|
||||
<div class="flex items-center p-4 mb-4 text-sm text-white border border-yellow-500 rounded-lg bg-[#0f0f17]"
|
||||
role="alert">
|
||||
<span class="sr-only">Info</span>
|
||||
<div>
|
||||
<span class="font-medium">Notice!</span> You're about to delete all of your
|
||||
Whitelists. Are you sure you want to continue?
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<h3 class="mb-5 text-lg font-normal text-gray-200">Are you sure you want to delete
|
||||
all of your Whitelists? This can not be undone.</h3>
|
||||
<form method="POST">
|
||||
<button data-modal-hide="delete-all-whitelists-modal" name="delallwhites"
|
||||
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Yes, I'm sure
|
||||
</button>
|
||||
<button data-modal-hide="delete-all-whitelists-modal" type="button"
|
||||
class="inline-flex text-white bg-gray-700 hover:opacity-60 focus:ring-0 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 transition duration-200">No,
|
||||
cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Delete All Whitelists Modal -->
|
||||
|
||||
<!-- START TABLE -->
|
||||
<div class="relative overflow-x-auto shadow-md sm:rounded-lg pt-5">
|
||||
<table id="kt_datatable_whitelists"
|
||||
class="w-full text-sm text-left text-white">
|
||||
<thead>
|
||||
<tr class="fw-bolder fs-6 text-blue-700 px-7">
|
||||
<th class="px-6 py-3">IP</th>
|
||||
<th class="px-6 py-3">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<p class="text-xs text-red-600">Dropdown actions in <b>RED</b> do not show a confirmation!<a class="text-blue-700"> Dropdown actions in <b>BLUE</b> will show a confirmation!</a></p>
|
||||
|
||||
Reference in New Issue
Block a user