result); $oldHwid = $row["hwid"]; $oldHwid = $oldHwid .= $hwid; $query = misc\mysql\query("UPDATE `users` SET `hwid` = ? WHERE `username` = ? AND `app` = ?", [$oldHwid, $un, $_SESSION['app']]); if ($query->affected_rows) { dashboard\primary\success("Successfully updated user!"); misc\cache\purge('KeyAuthUser:' . $_SESSION['app'] . ':' . $un); misc\cache\purge('KeyAuthUserData:' . $_SESSION['app'] . ':' . $un); } else { dashboard\primary\error("Failed to update user!"); } } if (isset($username) && trim($username) != '') { $resp = misc\user\changeUsername($un, $username, $_SESSION['app']); match($resp){ 'already_used' => dashboard\primary\error("Username already used!"), 'failure' => dashboard\primary\error("Failed to change username!"), 'success' => dashboard\primary\success("Successfully changed username!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($pass) && trim($pass) != '') { $resp = misc\user\changePassword($un, $pass, $_SESSION['app']); match($resp){ 'failure' => dashboard\primary\error("Failed to change password!"), 'success' => dashboard\primary\success("Successfully changed password!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($email) && trim($email) != '') { $resp = misc\user\changeEmail($un, $email, $_SESSION['app']); match($resp){ 'failure' => dashboard\primary\error("Failed to change email!"), 'success' => dashboard\primary\success("Successfully changed email!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } /*if (isset($client2fa)){ $resp = misc\user\disable2fa($un, $_SESSION['app']); match($resp){ 'failure' => dashboard\primary\error("Failed to disabled 2fa"), 'success' => dashboard\primary\success("Successfully disabled 2fa"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; }*/ } if (isset($_POST['deletevar'])) { $resp = misc\user\deleteVar(urldecode($_POST['deletevar']), $_POST['var']); 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") }; } if (isset($_POST['deletesub'])) { $sub = misc\etc\sanitize($_POST['sub']); $resp = misc\user\deleteSub(urldecode($_POST['deletesub']), $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") }; } if (isset($_POST['dlusers'])) { echo ""; } if (isset($_POST['importusersFile'])) { if ($_FILES['file_input']['error'] === UPLOAD_ERR_OK){ $fileContent = file_get_contents($_FILES['file_input']['tmp_name']); $json = json_decode($fileContent); if ($json === null){ dashboard\primary\error("Invalid JSON file. Double check the format you're selecting."); echo ""; return; } if (!isset($json->users)){ dashboard\primary\error("Missing 'users' section in import file."); echo ""; return; } if (!isset($json->subscription)){ dashboard\primary\error("Missing 'subscription' section in import file."); echo ""; return; } if (!isset($json->tokens)){ dashboard\primary\error("Missing 'tokens' section in import file."); echo ""; return; } if (isset($json->users) && isset($json->subscription) && isset($json->tokens)){ foreach ($json->users as $user){ $username = $user->username; $email = $user->email; $password = $user->password; $hwid = $user->hwid; $createdate = $user->createdate; $lastlogin = $user->lastlogin; $banned = $user->banned; $ip = $user->ip; $cooldown = $user->cooldown; $users = misc\mysql\query("SELECT * FROM `users` WHERE `app` = ?", [$_SESSION["app"]]); $userrows = mysqli_fetch_all($users->result, MYSQLI_ASSOC); foreach ($userrows as $user) { if ($user["username"] === $username) { dashboard\primary\error("User $username Already Exists"); return; } } misc\mysql\query("INSERT INTO `users` (`username`, `email`, `password`, `hwid`, `createdate`, `lastlogin`, `banned`, `ip`, `cooldown`, `app`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", [$username, $email, $password, $hwid, $createdate, $lastlogin, $banned, $ip, $cooldown, $_SESSION['app']]); } foreach ($json->subscription as $sub){ $username = $sub->user; $subscription = $sub->subscription; $expiry = $sub->expiry; $paused = $sub->paused; misc\mysql\query("INSERT INTO `subs` (`user`, `subscription`, `expiry`, `paused`, `app`) VALUES (?, ?, ?, ?, ?)", [$username, $subscription, $expiry, $paused, $_SESSION['app']]); } foreach ($json->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 user!"); } else { dashboard\primary\error("Invalid JSON file. Double check the format you're selecting."); } } else { dashboard\primary\error("Unhandled Error! Contact support if you need help!"); } } if (isset($_POST['extenduser'])) { $activeOnly = ($_POST['activeOnly'] == "on") ? 1 : 0; $expiry = time() + $_POST['time'] * $_POST['expiry']; $resp = misc\user\extend(urldecode($_POST['user']), $_POST['sub'], $expiry, $activeOnly); match($resp){ 'missing' => dashboard\primary\error("User(s) not found!"), 'sub_missing' => dashboard\primary\error("Subscription not found!"), 'date_past' => dashboard\primary\error("Subscription expiry must be set in the future!"), 'failure' => dashboard\primary\error("Failed to extend user(s)"), 'success' => dashboard\primary\success("Successfully exteneded user(s)!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['subtractuser'])) { $expiry = $_POST['time'] * $_POST['expiry']; $resp = misc\user\subtract(urldecode($_POST['user']), $_POST['sub'], $expiry, $secret); match($resp){ 'invalid_seconds' => dashboard\primary\error("Seconds specified must be greater than zero"), 'failure' => dashboard\primary\error("Failed to subtract time from subscription"), 'success' => dashboard\primary\success("Successfully subtracted time from subscription"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['adduser'])) { $resp = misc\user\add(urldecode($_POST['username']), $_POST['sub'], strtotime($_POST['expiry']), NULL, $_POST['password']); match($resp){ 'already_exist' => dashboard\primary\error("Username already exists!"), 'sub_missing' => dashboard\primary\error("Subscription not found!"), 'date_past' => dashboard\primary\error("Subscription expiry must be set in the future!"), 'username_not_allowed' => dashboard\primary\error("This username is not allowed!"), 'sub_paused' => dashboard\primary\error("Unable to create user while subscription is paused!"), 'failure' => dashboard\primary\error("Failed to create user!"), 'success' => dashboard\primary\success("Successfully created user!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['delexpusers'])) { $resp = misc\user\deleteExpiredUsers(); match($resp){ 'missing' => dashboard\primary\error("You do not have users!"), 'failure' => dashboard\primary\error("No users are expired!"), 'success' => dashboard\primary\success("Successfully deleted expired users!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['delusers'])) { $resp = misc\user\deleteAll(); match($resp){ 'failure' => dashboard\primary\error("Failed to delete all users!"), 'success' => dashboard\primary\success("Successfully deleted all users!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['resetall'])) { $resp = misc\user\resetAll(); match($resp){ 'failure' => dashboard\primary\error("Failed to reset all users!"), 'success' => dashboard\primary\success("Successfully reset all users!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['unbanall'])) { $resp = misc\user\unbanAll(); match($resp){ 'failure' => dashboard\primary\error("Failed to unban all users!"), 'success' => dashboard\primary\success("Successfully unbanned all users!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['deleteuser'])) { $resp = misc\user\deleteSingular(urldecode($_POST['deleteuser'])); match ($resp){ 'failure' => dashboard\primary\error("Failed to delete user!"), 'success' => dashboard\primary\success("Successfully deleted user!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['resetuser'])) { $resp = misc\user\resetSingular(urldecode($_POST['resetuser'])); match ($resp){ 'failure' => dashboard\primary\error("Failed to reset user!"), 'success' => dashboard\primary\success("Successfully reset user!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } 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['banuser'])) { $resp = misc\user\ban(urldecode($_POST['un']), $_POST['reason']); match($resp){ 'missing' => dashboard\primary\error("User not found!"), 'failure' => dashboard\primary\error("Failed to ban user!"), 'success' => dashboard\primary\success("Successfully banned user!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['unbanuser'])) { $resp = misc\user\unban(urldecode($_POST['unbanuser'])); match($resp){ 'missing' => dashboard\primary\error("User not found!"), 'failure' => dashboard\primary\error("Failed to unban user!"), 'success' => dashboard\primary\success("Successfully unbanned user!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['pauseuser'])) { $resp = misc\user\pauseUser(urldecode($_POST['pauseuser'])); match($resp){ 'failure' => dashboard\primary\error("Failed to pause user!"), 'success' => dashboard\primary\success("Successfully paused user!"), default => dashboard\primary\error("Unhandled Error! Contact support if you need help") }; } if (isset($_POST['unpauseuser'])) { $resp = misc\user\unpauseUser(urldecode($_POST['unpauseuser'])); match($resp){ 'failure' => dashboard\primary\error("Failed to unpause user!"), 'success' => dashboard\primary\success("Successfully unpaused user!"), default => dashboard\primary\error("Unhandled Error! Contact support if you need help") }; } if (isset($_POST["selected"]) && isset($_POST["action"])) { $selected = json_decode($_POST["selected"], true); if ($_POST["action"] == "delete") { foreach ($selected as $value) { $resp = misc\user\deleteSingular($value); match($resp){ 'failure' => dashboard\primary\error("Failed to delete user!"), 'success' => dashboard\primary\success("Successfully deleted user!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } elseif ($_POST["action"] == "unban") { foreach ($selected as $value) { $resp = misc\user\unban($value); match($resp){ 'missing' => dashboard\primary\error("User not found!"), 'failure' => dashboard\primary\error("Failed to unban user!"), 'success' => dashboard\primary\success("Successfully unbanned user!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } elseif ($_POST["action"] == "pause") { foreach ($selected as $value) { $resp = misc\user\pauseUser($value); match($resp){ 'failure' => dashboard\primary\error("Failed to pause user!"), 'success' => dashboard\primary\success("Successfully paused user!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } elseif ($_POST["action"] == "unpause") { foreach ($selected as $value) { $resp = misc\user\unpauseUser($value); match($resp){ 'failure' => dashboard\primary\error("Failed to unpause user!"), 'success' => dashboard\primary\success("Successfully unpaused user!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } elseif ($_POST["action"] == "resethwid") { foreach ($selected as $value) { $resp = misc\user\resetSingular($value); match($resp){ 'failure' => dashboard\primary\error("Failed to reset user!"), 'success' => dashboard\primary\success("Successfully reset user!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } else { dashboard\primary\error("Invalid action"); } } if (isset($_POST['edituser'])) { $un = misc\etc\sanitize(urldecode($_POST['edituser'])); $query = misc\mysql\query("SELECT * FROM `users` WHERE `username` = ? AND `app` = ?", [$un, $_SESSION['app']]); if ($query->num_rows == 0) { dashboard\primary\error("User not Found!"); echo ""; return; } $row = mysqli_fetch_array($query->result); ?>
After someone registers for your app with a license, they will appear here. Learn More.
| Select | Username | HWID | IP | Creation Date | Last Login Date | Banned? | Actions |
|---|
Dropdown actions in RED do not show a confirmation! Dropdown actions in BLUE will show a confirmation!