mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-15 10:14:55 +02:00
Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8bc328d6fb | ||
![]() |
ac41b82579 | ||
![]() |
df7b6e29fb | ||
![]() |
e0cc19ad86 | ||
![]() |
85e7005fd3 | ||
![]() |
3c0cb53e17 | ||
![]() |
d0112d1a67 | ||
![]() |
ed9beaf2b6 | ||
![]() |
5aa9bbf1c8 | ||
![]() |
a6032093b2 | ||
![]() |
4eab805d26 | ||
![]() |
3f24f961b1 | ||
![]() |
0b86459940 |
@@ -1,5 +1,21 @@
|
||||
# Changelog
|
||||
|
||||
## [1.8.2 - 26.09.2025]
|
||||
|
||||
### Added
|
||||
* Routes: Possibility to override routes with plugins pages, like characters.php - No need to define routes in plugin.json anymore (https://github.com/slawkens/myaac/commit/3f24f961b1cdeff5c60387e837ae454448bc5e1b)
|
||||
|
||||
### Changed
|
||||
* Style: Better look for myaac-table (https://github.com/slawkens/myaac/commit/a6032093b21e5bb3f0e75d2704da87d6dea6469d, https://github.com/slawkens/myaac/commit/5aa9bbf1c8e580d973ec82ac012489f8e7bc437e)
|
||||
|
||||
### Fixed
|
||||
* Install: Fix when config.local.php cannot be saved (https://github.com/slawkens/myaac/commit/4eab805d26d8c5562b29ed699769919d77dabced)
|
||||
* Create Account: Fix an exception when email cannot be sent (https://github.com/slawkens/myaac/commit/d0112d1a67e8b854b65ad131f0375b79305df8d3)
|
||||
* Login Page: Add missing csrf() - fix create account button (https://github.com/slawkens/myaac/commit/3c0cb53e17dd0b85394cfa0fdc9cf9ad8d4551df)
|
||||
* tibiacom template: Fix account lost menu (https://github.com/slawkens/myaac/commit/ed9beaf2b6ca069e304e569c52e5b9188b58f05c)
|
||||
* tibiacom template: Fix Menu div wrong tag/closing (#329) (https://github.com/slawkens/myaac/commit/85e7005fd3f0be51466151a3c122b96085fdfe68)
|
||||
* tibiacom template: Replace firstChild with firstElementChild (Thanks to @un000000) (https://github.com/slawkens/myaac/commit/df7b6e29fb8875da97f431468c81ee99116271d9)
|
||||
|
||||
## [1.8.1 - 05.09.2025]
|
||||
|
||||
### Added
|
||||
|
@@ -26,7 +26,7 @@
|
||||
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
|
||||
|
||||
const MYAAC = true;
|
||||
const MYAAC_VERSION = '1.8.1';
|
||||
const MYAAC_VERSION = '1.8.2';
|
||||
const DATABASE_VERSION = 45;
|
||||
const TABLE_PREFIX = 'myaac_';
|
||||
define('START_TIME', microtime(true));
|
||||
|
@@ -42,45 +42,44 @@ if(!$error) {
|
||||
$configToSave['cache_prefix'] = 'myaac_' . generateRandomString(8, true, false, true);
|
||||
$configToSave['database_auto_migrate'] = true;
|
||||
|
||||
if(!$error) {
|
||||
$content = '';
|
||||
$saved = Settings::saveConfig($configToSave, BASE . 'config.local.php', $content);
|
||||
if ($saved) {
|
||||
success($locale['step_database_config_saved']);
|
||||
$_SESSION['saved'] = true;
|
||||
$content = '';
|
||||
$saved = Settings::saveConfig($configToSave, BASE . 'config.local.php', $content);
|
||||
if ($saved || file_exists(BASE . 'config.local.php')) {
|
||||
success($locale['step_database_config_saved']);
|
||||
$_SESSION['saved'] = true;
|
||||
|
||||
require BASE . 'config.local.php';
|
||||
require BASE . 'install/includes/config.php';
|
||||
require BASE . 'config.local.php';
|
||||
require BASE . 'install/includes/config.php';
|
||||
|
||||
if (!$error) {
|
||||
require BASE . 'install/includes/database.php';
|
||||
if (!$error) {
|
||||
require BASE . 'install/includes/database.php';
|
||||
|
||||
if (isset($database_error)) { // we failed connect to the database
|
||||
error($database_error);
|
||||
if (isset($database_error)) { // we failed connect to the database
|
||||
error($database_error);
|
||||
}
|
||||
else {
|
||||
if (!$db->hasTable('accounts')) {
|
||||
$tmp = str_replace('$TABLE$', 'accounts', $locale['step_database_error_table']);
|
||||
error($tmp);
|
||||
$error = true;
|
||||
}
|
||||
else {
|
||||
if (!$db->hasTable('accounts')) {
|
||||
$tmp = str_replace('$TABLE$', 'accounts', $locale['step_database_error_table']);
|
||||
error($tmp);
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$twig->display('install.installer.html.twig', array(
|
||||
'url' => 'tools/5-database.php',
|
||||
'message' => $locale['loading_spinner']
|
||||
));
|
||||
}
|
||||
if (!$error) {
|
||||
$twig->display('install.installer.html.twig', array(
|
||||
'url' => 'tools/5-database.php',
|
||||
'message' => $locale['loading_spinner']
|
||||
));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_SESSION['config_content'] = $content;
|
||||
unset($_SESSION['saved']);
|
||||
|
||||
$locale['step_database_error_file'] = str_replace('$FILE$', '<b>' . BASE . 'config.php</b>', $locale['step_database_error_file']);
|
||||
error($locale['step_database_error_file'] . '<br/>
|
||||
<textarea cols="70" rows="10">' . $content . '</textarea>');
|
||||
}
|
||||
} else {
|
||||
$error = true;
|
||||
$_SESSION['config_content'] = $content;
|
||||
unset($_SESSION['saved']);
|
||||
|
||||
$locale['step_database_error_file'] = str_replace('$FILE$', '<b>' . BASE . 'config.local.php</b>', $locale['step_database_error_file']);
|
||||
error($locale['step_database_error_file'] . '<br/>
|
||||
<textarea cols="70" rows="10">' . $content . '</textarea>');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -268,8 +268,10 @@ if($save)
|
||||
}
|
||||
else
|
||||
{
|
||||
error('An error occorred while sending email! Account not created. Try again. For Admin: More info can be found in system/logs/mailer-error.log');
|
||||
error('An error occurred while sending email! Account not created. Try again. For Admin: More info can be found in system/logs/mailer-error.log');
|
||||
$new_account->delete();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -94,19 +94,30 @@ $dispatcher = FastRoute\cachedDispatcher(function (FastRoute\RouteCollector $r)
|
||||
$routesFinal[] = ['*', $page, '__database__/' . $page, 100];
|
||||
}
|
||||
|
||||
$routes = require SYSTEM . 'routes.php';
|
||||
Plugins::clearWarnings();
|
||||
foreach (Plugins::getRoutes() as $route) {
|
||||
$routesFinal[] = [$route[0], $route[1], $route[2], $route[3] ?? 1000];
|
||||
|
||||
foreach (Plugins::getRoutes() as $pluginRoute) {
|
||||
|
||||
$routesFinal[] = [$pluginRoute[0], $pluginRoute[1], $pluginRoute[2], $pluginRoute[3] ?? 1000];
|
||||
|
||||
// Possibility to override routes with plugins pages, like characters.php
|
||||
foreach ($routes as &$route) {
|
||||
if (str_contains($pluginRoute[2], 'pages/' . $route[2])) {
|
||||
$route[2] = $pluginRoute[2];
|
||||
}
|
||||
}
|
||||
/*
|
||||
echo '<pre>';
|
||||
var_dump($route[1], $route[3], $route[2]);
|
||||
var_dump($pluginRoute[1], $pluginRoute[3], $pluginRoute[2]);
|
||||
echo '/<pre>';
|
||||
*/
|
||||
}
|
||||
|
||||
$routes = require SYSTEM . 'routes.php';
|
||||
foreach ($routes as $route) {
|
||||
if (!str_contains($route[2], '__redirect__') && !str_contains($route[2], '__database__')) {
|
||||
if (!str_contains($route[2], '__redirect__') && !str_contains($route[2], '__database__')
|
||||
&& !str_contains($route[2], 'plugins/')
|
||||
) {
|
||||
if (!is_file(BASE . 'system/pages/' . $route[2])) {
|
||||
continue;
|
||||
}
|
||||
|
@@ -1,6 +1,9 @@
|
||||
<style>
|
||||
.myaac-table tbody tr:nth-child(even) {background: {{ config.lightborder }}}
|
||||
.myaac-table tbody tr:nth-child(odd) {background: {{ config.darkborder }}}
|
||||
.myaac-table thead td {background: {{ config.vdarkborder }}; color: #ffffff !important;}
|
||||
.myaac-table tfoot td {background: {{ config.vdarkborder }}; color: #ffffff !important;}
|
||||
.myaac-table {border-spacing: 1px;}
|
||||
.myaac-table > tbody > tr:nth-child(even) {background: {{ config.lightborder }}}
|
||||
.myaac-table > tbody > tr:nth-child(odd) {background: {{ config.darkborder }}}
|
||||
.myaac-table > tbody > tr > td {padding: 4px; }
|
||||
.myaac-table > thead > tr > td {padding: 4px; background: {{ config.vdarkborder }}; color: #ffffff !important;}
|
||||
.myaac-table > thead > tr > th {padding: 4px; background: {{ config.vdarkborder }}; color: #ffffff !important;}
|
||||
.myaac-table > tfoot > tr > td {padding: 4px; background: {{ config.vdarkborder }}; color: #ffffff !important;}
|
||||
</style>
|
||||
|
@@ -130,6 +130,7 @@
|
||||
<div style="float: right; margin-top: 20px;" >
|
||||
{% apply spaceless %}
|
||||
<form class="MediumButtonForm" action="{{ getLink('account/create') }}" method="post" >
|
||||
{{ csrf() }}
|
||||
<div class="MediumButtonBackground" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton.gif)" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);">
|
||||
<div class="MediumButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton-over.gif)" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"></div>
|
||||
<input class="MediumButtonText" type="image" name="Create Account" alt="Create Account" src="{{ template_path }}/images/global/buttons/mediumbutton_createaccount.png" />
|
||||
|
@@ -37,7 +37,9 @@ if(isset($config['boxes']))
|
||||
$tmp = str_replace('/', '_', PAGE);
|
||||
$exp = explode('/', PAGE);
|
||||
if(PAGE !== 'account/create' && PAGE !== 'account/lost' && isset($exp[1])) {
|
||||
if ($exp[0] === 'account') {
|
||||
if ($exp[0] === 'account' && $exp[1] === 'lost') {
|
||||
$tmp = 'account_lost';
|
||||
} elseif ($exp[0] === 'account') {
|
||||
$tmp = 'account_manage';
|
||||
} else if ($exp[0] === 'news' && $exp[1] === 'archive') {
|
||||
$tmp = 'news_archive';
|
||||
@@ -90,24 +92,24 @@ if(isset($config['boxes']))
|
||||
// mouse-over and click events of the loginbox
|
||||
function MouseOverLoginBoxText(source)
|
||||
{
|
||||
source.lastChild.style.visibility = "visible";
|
||||
source.firstChild.style.visibility = "hidden";
|
||||
source.lastElementChild.style.visibility = "visible";
|
||||
source.firstElementChild.style.visibility = "hidden";
|
||||
}
|
||||
function MouseOutLoginBoxText(source)
|
||||
{
|
||||
source.firstChild.style.visibility = "visible";
|
||||
source.lastChild.style.visibility = "hidden";
|
||||
source.firstElementChild.style.visibility = "visible";
|
||||
source.lastElementChild.style.visibility = "hidden";
|
||||
}
|
||||
function LoginButtonAction()
|
||||
{
|
||||
if(loginStatus == "false") {
|
||||
if(loginStatus === "false") {
|
||||
window.location = "<?php echo getLink('account/manage'); ?>";
|
||||
} else {
|
||||
window.location = "<?php echo getLink('account/manage'); ?>";
|
||||
}
|
||||
}
|
||||
function LoginstatusTextAction(source) {
|
||||
if(loginStatus == "false") {
|
||||
if(loginStatus === "false") {
|
||||
window.location = "<?php echo getLink('account/create'); ?>";
|
||||
} else {
|
||||
window.location = "<?php echo getLink('account/logout'); ?>";
|
||||
@@ -226,11 +228,11 @@ if(isset($config['boxes']))
|
||||
// mouse-over effects of menubuttons and submenuitems
|
||||
function MouseOverMenuItem(source)
|
||||
{
|
||||
source.firstChild.style.visibility = "visible";
|
||||
source.firstElementChild.style.visibility = "visible";
|
||||
}
|
||||
function MouseOutMenuItem(source)
|
||||
{
|
||||
source.firstChild.style.visibility = "hidden";
|
||||
source.firstElementChild.style.visibility = "hidden";
|
||||
}
|
||||
function MouseOverSubmenuItem(source)
|
||||
{
|
||||
@@ -336,7 +338,7 @@ if(isset($config['boxes']))
|
||||
<div id="LoginBottom" class="Loginstatus" style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif)" ></div>
|
||||
</div>
|
||||
|
||||
<div-- id='Menu'>
|
||||
<div id='Menu'>
|
||||
<div id='MenuTop' style='background-image:url(<?php echo $template_path; ?>/images/general/box-top.gif);'></div>
|
||||
|
||||
<?php
|
||||
@@ -401,6 +403,7 @@ foreach($config['menu_categories'] as $id => $cat) {
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
InitializePage();
|
||||
</script>
|
||||
|
@@ -1,11 +1,11 @@
|
||||
function MouseOverBigButton(source) {
|
||||
if (source?.firstChild?.style) {
|
||||
source.firstChild.style.visibility = "visible";
|
||||
if (source?.firstElementChild?.style) {
|
||||
source.firstElementChild.style.visibility = "visible";
|
||||
}
|
||||
}
|
||||
function MouseOutBigButton(source) {
|
||||
if (source?.firstChild?.style) {
|
||||
source.firstChild.style.visibility = "hidden";
|
||||
if (source?.firstElementChild?.style) {
|
||||
source.firstElementChild.style.visibility = "hidden";
|
||||
}
|
||||
}
|
||||
function BigButtonAction(path) {
|
||||
|
Reference in New Issue
Block a user