• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC MyAAC v0.8.16 - cannot access admin page after installing gesior plugin

falkyon

New Member
Joined
Jun 17, 2010
Messages
5
Reaction score
2
Hello everyone, I'm having problems when installing the 'myaac-gesior-shop-system-v5.0-beta' plugin.
In the older version of MyAAc worked just fine.

I installed yesterday the lastest version and when I tried to install the plugin, it looked like everything was ok, but now I cannot access the admin pannel anymore.
When I try just receive error 500, anyone now what could that be?
(Everything else is working just fine)

With Dev mod enabled I got this:

1709292456838.png

Thank your for your attention.
 
This warning indicates that the schema of your database does not exist. Simply add the SQL and execute it, and you're good to go!
SQL:
ALTER TABLE store_history
ADD COLUMN id INT(11) NOT NULL DEFAULT 0;

or

SQL:
ALTER TABLE players ADD id int(11) NOT NULL default 0;
 
This warning indicates that the schema of your database does not exist. Simply add the SQL and execute it, and you're good to go!
SQL:
ALTER TABLE store_history
ADD COLUMN id INT(11) NOT NULL DEFAULT 0;

or

SQL:
ALTER TABLE players ADD id int(11) NOT NULL default 0;
Looks like it already exists.

1709294691792.png
 
It must be something different.

Post your file admin/pages/dashboard.php because it seems to differ from the original.
PHP:
<?php
global $db, $twig, $twig_loader, $status;
/**
 * Dashboard
 *
 * @package   MyAAC
 * @author    Slawkens <[email protected]>
 * @author    OpenTibiaBR
 * @copyright 2023 MyAAC
 * @link      https://github.com/opentibiabr/myaac
 */
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Dashboard';

if (isset($_GET['clear_cache'])) {
    if (clearCache()) {
        success('Cache cleared.');
    } else {
        error('Error while clearing cache.');
    }
}

if (isset($_GET['maintenance'])) {
    $_status = (int)$_POST['status'];
    $message = $_POST['message'];
    if (empty($message)) {
        error('Message cannot be empty.');
    } else if (strlen($message) > 255) {
        error('Message is too long. Maximum length allowed is 255 chars.');
    } else {
        $tmp = '';
        if (fetchDatabaseConfig('site_closed', $tmp))
            updateDatabaseConfig('site_closed', $_status);
        else
            registerDatabaseConfig('site_closed', $_status);

        if (fetchDatabaseConfig('site_closed_message', $tmp))
            updateDatabaseConfig('site_closed_message', $message);
        else
            registerDatabaseConfig('site_closed_message', $message);
    }
}
$is_closed = getDatabaseConfig('site_closed') == '1';

$closed_message = 'Server is under maintenance, please visit later.';
$tmp = '';
if (fetchDatabaseConfig('site_closed_message', $tmp))
    $closed_message = $tmp;

$total_accounts = $db->query('SELECT `id` FROM `accounts`;')->rowCount();
$total_players = $db->query('SELECT `id` FROM `players`;')->rowCount();
$total_guilds = $db->query('SELECT `id` FROM `guilds`;')->rowCount();
$total_houses = $db->query('SELECT `id` FROM `houses`;')->rowCount();
$total_donates = $db->hasTable('pagseguro_transactions') ? $db->query("SELECT `id` FROM `pagseguro_transactions` WHERE `payment_status` <> 'CANCELLED'")->rowCount() : null;

$twig->display('admin.statistics.html.twig', array(
    'total_accounts' => $total_accounts,
    'total_players' => $total_players,
    'total_guilds' => $total_guilds,
    'total_houses' => $total_houses,
    'total_donates' => $total_donates,
));

$twig->display('admin.dashboard.html.twig', array(
    'is_closed' => $is_closed,
    'closed_message' => $closed_message,
    'status' => $status,
    'account_type' => USE_ACCOUNT_NAME ? 'name' : 'number'
));

echo '<div class="row">';

$configAdminPanelModules = config('admin_panel_modules');
if (isset($configAdminPanelModules))
    $configAdminPanelModules = explode(',', $configAdminPanelModules);

$twig_loader->prependPath(__DIR__ . '/modules/templates');
foreach ($configAdminPanelModules as $box) {
    $file = __DIR__ . '/modules/' . $box . '.php';
    if (file_exists($file)) {
        include($file);
    }
}
echo '</div>';
 
A few other columns weren't there either. I ended up droping the pagseguro_transactions table and creating it again.
But worked haha.

SQL:
CREATE TABLE `pagseguro_transactions` (
   `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
   `transaction_code` VARCHAR(50) NOT NULL,
   `account_id` int(11) UNSIGNED NOT NULL,
   `payment_method` VARCHAR(50) NOT NULL,
   `payment_status` VARCHAR(50) NOT NULL,
   `code` VARCHAR(10) NOT NULL,
   `coins_amount` INT(11) NOT NULL,
   `bought` INT(11) DEFAULT NULL,
   `delivered` CHAR(1) NOT NULL DEFAULT '0',
   `in_double` CHAR(1) NOT NULL DEFAULT '0',
   `request` LONGTEXT DEFAULT NULL,
   `created_at` DATETIME NOT NULL,
   `updated_at` DATETIME DEFAULT NULL,
   UNIQUE KEY `transaction_code` (`transaction_code`, `payment_status`),
   CONSTRAINT `pagseguro_transactions_account_fk`
   FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`)
   ON DELETE CASCADE,
   INDEX `payment_method` (`payment_method`),
   INDEX `payment_status` (`payment_status`),
   INDEX `coins_amount` (`coins_amount`),
   INDEX `delivered` (`delivered`)
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;

I've got the code from the install.sql file in the pagseguro plugin folder.

Thank you everyone for yout time and attention.
 
A few other columns weren't there either. I ended up droping the pagseguro_transactions table and creating it again.
But worked haha.

SQL:
CREATE TABLE `pagseguro_transactions` (
   `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
   `transaction_code` VARCHAR(50) NOT NULL,
   `account_id` int(11) UNSIGNED NOT NULL,
   `payment_method` VARCHAR(50) NOT NULL,
   `payment_status` VARCHAR(50) NOT NULL,
   `code` VARCHAR(10) NOT NULL,
   `coins_amount` INT(11) NOT NULL,
   `bought` INT(11) DEFAULT NULL,
   `delivered` CHAR(1) NOT NULL DEFAULT '0',
   `in_double` CHAR(1) NOT NULL DEFAULT '0',
   `request` LONGTEXT DEFAULT NULL,
   `created_at` DATETIME NOT NULL,
   `updated_at` DATETIME DEFAULT NULL,
   UNIQUE KEY `transaction_code` (`transaction_code`, `payment_status`),
   CONSTRAINT `pagseguro_transactions_account_fk`
   FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`)
   ON DELETE CASCADE,
   INDEX `payment_method` (`payment_method`),
   INDEX `payment_status` (`payment_status`),
   INDEX `coins_amount` (`coins_amount`),
   INDEX `delivered` (`delivered`)
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;

I've got the code from the install.sql file in the pagseguro plugin folder.

Thank you everyone for yout time and attention.
Nice! But be careful with adding indexes to every column.... too many and it can be worse than having none at all...

For this table it probably wont be an issue, but having a ton of indexes on a large and busy table can have a negative impact on performance
 
Nice! But be careful with adding indexes to every column.... too many and it can be worse than having none at all...

For this table it probably wont be an issue, but having a ton of indexes on a large and busy table can have a negative impact on performance
Oh, that's good to know. I'll definitely look into that.
Thanks for the tip and for your help!
 
Back
Top