Compare commits

..

3 Commits

Author SHA1 Message Date
slawkens
7c49c16215 Use configurable API URI for plugin updates
Replaces hardcoded plugin API URI with a configurable value from config, defaulting to the official API. Also fixes a typo in the success message.
2025-06-19 16:26:16 +02:00
slawkens
1c6bb2eb8d Improve plugin update check messaging
Updated the success message when checking for plugin updates to clarify the source. Added an informational message when outdated plugins are found to improve user feedback.
2025-06-19 16:18:55 +02:00
slawkens
e91b44f036 Check plugins versions from plugins.my-aac.org/api 2025-06-18 23:16:10 +02:00
12 changed files with 24 additions and 51 deletions

View File

@@ -1,30 +1,5 @@
# Changelog # Changelog
## [1.7.1 - 27.06.2025]
### Changed
* Rename plugin:install:install to plugin:setup, also add alias to previous command (https://github.com/slawkens/myaac/commit/13d33822b59df349199e885a78a3d6beb0863d0b)
### Fixed
* Fix commands: setup + cache:clear (https://github.com/slawkens/myaac/commit/0da524fefe93b3028392e9014550eea3324d3a22, https://github.com/slawkens/myaac/commit/fe8281594e989f00280ba1adc734a9198c6b5cc1)
* Fix polls link in tibiacom template (https://github.com/slawkens/myaac/commit/d90fa323d7c77d81768df60feeb1c374b1650a0c)
## [1.7 - 22.06.2025]
### Added
* Feature: plugins versions check (#310)
* New hooks: HOOK_ACCOUNT_MANAGE_AFTER_CHARACTERS, HOOK_GUILDS_AFTER_MANAGE_BUTTON (https://github.com/slawkens/myaac/commit/c074a48f245df55646b6705737f667b6a84149b2, https://github.com/slawkens/myaac/commit/e6100a1b72de8695bba1dae9ba4e28bfdce47b10)
* Add OTS_Toolbox::getVocationName(id, promotion) + OTS_Player->isNameLocked() (https://github.com/slawkens/myaac/commit/e222957893c4a1de0dc8dbba55bce1a43418d275, https://github.com/slawkens/myaac/commit/522f6c11d835afd36fd07a07074d96d7e219b488)
* Add missing csrf in more places, causing white page with error about Request (https://github.com/slawkens/myaac/commit/dca904e61d21d856bf809070e7652803a2df0f58, https://github.com/slawkens/myaac/commit/c720ccc451ff90ef40b2a1595468d061ffd7e1e4)
### Changed
* Revamped online page (https://github.com/slawkens/myaac/commit/9a90e4aae280e607430511c6727d9a714b11f4c5, https://github.com/slawkens/myaac/commit/4767120043b09141870383e249f3729638d53dc2)
* Better $title inventing (https://github.com/slawkens/myaac/commit/0c95bcfd06b68b21512e477646ef7bd3a0d4912b)
### Fixed
* Use apcu cache clear (https://github.com/slawkens/myaac/commit/b329da52aae9d0e21120a6444d3caf442420ce50, https://github.com/slawkens/myaac/commit/566c2a9151ab6392286f74e26853faa19a1b4f24)
* fix: boostedcreatures for 13.40 (by @GooseWithAKnife) (#307)
## [1.6.1 - 11.06.2025] ## [1.6.1 - 11.06.2025]
### Fixed ### Fixed

View File

@@ -26,7 +26,7 @@
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.'); if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
const MYAAC = true; const MYAAC = true;
const MYAAC_VERSION = '1.7.1'; const MYAAC_VERSION = '1.6.1';
const DATABASE_VERSION = 45; const DATABASE_VERSION = 45;
const TABLE_PREFIX = 'myaac_'; const TABLE_PREFIX = 'myaac_';
define('START_TIME', microtime(true)); define('START_TIME', microtime(true));

View File

@@ -982,12 +982,11 @@ function load_config_lua($filename)
foreach($lines as $ln => $line) foreach($lines as $ln => $line)
{ {
$line = trim($line); $line = trim($line);
if(isset($line[0]) && ($line[0] === '{' || $line[0] === '}')) { if(@$line[0] === '{' || @$line[0] === '}') {
// arrays are not supported yet // arrays are not supported yet
// just ignore the error // just ignore the error
continue; continue;
} }
$tmp_exp = explode('=', $line, 2); $tmp_exp = explode('=', $line, 2);
if(str_contains($line, 'dofile')) { if(str_contains($line, 'dofile')) {
$delimiter = '"'; $delimiter = '"';
@@ -1264,17 +1263,20 @@ function clearCache()
global $db; global $db;
$db->setClearCacheAfter(true); $db->setClearCacheAfter(true);
}
if (function_exists('apcu_clear_cache')) { if (function_exists('apcu_clear_cache')) {
apcu_clear_cache(); apcu_clear_cache();
} }
}
deleteDirectory(CACHE . 'signatures', ['index.html'], true); deleteDirectory(CACHE . 'signatures', ['index.html'], true);
deleteDirectory(CACHE . 'twig', ['index.html'], true); deleteDirectory(CACHE . 'twig', ['index.html'], true);
deleteDirectory(CACHE . 'plugins', ['index.html'], true); deleteDirectory(CACHE . 'plugins', ['index.html'], true);
deleteDirectory(CACHE, ['signatures', 'twig', 'plugins', 'index.html', 'persistent'], true); deleteDirectory(CACHE, ['signatures', 'twig', 'plugins', 'index.html', 'persistent'], true);
// routes cache
clearRouteCache();
global $hooks; global $hooks;
$hooks->trigger(HOOK_CACHE_CLEAR, ['cache' => Cache::getInstance()]); $hooks->trigger(HOOK_CACHE_CLEAR, ['cache' => Cache::getInstance()]);

View File

@@ -8,7 +8,7 @@
* @link https://my-aac.org * @link https://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Not Found'; $title = '404 Not Found';
header('HTTP/1.0 404 Not Found'); header('HTTP/1.0 404 Not Found');
?> ?>

View File

@@ -8,7 +8,7 @@
* @link https://my-aac.org * @link https://my-aac.org
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Method Not Allowed'; $title = '405 Method Not Allowed';
header('HTTP/1.0 405 Method Not Allowed'); header('HTTP/1.0 405 Method Not Allowed');
?> ?>

View File

@@ -17,7 +17,10 @@ class CacheClearCommand extends Command
protected function execute(InputInterface $input, OutputInterface $output): int protected function execute(InputInterface $input, OutputInterface $output): int
{ {
require SYSTEM . 'init.php'; global $hooks;
$hooks = new Hooks();
$hooks->load();
$hooks->trigger(HOOK_INIT);
$io = new SymfonyStyle($input, $output); $io = new SymfonyStyle($input, $output);

View File

@@ -12,10 +12,9 @@ class MailSendCommand extends Command
{ {
protected function configure(): void protected function configure(): void
{ {
$this->setName('email:send') $this->setName('mail:send')
->setAliases(['mail:send'])
->setDescription('This command sends E-Mail to single user. Message can be provided as follows: ' . PHP_EOL ->setDescription('This command sends E-Mail to single user. Message can be provided as follows: ' . PHP_EOL
. ' echo "Hello World" | php aac email:send --subject="This is the subject" test@test.com') . ' echo "Hello World" | php sa email:send --subject="This is the subject" test@test.com')
->addArgument('recipient', InputArgument::REQUIRED, 'Email, Account Name, Account id or Player Name') ->addArgument('recipient', InputArgument::REQUIRED, 'Email, Account Name, Account id or Player Name')
->addOption('subject', 's', InputOption::VALUE_REQUIRED, 'Subject'); ->addOption('subject', 's', InputOption::VALUE_REQUIRED, 'Subject');
} }

View File

@@ -12,8 +12,7 @@ class PluginInstallInstallCommand extends Command
{ {
protected function configure(): void protected function configure(): void
{ {
$this->setName('plugin:setup') $this->setName('plugin:install:install')
->setAliases(['plugin:install:install'])
->setDescription('This command executes the "install" part of the plugin') ->setDescription('This command executes the "install" part of the plugin')
->addArgument('plugin', InputArgument::REQUIRED, 'Plugin name'); ->addArgument('plugin', InputArgument::REQUIRED, 'Plugin name');
} }

View File

@@ -781,20 +781,15 @@ class Plugins {
return false; return false;
} }
$install = $plugin_json['install'] ?? ''; if(!isset($plugin_json['install'])) {
if (self::getAutoLoadOption($plugin_json, 'install', true) && is_file(PLUGINS . $plugin_name . '/install.php')) { self::$error = "Plugin doesn't have install options defined. Skipping...";
$install = 'plugins/' . $plugin_name . '/install.php';
}
if (empty($install)) {
self::$error = "This plugin doesn't seem to have install script defined.";
return false; return false;
} }
global $db; global $db;
if (file_exists(BASE . $install)) { if (file_exists(BASE . $plugin_json['install'])) {
$db->revalidateCache(); $db->revalidateCache();
require BASE . $install; require BASE . $plugin_json['install'];
$db->revalidateCache(); $db->revalidateCache();
} }
else { else {

View File

@@ -4,7 +4,7 @@
<th>Plugin Name</th> <th>Plugin Name</th>
<th>Your Version</th> <th>Your Version</th>
<th>Latest Version</th> <th>Latest Version</th>
<th>Download Link</th> <th>Download link</th>
</tr> </tr>
</thead> </thead>
{% for plugin in plugins %} {% for plugin in plugins %}

View File

@@ -1,6 +1,6 @@
<div id="CurrentPollBox" class="Themebox" style="background-image:url({{ template_path }}/images/themeboxes/current-poll/currentpollbox.gif);"> <div id="CurrentPollBox" class="Themebox" style="background-image:url({{ template_path }}/images/themeboxes/current-poll/currentpollbox.gif);">
<div id="CurrentPollText">{{ poll.question }}</div> <div id="CurrentPollText">{{ poll.question }}</div>
<a class="ThemeboxButton" href="{{ getLink('polls') }}?ìd={{ poll.id }}" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url({{ template_path }}/images/global/buttons/sbutton.gif);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/sbutton_over.gif);"></div><div class="ButtonText" style="background-image:url({{ template_path }}/images/global/buttons/_sbutton_votenow.gif);"></div> <a class="ThemeboxButton" href="{{ getLink('polls') }}/{{ poll.id }}" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url({{ template_path }}/images/global/buttons/sbutton.gif);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/sbutton_over.gif);"></div><div class="ButtonText" style="background-image:url({{ template_path }}/images/global/buttons/_sbutton_votenow.gif);"></div>
</a> </a>
<div class="Bottom" style="background-image:url({{ template_path }}/images/general/box-bottom.gif);"></div> <div class="Bottom" style="background-image:url({{ template_path }}/images/general/box-bottom.gif);"></div>
</div> </div>

View File

@@ -454,7 +454,7 @@ foreach($config['menu_categories'] as $id => $cat) {
foreach($config['boxes'] as $box) { foreach($config['boxes'] as $box) {
/** @var string $template_name */ /** @var string $template_name */
$file = __DIR__ . '/boxes/' . $box . '.php'; $file = TEMPLATES . $template_name . '/boxes/' . $box . '.php';
if(file_exists($file)) { if(file_exists($file)) {
include($file); ?> include($file); ?>
<?php <?php