115 Commits

Author SHA1 Message Date
Slawomir Boczek
a72d1a3c9f
Feature: settings (#216)
* New admin panel Pages: Options + Config [WIP]

* Forgot the plugin example of options

* Rename to settings.php

* Add Settings Class

* New myaac_settings table

* Add $limit parameter to $db->select method

* Add $member var annotation

* Remove useless title_separator from config

* Move $menus to menus.php

Also fix active link when menu item has subpage

* Settings [WIP]

New Settings class
New Plugins::load() method
Move config.php to settings.php
MyAAC Settings will have plugin_name = 'core'
Add compat_config.php

* Change options.php to settings.php

* Change name to settings

* Add Settings menu

* Add Sections + Add setting($key) function

Reorganisation

* Add email + password fields as type

* Update 33.php

* add settings migration

* php 8 compatibility

* add missing hook

* Add categories in tabs, move more settings, revert back getPluginSettings

Categories and sections are now not numbered
Remove example settings plugin

* fix typo

* Update .gitignore

* Add 36th migration for settings table

* Execute migrations just after db connect

* Update plugins.php

* [WIP] Some work on settings

Add hidden settings
New method: parse, to parse settings from array
Move base html to twig template
Remove vocation loading from .xml, instead use predefined voc names

* Rename

* Fix path

* [WIP] More work on settings

Move more config to settings (mainly mail_* + some other)
Remove mail_admin, wasnt used anywhere
Add return type to some functions
Add Twig settings(key) function
Possibility to save setting to db

* Add min, max, step to number field option

* Re-enable plugin if disabled and already installed

* Add Settings menu, including all plugins with settings

One change included in previous commit, due to missclick

* Nothing important

* Better boolean detection

* More detailed error message in settings

* Lets call it settings.name instead

* Add new function: only_if, to hide fields when they are not enabled [WIP]

Not fully finished yet

* guild_management: show_if

* Hide section title on show_if

* Fix: check on page load if radio button is checked

* Add: show_if - account_mail_verify

* nothing important

* Rename team_* variables + add to deprecated

* Change variable name

* Extract Settings:save function

* Add settings.callbacks.get

* Move forum config to settings

* Move status config to settings

* Remove whitespaces

* More config to settings: account_types, genders, highscores, admin

* Move signature config to settings

* Move news config to settings

* Rename variable

* Save config.php in Settings

Egg and hen problem solved :)
* Test database connection on save settings -> prevents from making website unusable if connection is wrong
* Test server_path -> same
There is no config.php anymore, just config.local.php, which can be edited manually and also from admin panel

* Remove configs from previous commit

* Fix create account, if account_create_character_create is enabled

* Add more deprecated configs

* Add more info into comment

* Update 5-database.php

* Fix menu highlighting & opening

* Update template.php

* Enable script option

* Reword email settings + move two new settings

* add last_kills_limit + move shop

* google_analytics_id

* add mail_lost_account_interval

* Create character blocked words (by @gpedro), just moved to settings

* Fix google_analytics

* create character name config moved to settings

* Fix for install warning - min/max length

* New create character checks configurable: block monsters & spells names

* fixes

* Improve character npc name check

* New setting: donate_column + move donate config to settings

* Add super fancy No Refresh saving with a toast

* Add new possibility: to deny saving setting if condition is not met

* Move database settings to separate category

* Fix default value displaying

* Add database_hash setting

* add last_kills_limit to compat config

* Move create character blocked names down

* Every setting needs to have default

* Move rest of config to settings

Remove config.php completely
Add new settings category: Game
Fix account_login_by_email
Min textarea size = 2 + adjusted automatically
2023-08-05 21:00:45 +02:00
slawkens
74433303fb Better Gesior support 2023-06-23 21:52:23 +02:00
slawkens
da4e18cb69 Fixes to routing 2023-05-13 12:49:17 +02:00
slawkens
85769c1439 Empty URL = show news 2023-05-13 11:34:51 +02:00
slawkens
f3745a2752
Feature/new router (#165)
* Remove unneeded escape

* Fix guild back buttons (change logo & motd)

* small adjustment in news.php

* Fix create character when admin (any case is allowed now)

* Fix forum table style (boards & thread view)

* Small improvement to plugins.enabled check

* [WIP] nikic/fast-route implementation

I will describe it more in Pull Request

* Optimisations & fixes.

* Fix path - should not be absolute

* Add PLUGINS to Twig path

* Don't hide "Install Plugin" Box by default

* Update package-lock.json

* nothing important, just early exit & fixes

Fix creature display

* fix premium_ends_at for tfs 1.3+

* Move pages

* Move pages tbc

* $db->select: make $where parameter optional, allows to get all records

* Add some error box to error

* fix parse error

* Rewriting the router v2

To be more flexible

* small fixes

* fix & add admin icons

* Move mass_* pages to correct folder

* fix logout hook 2

* Delete accountmanagement.php

* This code wasn't used

* Add missing var

* Add redirect_from && redirect_to to router options

+ Also add * for all methods shortcut

* Remove comments

Not allowed in normal json

* Allow admin pages included into plugins dir

* block access to some files

* Fix admin logout

* Fix #178

* feature: mail confirmed reward

Suggested by @EPuncker

# Conflicts:
#	system/hooks.php

* remove misleading comment

* adjust required version according to composer.json

* fix duplicated word

* Adjustments & fixed to mass actions

* Add password confirm, and change text type to password

* Add list of Open Source Software MyAAC is using

* Fix signature

* Show First, Second instead of numbers

* fix base dir detection

* fix double ACTION define + undefined URI in template

* new function> escapeHtml + fix css in admin menus

* fix changelog add

* fix news adding, rename const to NEWS_*

* Add verify to pages, add messages, limits, fix add

* fix "Please fill all input"

* add required input to admin pages

* shorten some expressions with ??

* shorten code + fix conversion (int)

* Move account_types to config, account.web_flags to common.php

* Update example.json

* feature: router aliases

* shorten some code + const convert

* remove wrong char

* fix signature on custom basedir

* fix: mass teleport position validation (#214)

* fix: mass teleport position validation

* fix: max position

* Fix execute in CLI

* fix warning in reload cache in dev mode

* Configurable admin panel folder

* feature: plugin require more options with comma

* $config_account_salt -> USE_ACCOUNT_SALT

* fix forum show_thread

* Update show_thread.php

---------

Co-authored-by: Gabriel Pedro <gpedro@users.noreply.github.com>
2023-02-07 11:41:05 +01:00
slawkens
717b5fdd15 Add compat Gesior classes
To allow more custom pages be used with myaac
2022-09-27 10:06:03 +02:00
slawkens
2563583f84 Merge branch 'develop' into feature/login-by-email 2022-05-31 12:25:26 +02:00
slawkens
7e5528b7e1 Merge branch 'develop' into feature/admin-bar 2021-12-04 20:43:00 +01:00
slawkens
1427dc3ede Move MyAAC table detection to proper place 2021-06-09 01:45:38 +02:00
slawkens
8ecd8a10c0 Remove unneeded escape 2021-06-08 19:19:12 +02:00
anyeor
d9526d4021 Update 404 response (#163)
Updating for new SPL standard.
2021-06-05 05:19:00 +02:00
slawkens
44fff9dcd1 Merge branch 'develop' into feature/admin-bar 2021-05-01 15:04:04 +02:00
slawkens
ff9e255f1b On prod it won't display any PHP errors
As suggested by PHP Manual
2020-12-29 22:11:40 +01:00
Lee
8e6bc73ca6 Creature page overhaul
Updates the creature pages to show more information.
You will need to reload your creatures.
-modifies database with migration 31
-small customisations are allowed via config file.
-functions added, getMonsterLink, getItemRarity, getCreatureImgPath, left, right,
-added functions to twig.
-view elements, immunities, summons, voices, loot, pushables, canpush, canwalk, runonhealth,hostile,attackable,rewardboss,defense,armor
-filter bosses
-show list as picture preview or names list
2020-12-28 16:37:03 +00:00
Lee
c8443228fb Allow template pages
Checks if page exists in template directory and loads that page first instead of system/pages/
This allows users to make their own changes without modifying the original files for when doing updates.
2020-12-28 16:22:41 +00:00
slawkens
5d5875d540
Bans page working for TFS 1.x + move to Twig (#140)
* Bans page working for TFS 1.x + move to Twig

* Remove some debug code

* Add some protection

* Better check.
2020-10-30 06:52:50 +01:00
slawkens
787416e552 Remove useless title_separator from config 2020-06-06 17:15:55 +02:00
slawkens
d7fc45a72d Very first version of admin bar 2020-06-06 07:17:09 +02:00
slawkens
dbe83f8a74 Move migration into separate file + add into admin panel
This fixes some rare bugs when database is no up-to-date and someone enters admin panel
2020-05-24 18:43:26 +02:00
slawkens
e11d70de46 Log database queries into database.log when enabled
Instead of showing in page sources (it was impractical)
2020-02-15 23:18:10 +01:00
slawkens
13d0718780 RuntimeException instead of die() 2020-02-12 23:20:16 +01:00
slawkens
1ab32ca3ba New functions: getCustomPage() and getCustomPageInfo() 2020-02-11 01:00:42 +01:00
tobi132
56738389f8 Allow Pages to be loaded as Twig template
You can now use Twig variables in Pages
Like:
{{ config.lua.serverName }}
2019-12-03 05:01:59 +01:00
Evil Puncker
af1a6cf5ff Updated copyright year and SSL link
Updated year to 2019 and made all my-aac.org links go to SSL by default
2019-07-17 20:22:07 -03:00
whiteblXK
35e4cd4596 Houses page to twig 2019-04-29 20:42:03 +02:00
slawkens
b0a5220159 * display all php errors if env is dev 2019-04-24 00:41:37 +02:00
slawkens
cd0b1f10cc * $db->hasTable is the way to go 2018-10-18 09:13:36 +02:00
slawkens
9a86f1ebed * add fatal error message when myaac tables in database do not exist
(cherry picked from commit ba1c5e9)
2018-10-18 08:23:29 +02:00
slawkens
b6be3226c5 * nothing important .. (fixed some notices from IDE) 2018-06-03 20:26:30 +02:00
slawkens
45a387000d * optimize template load code (less file_exists checks) 2018-06-03 17:07:44 +02:00
slawkens
e6b052f8e9 * lowered condition execution cost 2018-06-03 17:03:53 +02:00
slawkens
6ba24eebb0 * nothing important: changed some text 2018-05-29 21:09:20 +02:00
slawkens
bf361238cb * remove whitespaces 2018-05-29 21:06:15 +02:00
slawkens
42d23e9b37 * remove unnecessary parentheses in include/require 2018-05-29 21:00:56 +02:00
slawkens
b828b8e44a * do not display software version 2018-05-29 20:08:29 +02:00
slawkens
eab416c0b4 * some optimizations & fixes according to awesome PHPStorm Php Inspections plugin! 2018-03-21 13:52:41 +01:00
slawkens1
fc6cd29e84 * revalidate cache before upgrading db 2018-01-14 14:30:13 +01:00
slawkens1
16bcb70863 * new hooks: LOGIN, LOGIN_ATTEMPT, LOGOUT
* fixed bug with uninstalling some plugin dirs
* updated TODO
2018-01-14 08:59:37 +01:00
slawkens
f29758939c * some fixes regarding migrations 2018-01-08 14:03:10 +01:00
slawkens1
792770e5e2 * fixed some typos
* changes account.management to use buttons defined in template
2018-01-06 23:43:59 +01:00
slawkens1
1025fad0e6 * cache $db->hasTable and $db->hasColumn functions
* changed tableExist and fieldExist to $db->hasTable(table) +
$db->hasColumn(table, column)
* new configurable: database_log - can log database queries and show in
website source when logged as super admin
* removed debug_level configurable, enabled by default when logged on
super admin
* added OTS_Account:getCountry()
* added posibility to load OTS_Player partially, and without skills
* (internal) changed depracated $ots->createObject() functions with
their OTS_ equivalents
* (internal) removed unused code
2018-01-06 05:44:33 +01:00
slawkens1
8d173d369d * added ico to the list of ignored files 2017-12-28 15:51:33 +01:00
slawkens1
62443257fc * semantic versioning support for plugins
* add support for defining max myaac version in plugin.json file
* you can now require other plugin to be installed before yours
* added German translation
* fixed faq containing html code
2017-12-26 16:47:52 +01:00
slawkens1
4d690992ac * switch to 0.7.5-dev
* fix when config.local.php doesn't exist
* fix when reinstalling aac with samples already installed
* some optimisations to installation script
* forgot to fclose on config.local.php
2017-12-24 13:00:14 +01:00
slawkens1
d9675b1bc6 * (internal) moved changelog to twig
* added changelog menu item to kathrine template
* (fix) if changelog type or where is set to 0 then display as unknown
2017-11-23 17:55:42 +01:00
slawkens1
9ee6906e4d * fixed loading of custom pages 2017-11-20 17:48:25 +01:00
slawkens1
7d6bbb3385 * verify install post values directly on config page and display error
* first usage report will be send after 7 days
2017-11-14 21:11:32 +01:00
slawkens1
867c86d702 github is weird 2017-11-14 20:01:14 +01:00
slawkens1
05f8756a12 * fixed viewing pages with capital letters (like serverInfo) on case sensitive systems
* fixed changing comment of characters with space and other special
characters in name (#29)
* fixed viewing guilds with space and other special characters in name
(#29)
* (kathrine template) fixed displaying menu when no URI is set (URI =
'/')
* added some additional checks for Validator guildName and rankName if
name is empty
* (internal) new twig filter: urlencode, which is using urlencode php
function
2017-11-14 19:58:44 +01:00
slawkens1
56a01e1e64 * fixed account email confirm function
* log some error info when mail cannot be send on account create
* fixed some weird include possibilities with forum and account actions
(verify action name)
* twig getLink function will now return with full url (BASE_URL
included)
* fixed some changelog PHP Notice warning
* (internal) shortened message functions
2017-11-12 21:55:12 +01:00