Compare commits

..

38 Commits
v1.0 ... v1.1

Author SHA1 Message Date
slawkens
9ab25abcdf Release v1.1 2025-01-27 22:30:18 +01:00
slawkens
ea753278a0 Secure direct access to template.php 2025-01-27 22:15:00 +01:00
slawkens
4d749b8815 Fix error in CLI, where BASE_URL is not defined 2025-01-24 21:42:52 +01:00
slawkens
07012f786b Ignore lua/ folder 2025-01-22 21:45:07 +01:00
slawkens
a45ceab83a Make players.comment and guilds.description VARCHAR 2025-01-22 21:44:58 +01:00
slawkens
669c447fca Fix hook ACCOUNT_LOGIN_BEFORE_ACCOUNT location 2025-01-21 21:45:28 +01:00
slawkens
da43b32ff0 Nothing important, code refactor 2025-01-21 20:43:59 +01:00
slawkens
cbe0d187b4 Formatting and types hint 2025-01-20 16:31:54 +01:00
slawkens
c5d5bb8067 Adjust mailer settings to latest gmail 2025-01-18 16:18:47 +01:00
slawkens
e85ce193be Add forum to the list 2025-01-18 11:18:21 +01:00
slawkens
3fb2675b5a Fix tibiacom menus 2025-01-18 11:11:35 +01:00
slawkens
b7de8b32eb Revert "Fix menus like char-bazaar/auctions-history etc."
This reverts commit dd47423157.
2025-01-18 11:05:15 +01:00
slawkens
89be68731e Update CHANGELOG.md 2025-01-18 00:11:18 +01:00
slawkens
10dd818b13 Optimize $player->isOnline() function 2025-01-17 22:49:40 +01:00
slawkens
13a1598a46 Nothing important: Convert spaces to tabs 2025-01-17 22:38:27 +01:00
slawkens
4f6178eca0 Initialize menus with menu_categories
If user add custom categories, it will fix an issue where Menu is not collapsed
2025-01-17 21:07:02 +01:00
slawkens
dc2b5afd99 functions_custom.php are not optional 2025-01-17 17:12:21 +01:00
slawkens
11cee81c5f Additional fix to previous commit 2025-01-17 16:36:05 +01:00
slawkens
d639e77d04 tibiacom: Fix the closing MenuBottom if there are extra categories 2025-01-17 16:24:30 +01:00
slawkens
dd47423157 Fix menus like char-bazaar/auctions-history etc. 2025-01-17 11:16:19 +01:00
slawkens
b02c7f4239 Fix note message 2025-01-14 19:29:47 +01:00
slawkens
b5b2e3fd78 Update CHANGELOG.md 2025-01-14 00:19:16 +01:00
slawkens
030d15f0cd Fix branch name 2025-01-14 00:17:33 +01:00
slawkens
b6b7592226 Release v1.0.1 2025-01-13 23:17:58 +01:00
slawkens
fb10741a02 Fix typo in account word 2025-01-13 23:15:57 +01:00
slawkens
5e9c868dfa Fix tibiacom account & news menu links 2025-01-13 23:05:16 +01:00
slawkens
0904b1bb87 Fix phpstan 2025-01-13 22:23:43 +01:00
slawkens
faa60f5e9a Fix phpstan and phplint branches 2025-01-13 22:15:48 +01:00
slawkens
620e0f62e4 Fix cypress run workflow 2025-01-13 22:10:52 +01:00
slawkens
2ae2ec3353 Fix link to monsters 2025-01-13 22:09:15 +01:00
slawkens
b323d9cee1 Update cypress to ^13.17.0 2025-01-13 22:09:04 +01:00
slawkens
4f1d1d8043 Update tinymce to ^7.2.0 2025-01-13 21:50:37 +01:00
slawkens
8e5a3afc6e Update myaac version 2025-01-13 21:41:49 +01:00
slawkens
a7311301e2 Update composer.lock 2025-01-13 21:40:16 +01:00
slawkens
ac10236154 Update twig dependency to ^3.11 (disable dependabot alert) 2025-01-13 21:40:09 +01:00
slawkens
dc95bc4bad Merge branch 'master' of https://github.com/slawkens/myaac 2025-01-13 21:18:50 +01:00
dependabot[bot]
0dc7da472f Bump nesbot/carbon from 2.72.5 to 2.72.6 (#276)
Bumps [nesbot/carbon](https://github.com/CarbonPHP/carbon) from 2.72.5 to 2.72.6.
- [Release notes](https://github.com/CarbonPHP/carbon/releases)
- [Commits](https://github.com/CarbonPHP/carbon/compare/2.72.5...2.72.6)

---
updated-dependencies:
- dependency-name: nesbot/carbon
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 21:16:29 +01:00
slawkens
43421e56ea Update nginx-sample.conf 2025-01-13 20:34:40 +01:00
32 changed files with 2273 additions and 2076 deletions

View File

@@ -1,9 +1,9 @@
name: Cypress
on:
pull_request:
branches: [develop]
branches: [master]
push:
branches: [develop]
branches: [master]
jobs:
cypress:
@@ -35,7 +35,7 @@ jobs:
- name: Checkout MyAAC
uses: actions/checkout@v4
with:
ref: develop
ref: master
- uses: actions/setup-node@v4
with:

View File

@@ -1,9 +1,9 @@
name: PHP Linting
on:
pull_request:
branches: [develop]
branches: [master]
push:
branches: [develop]
branches: [master]
jobs:
phplint:

View File

@@ -2,9 +2,9 @@ name: "PHPStan"
on:
pull_request:
branches: [develop]
branches: [master]
push:
branches: [develop]
branches: [master]
jobs:
tests:

4
.gitignore vendored
View File

@@ -4,6 +4,7 @@ Thumbs.db
#
/.htaccess
lua
# composer
composer.phar
@@ -75,6 +76,3 @@ landing
# system
system/functions_custom.php
# others/rest
system/pages/downloads.php

View File

@@ -1,5 +1,30 @@
# Changelog
## [1.1 - 27.01.2025]
### Changed
* adjust mailer settings descriptions to latest gmail (https://github.com/slawkens/myaac/commit/c5d5bb80671db135e6b503f53684771c7272e05d)
* optimize $player->isOnline() function, thanks @gesior (https://github.com/slawkens/myaac/commit/10dd818b139d5e1bb1ca9ec81edfb083ba9316b4)
* make players.comment and guilds.description VARCHAR (https://github.com/slawkens/myaac/commit/a45ceab83a74bee2b89cdb72baceda75e577e3cf)
* add lua/ folder to .gitignore (https://github.com/slawkens/myaac/commit/07012f786b1114cb6ab2f064f82c645b136a375a)
### Fixed
* general fixes in the tibiacom template menus, better support for custom menus
* make functions_custom.php optional
* error in CLI, where BASE_URL is not defined (https://github.com/slawkens/myaac/commit/4d749b881582f64b5a46196dbbb5ee8097127f03)
* hook ACCOUNT_LOGIN_BEFORE_ACCOUNT location (https://github.com/slawkens/myaac/commit/669c447fca8643ce56d9ef8c1374ec647c780998)
## [1.0.1 - 14.01.2025]
### Fixed
* tibiacom account & news menu links not auto expanding
### Updated (Thanks dependabot)
* twig from ^2.0 to ^3.11
* tinymce from ^6.8.3 to ^7.2.0
* cypress from ^12.12.0 to ^13.17.0
* nesbot/carbon from 2.72.5 to 2.72.6
## [1.0 - 12.01.2025]
First stable release in the v1.0 series.
@@ -129,7 +154,6 @@ Minimum PHP version for this release is 8.1.
* support for login and create account only by email (configurable)
* with no need for account name
* Google ReCAPTCHA v3 support (available as plugin)
* automatically load towns names from .OTBM file
* support for Account Number
* suggest account number option
* many new functions, hooks and configurables

View File

@@ -26,8 +26,8 @@
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
const MYAAC = true;
const MYAAC_VERSION = '1.0';
const DATABASE_VERSION = 42;
const MYAAC_VERSION = '1.1';
const DATABASE_VERSION = 43;
const TABLE_PREFIX = 'myaac_';
define('START_TIME', microtime(true));
define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX'));

View File

@@ -8,7 +8,7 @@
"ext-dom": "*",
"phpmailer/phpmailer": "^6.1",
"composer/semver": "^3.2",
"twig/twig": "^2.0",
"twig/twig": "^3.11",
"erusev/parsedown": "^1.7",
"nikic/fast-route": "^1.3",
"matomo/device-detector": "^6.0",

297
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "27c63d07ab6337cd8bb5b59f2b2e08d8",
"content-hash": "be4d1489a53a9cd8eec6bcaa7a096f30",
"packages": [
{
"name": "brick/math",
@@ -885,16 +885,16 @@
},
{
"name": "matomo/device-detector",
"version": "6.4.1",
"version": "6.4.2",
"source": {
"type": "git",
"url": "https://github.com/matomo-org/device-detector.git",
"reference": "0d364e0dd6c177da3c24cd4049178026324fd7ac"
"reference": "806e52d214b05ddead1a1d4304c7592f61f95976"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matomo-org/device-detector/zipball/0d364e0dd6c177da3c24cd4049178026324fd7ac",
"reference": "0d364e0dd6c177da3c24cd4049178026324fd7ac",
"url": "https://api.github.com/repos/matomo-org/device-detector/zipball/806e52d214b05ddead1a1d4304c7592f61f95976",
"reference": "806e52d214b05ddead1a1d4304c7592f61f95976",
"shasum": ""
},
"require": {
@@ -950,20 +950,20 @@
"source": "https://github.com/matomo-org/matomo",
"wiki": "https://dev.matomo.org/"
},
"time": "2024-09-24T13:50:04+00:00"
"time": "2024-12-16T16:38:01+00:00"
},
{
"name": "maximebf/debugbar",
"version": "v1.23.3",
"version": "v1.23.5",
"source": {
"type": "git",
"url": "https://github.com/maximebf/php-debugbar.git",
"reference": "687400043d77943ef95e8417cb44e1673ee57844"
"url": "https://github.com/php-debugbar/php-debugbar.git",
"reference": "eeabd61a1f19ba5dcd5ac4585a477130ee03ce25"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/687400043d77943ef95e8417cb44e1673ee57844",
"reference": "687400043d77943ef95e8417cb44e1673ee57844",
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/eeabd61a1f19ba5dcd5ac4585a477130ee03ce25",
"reference": "eeabd61a1f19ba5dcd5ac4585a477130ee03ce25",
"shasum": ""
},
"require": {
@@ -1015,10 +1015,10 @@
"debugbar"
],
"support": {
"issues": "https://github.com/maximebf/php-debugbar/issues",
"source": "https://github.com/maximebf/php-debugbar/tree/v1.23.3"
"issues": "https://github.com/php-debugbar/php-debugbar/issues",
"source": "https://github.com/php-debugbar/php-debugbar/tree/v1.23.5"
},
"time": "2024-10-29T12:24:25+00:00"
"time": "2024-12-15T19:20:42+00:00"
},
{
"name": "mustangostang/spyc",
@@ -1076,16 +1076,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.72.5",
"version": "2.72.6",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "afd46589c216118ecd48ff2b95d77596af1e57ed"
"url": "https://github.com/CarbonPHP/carbon.git",
"reference": "1e9d50601e7035a4c61441a208cb5bed73e108c5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/afd46589c216118ecd48ff2b95d77596af1e57ed",
"reference": "afd46589c216118ecd48ff2b95d77596af1e57ed",
"url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/1e9d50601e7035a4c61441a208cb5bed73e108c5",
"reference": "1e9d50601e7035a4c61441a208cb5bed73e108c5",
"shasum": ""
},
"require": {
@@ -1105,7 +1105,7 @@
"doctrine/orm": "^2.7 || ^3.0",
"friendsofphp/php-cs-fixer": "^3.0",
"kylekatarnls/multi-tester": "^2.0",
"ondrejmirtes/better-reflection": "*",
"ondrejmirtes/better-reflection": "<6",
"phpmd/phpmd": "^2.9",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.99 || ^1.7.14",
@@ -1118,10 +1118,6 @@
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev",
"dev-2.x": "2.x-dev"
},
"laravel": {
"providers": [
"Carbon\\Laravel\\ServiceProvider"
@@ -1131,6 +1127,10 @@
"includes": [
"extension.neon"
]
},
"branch-alias": {
"dev-2.x": "2.x-dev",
"dev-master": "3.x-dev"
}
},
"autoload": {
@@ -1179,7 +1179,7 @@
"type": "tidelift"
}
],
"time": "2024-06-03T19:18:41+00:00"
"time": "2024-12-27T09:28:11+00:00"
},
{
"name": "nikic/fast-route",
@@ -1575,16 +1575,16 @@
},
{
"name": "symfony/console",
"version": "v6.4.15",
"version": "v6.4.17",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd"
"reference": "799445db3f15768ecc382ac5699e6da0520a0a04"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd",
"reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd",
"url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04",
"reference": "799445db3f15768ecc382ac5699e6da0520a0a04",
"shasum": ""
},
"require": {
@@ -1649,7 +1649,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v6.4.15"
"source": "https://github.com/symfony/console/tree/v6.4.17"
},
"funding": [
{
@@ -1665,7 +1665,7 @@
"type": "tidelift"
}
],
"time": "2024-11-06T14:19:14+00:00"
"time": "2024-12-07T12:07:30+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -1686,12 +1686,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": {
"dev-main": "3.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -1760,8 +1760,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
@@ -1836,8 +1836,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
@@ -1914,8 +1914,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
@@ -1998,8 +1998,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
@@ -2052,71 +2052,6 @@
],
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php72",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce",
"reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"type": "metapackage",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php72/tree/v1.31.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.31.0",
@@ -2137,8 +2072,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
@@ -2197,6 +2132,82 @@
],
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php81",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php81.git",
"reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Php81\\": ""
},
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/service-contracts",
"version": "v3.5.1",
@@ -2221,12 +2232,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": {
"dev-main": "3.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -2480,12 +2491,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": {
"dev-main": "3.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -2626,38 +2637,38 @@
},
{
"name": "twig/twig",
"version": "v2.16.1",
"version": "v3.18.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "19185947ec75d433a3ac650af32fc05649b95ee1"
"reference": "acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/19185947ec75d433a3ac650af32fc05649b95ee1",
"reference": "19185947ec75d433a3ac650af32fc05649b95ee1",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50",
"reference": "acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
"php": ">=8.0.2",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-php72": "^1.8"
"symfony/polyfill-php81": "^1.29"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/phpunit-bridge": "^5.4.9|^6.3"
"phpstan/phpstan": "^2.0",
"psr/container": "^1.0|^2.0",
"symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.16-dev"
}
},
"autoload": {
"psr-0": {
"Twig_": "lib/"
},
"files": [
"src/Resources/core.php",
"src/Resources/debug.php",
"src/Resources/escaper.php",
"src/Resources/string_loader.php"
],
"psr-4": {
"Twig\\": "src/"
}
@@ -2690,7 +2701,7 @@
],
"support": {
"issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/v2.16.1"
"source": "https://github.com/twigphp/Twig/tree/v3.18.0"
},
"funding": [
{
@@ -2702,7 +2713,7 @@
"type": "tidelift"
}
],
"time": "2024-09-09T17:53:56+00:00"
"time": "2024-12-29T10:51:50+00:00"
},
{
"name": "voku/portable-ascii",
@@ -2840,16 +2851,16 @@
"packages-dev": [
{
"name": "phpstan/phpstan",
"version": "1.12.12",
"version": "1.12.15",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0"
"reference": "c91d4e8bc056f46cf653656e6f71004b254574d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0",
"reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/c91d4e8bc056f46cf653656e6f71004b254574d1",
"reference": "c91d4e8bc056f46cf653656e6f71004b254574d1",
"shasum": ""
},
"require": {
@@ -2894,12 +2905,12 @@
"type": "github"
}
],
"time": "2024-11-28T22:13:23+00:00"
"time": "2025-01-05T16:40:22+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
@@ -2910,6 +2921,6 @@
"ext-xml": "*",
"ext-dom": "*"
},
"platform-dev": [],
"platform-dev": {},
"plugin-api-version": "2.6.0"
}

View File

@@ -116,9 +116,9 @@ describe('Check Public Pages', () => {
})
// library
it('Go to creatures page', () => {
it('Go to monsters page', () => {
cy.visit({
url: Cypress.env('URL') + '/creatures',
url: Cypress.env('URL') + '/monsters',
method: 'GET',
})
})

View File

@@ -4,7 +4,7 @@ const YOU_ARE_NOT_LOGGEDIN = 'You are not logged in.';
describe('Check Protected Pages', () => {
// character actions
it('Go to accouht character creation page', () => {
it('Go to account character creation page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/character/create',
method: 'GET',
@@ -12,7 +12,7 @@ describe('Check Protected Pages', () => {
cy.contains(REQUIRED_LOGIN_MESSAGE)
})
it('Go to accouht character deletion page', () => {
it('Go to account character deletion page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/character/delete',
method: 'GET',
@@ -21,7 +21,7 @@ describe('Check Protected Pages', () => {
})
// account actions
it('Go to accouht email change page', () => {
it('Go to account email change page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/email',
method: 'GET',
@@ -29,7 +29,7 @@ describe('Check Protected Pages', () => {
cy.contains(REQUIRED_LOGIN_MESSAGE)
})
it('Go to accouht password change page', () => {
it('Go to account password change page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/password',
method: 'GET',
@@ -37,7 +37,7 @@ describe('Check Protected Pages', () => {
cy.contains(REQUIRED_LOGIN_MESSAGE)
})
it('Go to accouht info change page', () => {
it('Go to account info change page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/info',
method: 'GET',
@@ -45,7 +45,7 @@ describe('Check Protected Pages', () => {
cy.contains(REQUIRED_LOGIN_MESSAGE)
})
it('Go to accouht logout change page', () => {
it('Go to account logout change page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/logout',
method: 'GET',

View File

@@ -1,4 +1,4 @@
SET @myaac_database_version = 42;
SET @myaac_database_version = 43;
CREATE TABLE `myaac_account_actions`
(

View File

@@ -1,3 +1,4 @@
<?php defined('MYAAC') or die('Direct access not allowed!'); ?>
<!DOCTYPE html>
<html dir="<?php echo $locale['direction']; ?>" lang="<?php echo $locale['lang']; ?>" xml:lang="<?php echo $locale['lang']; ?>">
<head>

View File

@@ -156,9 +156,14 @@ if ($db->hasTable('guilds')) {
}
if (!$db->hasColumn('guilds', 'description')) {
if (query("ALTER TABLE `guilds` ADD `description` TEXT NOT NULL;"))
if (query("ALTER TABLE `guilds` ADD `description` VARCHAR(5000) NOT NULL DEFAULT '';"))
success($locale['step_database_adding_field'] . ' guilds.description...');
}
else {
if (query("ALTER TABLE `guilds` MODIFY `description` VARCHAR(5000) NOT NULL DEFAULT '';")) {
success($locale['step_database_modifying_field'] . ' guilds.description...');
}
}
if ($db->hasColumn('guilds', 'logo_gfx_name')) {
if (query("ALTER TABLE `guilds` CHANGE `logo_gfx_name` `logo_name` VARCHAR( 255 ) NOT NULL DEFAULT 'default.gif';")) {
@@ -197,9 +202,14 @@ if ($db->hasTable('players')) {
}
if (!$db->hasColumn('players', 'comment')) {
if (query("ALTER TABLE `players` ADD `comment` TEXT NOT NULL;"))
if (query("ALTER TABLE `players` ADD `comment` VARCHAR(5000) NOT NULL DEFAULT '';"))
success($locale['step_database_adding_field'] . ' players.comment...');
}
else {
if (query("ALTER TABLE `players` MODIFY `comment` VARCHAR(5000) NOT NULL DEFAULT '';")) {
success($locale['step_database_modifying_field'] . ' players.comment...');
}
}
if ($db->hasColumn('players', 'rank_id')) {
if (query("ALTER TABLE players MODIFY `rank_id` INT(11) NOT NULL DEFAULT 0;"))

View File

@@ -24,7 +24,7 @@ server {
}
location / {
try_files $uri $uri/ /index.php?$query_string;;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {

901
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
"postinstall": "node ./npm-post-install.js"
},
"devDependencies": {
"cypress": "^12.12.0"
"cypress": "^13.17.0"
},
"dependencies": {
"@tinymce/tinymce-jquery": "^2.1.0",
@@ -12,6 +12,6 @@
"fs-extra": "^11.2.0",
"jquery": "^3.7.1",
"jquery-ui": "^1.13.2",
"tinymce": "^6.8.3"
"tinymce": "^7.2.0"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "create-account-hint",
"description": "This plugin display text 'To play on Forgotten you need an account. All you have to do to create your new account is to enter an account name, password, country and your email address. Also you have to agree to the terms presented below. If you have done so, your account name will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.' on the create account page. <strong>Be careful when uninstalling this!</strong>",
"description": "This plugin display text 'To play on Forgotten you need an account. All you have to do to create your new account is to enter an account name, password, country and your email address. Also you have to agree to the terms presented below. If you have done so, your account name will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.' on the create account page.",
"version": "1.0",
"author": "slawkens",
"contact": "slawkens@gmail.com",

View File

@@ -9,7 +9,4 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
global $twig_loader;
$twig_loader->prependPath(BASE . 'plugins/account-create-hint');
$twig->display('hint.html.twig');
$twig->display('account-create-hint/hint.html.twig');

View File

@@ -22,7 +22,7 @@ if [ $1 = "prepare" ]; then
mkdir -p tmp
# get myaac from git archive
git archive --format zip --output tmp/myaac.zip develop
git archive --format zip --output tmp/myaac.zip master
cd tmp/ || exit

View File

@@ -49,7 +49,7 @@ function warning($message, $return = false) {
return message($message, 'warning', $return);
}
function note($message, $return = false) {
return info($message, $return);
return message($message, 'note', $return);
}
function info($message, $return = false) {
return message($message, 'info', $return);
@@ -1057,14 +1057,14 @@ function get_browser_real_ip() {
return '0';
}
function setSession($key, $data) {
function setSession($key, $data): void {
$_SESSION[setting('core.session_prefix') . $key] = $data;
}
function getSession($key) {
$key = setting('core.session_prefix') . $key;
return isset($_SESSION[$key]) ? $_SESSION[$key] : false;
return $_SESSION[$key] ?? false;
}
function unsetSession($key) {
function unsetSession($key): void {
unset($_SESSION[setting('core.session_prefix') . $key]);
}
@@ -1679,4 +1679,7 @@ function getAccountIdentityColumn(): string
require_once SYSTEM . 'compat/base.php';
// custom functions
require SYSTEM . 'functions_custom.php';
$customFunctions = SYSTEM . 'functions_custom.php';
if (is_file($customFunctions)) {
require $customFunctions;
}

View File

@@ -139,7 +139,7 @@ require_once SYSTEM . 'database.php';
// verify myaac tables exists in database
if(!defined('MYAAC_INSTALL') && !$db->hasTable('myaac_account_actions')) {
throw new RuntimeException('Seems that the table myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting ' . BASE_URL . 'install');
throw new RuntimeException('Seems that the table myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting ' . (IS_CLI ? 'http://your-ip.com/' : BASE_URL) . 'install');
}
// execute migrations

View File

@@ -108,6 +108,8 @@ class OTS_Player extends OTS_Row_DAO
POT::SKILL_SHIELD => array('value' => 0, 'tries' => 0),
POT::SKILL_FISH => array('value' => 0, 'tries' => 0)
);
private static array $playersOnline;
/**
* Magic PHP5 method.
*
@@ -765,10 +767,18 @@ class OTS_Player extends OTS_Row_DAO
public function isOnline()
{
if($this->db->hasTable('players_online')) // tfs 1.0
{
$query = $this->db->query('SELECT `player_id` FROM `players_online` WHERE `player_id` = ' . $this->data['id']);
return $query->rowCount() > 0;
if($this->db->hasTable('players_online')) {// tfs 1.0
if (!isset(self::$playersOnline)) {
self::$playersOnline = [];
$query = $this->db->query('SELECT `player_id` FROM `players_online`');
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $item) {
self::$playersOnline[$item['player_id']] = true;
}
}
return isset(self::$playersOnline[$this->data['id']]);
}
if( !isset($this->data['online']) )

20
system/migrations/43.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
/**
* @var OTS_DB_MySQL $db
*/
// 2025-01-22
// change columns to VARCHAR
$up = function () use ($db) {
$db->query("UPDATE guilds set description = '' WHERE description is NULL;"); // prevent truncate error when column is NULL
$db->modifyColumn('guilds', 'description', "VARCHAR(5000) NOT NULL DEFAULT ''");
$db->query("UPDATE players set comment = '' WHERE comment is NULL;");
$db->modifyColumn('players', 'comment', "VARCHAR(5000) NOT NULL DEFAULT ''");
};
$down = function () use ($db) {
$db->modifyColumn('guilds', 'description', "TEXT NOT NULL");
$db->modifyColumn('players', 'comment', "TEXT NOT NULL");
};

View File

@@ -88,7 +88,7 @@ if(isset($_GET['archive']))
foreach($news_DB as $news)
{
$newses[] = array(
'link' => getLink('news') . '/' . $news['id'],
'link' => getLink('news/archive') . '/' . $news['id'],
'icon_id' => $categories[$news['category']]['icon_id'],
'title' => stripslashes($news['title']),
'date' => $news['date']

View File

@@ -509,7 +509,7 @@ Sent by MyAAC,<br/>
'smtp_port' => [
'name' => 'SMTP Host',
'type' => 'number',
'desc' => '25 (default) / 465 (ssl, GMail) / 587 (tls, Microsoft Outlook)',
'desc' => '25 (default) / 587 (tls - GMail, Microsoft Outlook)',
'default' => 25,
'show_if' => [
'mail_enabled', '=', 'true'
@@ -536,7 +536,8 @@ Sent by MyAAC,<br/>
'smtp_pass' => [
'name' => 'SMTP Password',
'type' => 'password',
'desc' => 'Here your email password to authenticate with SMTP',
'desc' => 'Here your email password to authenticate with SMTP.' . PHP_EOL
. 'For GMail use generated App password - https://myaccount.google.com/apppasswords.',
'default' => '',
'show_if' => [
'mail_enabled', '=', 'true'
@@ -546,7 +547,8 @@ Sent by MyAAC,<br/>
'name' => 'SMTP Security',
'type' => 'options',
'options' => ['None', 'SSL', 'TLS'],
'desc' => 'What kind of encryption to use on the SMTP connection',
'desc' => 'What kind of encryption to use on the SMTP connection.' . PHP_EOL
. '(Gmail, Outlook - tls).',
'default' => 0,
'show_if' => [
'mail_enabled', '=', 'true'

View File

@@ -105,9 +105,6 @@ class CreateCharacter
* @param array $errors
* @return bool
* @throws \E_OTS_NotLoaded
* @throws \Twig_Error_Loader
* @throws \Twig_Error_Runtime
* @throws \Twig_Error_Syntax
*/
public function doCreate($name, $sex, $vocation, $town, $account, &$errors)
{

View File

@@ -24,21 +24,28 @@ Please enter your account {{ account|lower }} and your password.<br/><a href="{{
<td>
<div class="InnerTableContainer">
<table style="width:100%;" >
{{ hook('HOOK_ACCOUNT_LOGIN_BEFORE_PASSWORD') }}
{{ hook('HOOK_ACCOUNT_LOGIN_BEFORE_ACCOUNT') }}
<tr>
<td class="LabelV" >
<span{% if error is not null %} class="red"{% endif %}>{{ account_login_by }}:</span>
</td>
<td style="width:100%;" ><input type="text" name="account_login" size="30" maxlength="{{ setting('core.account_login_by_email') ? '255' : '30' }}" autofocus/></td>
</tr>
{{ hook('HOOK_ACCOUNT_LOGIN_AFTER_ACCOUNT') }}
{{ hook('HOOK_ACCOUNT_LOGIN_BEFORE_PASSWORD') }}
<tr>
<td class="LabelV" >
<span{% if error is not null %} class="red"{% endif %}>Password:</span>
</td>
<td><input type="password" name="password_login" size="30" maxlength="29" ></td>
</tr>
{{ hook('HOOK_ACCOUNT_LOGIN_AFTER_PASSWORD') }}
<tr>
<td class="LabelV" ></td>
<td><input type="checkbox" id="remember_me" name="remember_me" value="true" />

View File

@@ -79,7 +79,8 @@
</tr>
{% set showedRank, i = false, 0 %}
{% for rank in guild_members if rank.members|length > 0 %}
{% for rank in guild_members %}
{% if rank.members|length > 0 %}
{% set rankStyle, i = getStyle(i), i + 1 %}
{% for player in rank.members %}
@@ -130,6 +131,7 @@
{% endfor %}
{% set showedRank = false %}
{% endif %}
{% else %}
<tr bgcolor="{{ getStyle(i) }}">
<td colspan="5">No guild members found.</td>
@@ -162,7 +164,7 @@
</tr>
{% set i = 0 %}
{% for invited_player in invited_list if invited_list|length > 0 %}
{% for invited_player in invited_list %}
{% if invited_player.isLoaded() %}
<tr bgcolor="{{ getStyle(i) }}">
{% set i = i + 1 %}

View File

@@ -85,7 +85,8 @@ the search criteria and start a new search.
<tr bgcolor="{{ config.darkborder }}">
<td valign="top" rowspan="2">
{% set checked = false %}
{% for id, name in config.towns if id > 0 %}
{% for id, name in config.towns %}
{% if id > 0 %}
{% if ((townId is empty and name is not empty) or id == townId) and not checked %}
{% set variable = "checked" %}
{% set checked = true %}
@@ -96,6 +97,7 @@ the search criteria and start a new search.
<input type="radio" name="town" id="town_{{ id }}" value="{{ id }}"{% if variable is defined %} {{ variable }}{% endif %}>
<label for="town_{{ id }}"> {{ name }}</label>
<br>
{% endif %}
{% endfor %}
</td>

View File

@@ -26,7 +26,7 @@ return [
'Team' => 'team',
],
MENU_CATEGORY_LIBRARY => [
'Monsters' => 'creatures',
'Monsters' => 'monsters',
'Spells' => 'spells',
'Server Info' => 'server-info',
'Commands' => 'commands',

View File

@@ -35,6 +35,17 @@ if(isset($config['boxes']))
}
else {
$tmp = str_replace('/', '_', PAGE);
$exp = explode('/', PAGE);
if(PAGE !== 'account/create' && PAGE !== 'account/lost' && isset($exp[1])) {
if ($exp[0] === 'account') {
$tmp = 'account_manage';
} else if ($exp[0] === 'news' && $exp[1] === 'archive') {
$tmp = 'news_archive';
}
else if (in_array($exp[0], ['characters', 'highscores', 'guilds', 'forum'])) {
$tmp = $exp[0];
}
}
}
}
else {
@@ -107,6 +118,15 @@ if(isset($config['boxes']))
menu[0] = {};
var unloadhelper = false;
<?php
$menuInitStr = '';
foreach ($config['menu_categories'] as $item) {
if ($item['id'] !== 'shops' || setting('core.gifts_system')) {
$menuInitStr .= $item['id'] . '=' . ($item['id'] === 'news' ? '1' : '0') . '&';
}
}
?>
// load the menu and set the active submenu item by using the variable 'activeSubmenuItem'
function LoadMenu()
{
@@ -114,7 +134,7 @@ if(isset($config['boxes']))
document.getElementById("ActiveSubmenuItemIcon_"+activeSubmenuItem).style.visibility = "visible";
menus = localStorage.getItem('menus');
if(menus == null || menus.lastIndexOf("&") === -1) {
menus = "news=1&account=0&community=0&library=0&forum=0<?php if (setting('core.gifts_system')) echo '&shops=0'; ?>&";
menus = "<?= $menuInitStr ?>";
}
FillMenuArray();
InitializeMenu();
@@ -318,10 +338,22 @@ if(isset($config['boxes']))
<?php
$menus = get_template_menus();
$countElements = 0;
foreach($config['menu_categories'] as $id => $cat) {
if (!isset($menus[$id]) || ($id == MENU_CATEGORY_SHOP && !setting('core.gifts_system'))) {
continue;
}
$countElements++;
}
$i = 0;
foreach($config['menu_categories'] as $id => $cat) {
if(!isset($menus[$id]) || ($id == MENU_CATEGORY_SHOP && !setting('core.gifts_system'))) {
continue;
}
$i++;
?>
<div id='<?php echo $cat['id']; ?>' class='menuitem'>
<span onClick="MenuItemAction('<?php echo $cat['id']; ?>')">
@@ -361,7 +393,7 @@ foreach($config['menu_categories'] as $id => $cat) {
?>
</div>
<?php
if($id == MENU_CATEGORY_SHOP || (!setting('core.gifts_system') && $id == MENU_CATEGORY_SHOP - 1)) {
if($id == MENU_CATEGORY_SHOP || (!setting('core.gifts_system') && $i == $countElements)) {
?>
<div id='MenuBottom' style='background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);'></div>
<?php

View File

@@ -28,7 +28,7 @@ return [
'Forum' => 'forum',
],
MENU_CATEGORY_LIBRARY => [
'Monsters' => 'creatures',
'Monsters' => 'monsters',
'Spells' => 'spells',
'Commands' => 'commands',
'Exp Stages' => 'exp-stages',