Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a08a760
Implement Security Tab and moved Secuirty related stuff to it
TheSCREWEDSoftware Jun 6, 2026
ebdcf41
Config for Allow previous used passwords
TheSCREWEDSoftware Jun 6, 2026
0f2a45d
Clear the previous description
TheSCREWEDSoftware Jun 6, 2026
8243321
PasswordHandler creation
TheSCREWEDSoftware Jun 6, 2026
7d02230
Show the user before submit if the new pw matches or not
TheSCREWEDSoftware Jun 6, 2026
4eaa629
Added DarkMode.php require.
TheSCREWEDSoftware Jun 6, 2026
4f531cc
Shared Styles for Each Profile Page
TheSCREWEDSoftware Jun 6, 2026
c2b0a22
Use the existing selector of characters and make it clickable
TheSCREWEDSoftware Jun 6, 2026
d23d348
Dark mode and dark / white button
TheSCREWEDSoftware Jun 6, 2026
e279419
Add a order default button (when the user gets a charc stuck in limbo)
TheSCREWEDSoftware Jun 6, 2026
49405ed
Class Colours
TheSCREWEDSoftware Jun 6, 2026
fcc5c99
Dark mode additions
TheSCREWEDSoftware Jun 6, 2026
2b5aaf6
Modernise expnasion selector
TheSCREWEDSoftware Jun 6, 2026
b750eee
Make sure the expansion is always displayed correctly
TheSCREWEDSoftware Jun 6, 2026
3fecc44
Selectors
TheSCREWEDSoftware Jun 6, 2026
de52c1c
Modernise
TheSCREWEDSoftware Jun 6, 2026
62a36d2
Base
TheSCREWEDSoftware Jun 7, 2026
c291228
Base broken maybe
TheSCREWEDSoftware Jun 7, 2026
8f3fa2a
Fixed
TheSCREWEDSoftware Jun 7, 2026
7c0b9ac
Mail fixed
TheSCREWEDSoftware Jun 7, 2026
325b367
Update ItemRestorationPage.php
TheSCREWEDSoftware Jun 7, 2026
fc51b06
Base
TheSCREWEDSoftware Jun 7, 2026
3d0d4f0
Base
TheSCREWEDSoftware Jun 7, 2026
95fd5ae
Update User.php
TheSCREWEDSoftware Jun 7, 2026
b9d3fd4
Update Tools.php
TheSCREWEDSoftware Jun 7, 2026
16b6231
Update CharactersView.php
TheSCREWEDSoftware Jun 7, 2026
a796bcf
Update User.php
TheSCREWEDSoftware Jun 7, 2026
99bacd5
Update ServerInfoApi.php
TheSCREWEDSoftware Jun 19, 2026
e2eb2aa
Security
TheSCREWEDSoftware Jun 19, 2026
5daf288
Dark theme
TheSCREWEDSoftware Jun 20, 2026
6b64538
Dark theme MyCred "Points History"
TheSCREWEDSoftware Jun 20, 2026
3fc5117
Make security widget dark theme
TheSCREWEDSoftware Jun 20, 2026
aa3b04f
Cleanup Secuirty 2FA intsustcotrs
TheSCREWEDSoftware Jun 20, 2026
d1aa9fe
Improvements to IP Logging
TheSCREWEDSoftware Jun 21, 2026
3204234
Expand the logging login and infinite scrolling to the Tools tab admins
TheSCREWEDSoftware Jun 21, 2026
aca7a16
Dark theme tweaks
TheSCREWEDSoftware Jun 21, 2026
22dee4e
Removed the mock / testing for IPs
TheSCREWEDSoftware Jun 21, 2026
72a4b26
Merge branch 'master' into user_info_master
TheSCREWEDSoftware Jun 21, 2026
7a67baa
Ensure the password both wordpress and acore are changed even if they…
TheSCREWEDSoftware Jun 21, 2026
39a715f
Ensure that Module Slugs get check on check of Ream Settings
TheSCREWEDSoftware Jun 21, 2026
6be0629
Rabbit Reviews
TheSCREWEDSoftware Jun 21, 2026
8c3ad51
Rabbiet Reviews easier
TheSCREWEDSoftware Jun 22, 2026
b308e07
Rabbit Reviews bigger
TheSCREWEDSoftware Jun 22, 2026
00ac65f
Rabbit review
TheSCREWEDSoftware Jun 22, 2026
b462d5d
GeoIP implemntation for country names for Secuirty Logging
TheSCREWEDSoftware Jun 22, 2026
fcf9745
Rabbit Reviews
TheSCREWEDSoftware Jun 23, 2026
9c4e59a
Rabbit Review
TheSCREWEDSoftware Jun 23, 2026
0c4d613
Rabbit review
TheSCREWEDSoftware Jun 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<h2> <?= __('AzerothCore Settings', Opts::I()->page_alias) ?></h2>
<p>Configure database connection for Eluna script that need use of the CMS.</p>
<form name="form-acore-eluna-settings" method="post" action="">
<?php wp_nonce_field('acore_eluna_settings_save', 'acore_eluna_settings_nonce'); ?>
<div class="row">
<div class="col-sm-6">
<div class="card p-0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<h5>Give rewards</h5>
<hr>
<form name="pvp-rewards" method="post" id="pvp-rewards" class="initial-form hide-if-no-js">
<?php wp_nonce_field('acore_pvp_rewards_save', 'acore_pvp_rewards_nonce'); ?>
<input type="hidden" name="page" value="<?= ACORE_SLUG . '-pvp-rewards'; ?>" />
<table class="form-table table table-borderless" role="presentation">
<tbody>
Expand Down
614 changes: 376 additions & 238 deletions src/acore-wp-plugin/src/Components/AdminPanel/Pages/RealmSettings.php

Large diffs are not rendered by default.

583 changes: 515 additions & 68 deletions src/acore-wp-plugin/src/Components/AdminPanel/Pages/Tools.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public function loadSettings() {
// If they did, this hidden field will be set to 'Y'

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
check_admin_referer('acore_realm_settings_save', 'acore_realm_settings_nonce');

foreach (Opts::I()->getConfs() as $key => $value) {
if (isset($_POST[$key])) {
$this->storeConf($key, $_POST[$key]);
Expand Down Expand Up @@ -84,6 +86,8 @@ public function loadElunaSettings() {
// If they did, this hidden field will be set to 'Y'

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
check_admin_referer('acore_eluna_settings_save', 'acore_eluna_settings_nonce');

foreach (Opts::I()->getConfs() as $key => $value) {
if (isset($_POST[$key])) {
$this->storeConf($key, $_POST[$key]);
Expand Down Expand Up @@ -131,6 +135,7 @@ public function loadPvpRewards() {
//! DEV NOTE: Put the rest of stuff within try { ... } check to handle every exception properly
try {
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
check_admin_referer('acore_pvp_rewards_save', 'acore_pvp_rewards_nonce');
global $wpdb;
$tableResult = $wpdb->query("CREATE TEMPORARY TABLE temp_pvp_rewards (
`account` VARCHAR(255) COLLATE utf8_unicode_ci,
Expand Down Expand Up @@ -385,6 +390,8 @@ public function loadTools() {
//! DEV NOTE: Put the rest of stuff within try { ... } check to handle every exception properly
try {
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
check_admin_referer('acore_tools_save', 'acore_tools_nonce');

foreach (Opts::I()->getConfs() as $key => $value) {
if (isset($_POST[$key])) {
if ($key == 'acore_name_unlock_allowed_banned_names_table') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ public function __construct() {

public function loadHome() {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$this->saveCharacterOrder();
?>
<div class="updated"><p><strong>Character settings succesfully saved.</strong></p></div>
<?php
check_admin_referer('acore_character_order', 'acore_character_order_nonce');
if (isset($_POST["acore_reset_order"])) {
$this->resetCharacterOrder();
?>
<div class="updated"><p><strong>Character order reset successfully.</strong></p></div>
<?php
} else {
$this->saveCharacterOrder();
?>
<div class="updated"><p><strong>Character settings succesfully saved.</strong></p></div>
<?php
}
}

$accId = ACoreServices::I()->getAcoreAccountId();
Expand All @@ -38,6 +46,16 @@ public function getView() {
return $this->view;
}

private function resetCharacterOrder() {
$accId = ACoreServices::I()->getAcoreAccountId();
$conn = ACoreServices::I()->getCharacterEm()->getConnection();
$stmt = $conn->prepare(
"UPDATE `characters` SET `order` = NULL WHERE `account` = ? AND `deleteDate` IS NULL"
);
$stmt->bindValue(1, $accId);
$stmt->executeQuery();
}

private function saveCharacterOrder() {
if (!isset($_POST) || !isset($_POST["characterorder"])) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace ACore\Components\CharactersMenu;

use ACore\Utils\AcoreCharColors;

class CharactersView {
private $controller;

Expand All @@ -16,44 +18,47 @@ public function __construct($controller) {
public function getHomeRender($characters) {
ob_start();
wp_enqueue_style('bootstrap-css', '//cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css', array(), '5.1.3');
wp_enqueue_style('acore-css', ACORE_URL_PLG . 'web/assets/css/main.css', array(), '0.1');
wp_enqueue_style('acore-css', ACORE_URL_PLG . 'web/assets/css/main.css', array(), '0.5');
wp_enqueue_script('bootstrap-js', '//cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js', array(), '5.1.3');
wp_enqueue_script('jquery-ui-sortable');
?>
<div class="wrap">
<h2>Characters Settings</h2>
<p>Check some details and configure of your characters.</p>

<div class="row">
<div class="col-sm-4">
<div class="card">
<div class="card-body">
<h3>Order</h3>
<p>Change the order in which the characters appear in your in-game character selection screen.</p>
<h3>Order Character Screen</h3>
<p>Change the order in which the characters appear in your in-game character selection screen, by dragging them, matches in-game position.</p>
<hr>
<form action="" method="POST" novalidate="novalidate">
<?php wp_nonce_field('acore_character_order', 'acore_character_order_nonce'); ?>

<ul id="acore-characters-order" class="list-unstyled">
<?php foreach ($characters as $char) { ?>
<ul id="acore-characters-order" class="acore-char-list list-unstyled">
<?php $charPos = 0; foreach ($characters as $char) {
$clsStyle = AcoreCharColors::rowStyle(intval($char["class"]), intval($char["race"]));
$charPos++;
$displayPos = $char['order'] !== null ? intval($char['order']) + 1 : $charPos;
?>
<li>
<div class="menu-item-bar">
<div class="menu-item-handle ui-sortable-handle">
<span class="item-title menu-item-title"><?= $char["name"] ?></span>
<span class="item-controls">
<span class="item-type">
level <?= $char["level"] ?>&ensp;
<img src="<?= ACORE_URL_PLG . "web/assets/race/" . $char["race"] . ($char["gender"] == 0 ? "m" : "f") . ".webp"; ?>">
<img src="<?= ACORE_URL_PLG . "web/assets/class/" . $char["class"] . ".webp"; ?>">
</span>
</div>
<div class="acore-char-row" style="<?= esc_attr($clsStyle) ?>">
<span class="acore-char-pos"><?= $displayPos ?></span>
<span class="acore-char-name"><?= esc_html($char["name"]) ?></span>
<span class="acore-char-meta">
<span class="acore-level" data-exp="<?= AcoreCharColors::expansionSlug(intval($char["level"])) ?>" title="<?= esc_attr(AcoreCharColors::expansionLabel(intval($char["level"]))) ?>">Level <?= intval($char["level"]) ?></span>
<img class="race-icon" height="32" width="32" title="<?= esc_attr(AcoreCharColors::getRaceName(intval($char["race"]))) ?>" src="<?= esc_url(ACORE_URL_PLG . "web/assets/race/" . intval($char["race"]) . (intval($char["gender"]) == 0 ? "m" : "f") . ".webp") ?>">
<img class="class-icon" height="32" width="32" title="<?= esc_attr(AcoreCharColors::getClassName(intval($char["class"]))) ?>" src="<?= esc_url(ACORE_URL_PLG . "web/assets/class/" . intval($char["class"]) . ".webp") ?>">
</span>
</div>
<input name="characterorder[]" value="<?= $char["guid"] ?>">
<input type="hidden" name="characterorder[]" value="<?= esc_attr($char["guid"]) ?>">
</li>
<?php } ?>
</ul>

<?php if (!empty($characters)) { ?>
<input type="submit" name="submit" class="button button-primary" value="Save Order">
<div style="display:flex; justify-content:space-between; align-items:center; margin-top:8px;">
<input type="submit" name="submit" class="button button-primary" value="Save Order">
<input type="submit" name="acore_reset_order" class="button acore-btn-danger" value="Reset Order">
</div>
<?php } ?>
</form>
</div>
Expand All @@ -62,12 +67,23 @@ public function getHomeRender($characters) {
</div>
</div>

<script type="text/javascript">
jQuery(document).ready(function($) {
$("#acore-characters-order").sortable();
<!-- .acore-btn-danger styling lives in theme.css (shared light/dark) -->

<script>
jQuery(document).ready(function($) {
$("#acore-characters-order").sortable({
update: function(event, ui) {
var order = [];
$("#acore-characters-order li").each(function(index) {
var input = $(this).find("input[name='characterorder[]']");
order.push(input.val());
$(this).find(".acore-char-pos").text(index + 1);
});
}
});
$("#acore-characters-order").disableSelection();
});
</script>

<?php
return ob_get_clean();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static function getSentUnreadMails($charGuid)

// Get mails sent by this character that are unread by the receiver
// messageType = 0 means player mail
$query = "SELECT m.`id`, m.`subject`, m.`has_items`, m.`money`,
$query = "SELECT m.`id`, m.`subject`, m.`has_items`, m.`money`, m.`cod`,
m.`expire_time`, m.`deliver_time`,
rc.`name` AS receiver_name, rc.`race` AS receiver_race,
rc.`class` AS receiver_class, rc.`gender` AS receiver_gender,
Expand Down Expand Up @@ -94,7 +94,7 @@ public static function getSentUnreadMails($charGuid)
$placeholders = implode(',', array_fill(0, count($mailIds), '?'));
$worldDb = Opts::I()->acore_db_world_name;
$itemQuery = "SELECT mi.`mail_id`, ii.`itemEntry`, ii.`count`,
it.`name` AS item_name
it.`name` AS item_name, it.`Quality` AS item_quality
FROM `mail_items` mi
JOIN `item_instance` ii ON mi.`item_guid` = ii.`guid`
JOIN `$worldDb`.`item_template` it ON ii.`itemEntry` = it.`entry`
Expand Down
Loading
Loading