mirror of
https://github.com/slawkens/myaac.git
synced 2026-02-06 21:26:22 +01:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c753feeeb0 | ||
|
|
e33e86053d | ||
|
|
6db738a87c | ||
|
|
e52d9e486f | ||
|
|
6859b86f28 | ||
|
|
c472d5e473 | ||
|
|
e8b47429e8 | ||
|
|
c2415e9df3 | ||
|
|
5e4806f891 | ||
|
|
8dcbb66753 | ||
|
|
7916cfa85f | ||
|
|
21e6812cf2 | ||
|
|
6661c78dac | ||
|
|
a60a23b84f | ||
|
|
f640ca636f | ||
|
|
5b841682cd |
2
.github/workflows/phpstan.yml
vendored
2
.github/workflows/phpstan.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
|||||||
coverage: "none"
|
coverage: "none"
|
||||||
extensions: "intl, zip"
|
extensions: "intl, zip"
|
||||||
ini-values: "memory_limit=-1"
|
ini-values: "memory_limit=-1"
|
||||||
php-version: "${{ matrix.php-version }}"
|
php-version: "${{ matrix.php-versions }}"
|
||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
|
|||||||
@@ -1,5 +1,21 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.8.8 - 31.01.2026]
|
||||||
|
### Added
|
||||||
|
* Change Comment: Add missing hooks - patched from 0.8 (https://github.com/slawkens/myaac/commit/a60a23b84f61d41d1503073b52e01e3120f6d92a)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
* Account Manage: Change the last login to the correct login time – Instead of just "now" (https://github.com/slawkens/myaac/commit/5b841682cdc473b38ef1a5edfcfe1a020802e286)
|
||||||
|
* Twig: Extract renderInline(content, context) as a method to $twig (https://github.com/slawkens/myaac/commit/5e4806f891f8c88c37d45b89bbede23afc2fa37b)
|
||||||
|
* Mail: Remove HTML tags from the email function (https://github.com/slawkens/myaac/commit/6661c78dac69c6aa498b9c79fe7da4fe0150e5c8)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* Forum: Fix XSS in board name (https://github.com/slawkens/myaac/commit/e52d9e486f5bf1dea867f59287f70aef3d538189, https://github.com/slawkens/myaac/commit/6db738a87c44b8d96919191ba5e661c32ab47457)
|
||||||
|
* Forum: Fix edit_post, despite being an author, edit didn't work (https://github.com/slawkens/myaac/commit/e8b47429e8c607c2662a78b65415dfa772aa0e48)
|
||||||
|
* Forum: Fix a player link in the forum thread being not clickable (When outfits are enabled) (https://github.com/slawkens/myaac/commit/f640ca636f34cd2dfc1fa8de6fdbed0674908b30)
|
||||||
|
* Settings: Fix variable overlapping if the same var name as in core (https://github.com/slawkens/myaac/commit/c2415e9df3a5ffaf768f6f9668bdd38b5efd0771)
|
||||||
|
* Settings: fix show_if for the selects (https://github.com/slawkens/myaac/commit/8dcbb66753914322706216cfd01436eb1478a5ce)
|
||||||
|
|
||||||
## [1.8.7 - 04.01.2026]
|
## [1.8.7 - 04.01.2026]
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -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.8.7';
|
const MYAAC_VERSION = '1.8.8';
|
||||||
const DATABASE_VERSION = 46;
|
const DATABASE_VERSION = 46;
|
||||||
const TABLE_PREFIX = 'myaac_';
|
const TABLE_PREFIX = 'myaac_';
|
||||||
define('START_TIME', microtime(true));
|
define('START_TIME', microtime(true));
|
||||||
|
|||||||
22
package-lock.json
generated
22
package-lock.json
generated
@@ -18,9 +18,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@cypress/request": {
|
"node_modules/@cypress/request": {
|
||||||
"version": "3.0.8",
|
"version": "3.0.10",
|
||||||
"resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.10.tgz",
|
||||||
"integrity": "sha512-h0NFgh1mJmm1nr4jCwkGHwKneVYKghUyWe6TMNrk0B9zsjAJxpg8C4/+BAcmLgCPa1vj1V8rNUaILl+zYRUWBQ==",
|
"integrity": "sha512-hauBrOdvu08vOsagkZ/Aju5XuiZx6ldsLfByg1htFeldhex+PeMrYauANzFsMJeAA0+dyPLbDoX2OYuvVoLDkQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -30,14 +30,14 @@
|
|||||||
"combined-stream": "~1.0.6",
|
"combined-stream": "~1.0.6",
|
||||||
"extend": "~3.0.2",
|
"extend": "~3.0.2",
|
||||||
"forever-agent": "~0.6.1",
|
"forever-agent": "~0.6.1",
|
||||||
"form-data": "~4.0.0",
|
"form-data": "~4.0.4",
|
||||||
"http-signature": "~1.4.0",
|
"http-signature": "~1.4.0",
|
||||||
"is-typedarray": "~1.0.0",
|
"is-typedarray": "~1.0.0",
|
||||||
"isstream": "~0.1.2",
|
"isstream": "~0.1.2",
|
||||||
"json-stringify-safe": "~5.0.1",
|
"json-stringify-safe": "~5.0.1",
|
||||||
"mime-types": "~2.1.19",
|
"mime-types": "~2.1.19",
|
||||||
"performance-now": "^2.1.0",
|
"performance-now": "^2.1.0",
|
||||||
"qs": "6.14.0",
|
"qs": "~6.14.1",
|
||||||
"safe-buffer": "^5.1.2",
|
"safe-buffer": "^5.1.2",
|
||||||
"tough-cookie": "^5.0.0",
|
"tough-cookie": "^5.0.0",
|
||||||
"tunnel-agent": "^0.6.0",
|
"tunnel-agent": "^0.6.0",
|
||||||
@@ -1431,9 +1431,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lodash": {
|
"node_modules/lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.23",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
@@ -1743,9 +1743,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/qs": {
|
"node_modules/qs": {
|
||||||
"version": "6.14.0",
|
"version": "6.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz",
|
||||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
"integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ use MyAAC\News;
|
|||||||
use MyAAC\Plugins;
|
use MyAAC\Plugins;
|
||||||
use MyAAC\Settings;
|
use MyAAC\Settings;
|
||||||
use PHPMailer\PHPMailer\PHPMailer;
|
use PHPMailer\PHPMailer\PHPMailer;
|
||||||
use Twig\Loader\ArrayLoader as Twig_ArrayLoader;
|
|
||||||
|
|
||||||
function message($message, $type, $return)
|
function message($message, $type, $return)
|
||||||
{
|
{
|
||||||
@@ -878,11 +877,12 @@ function getWorldName($id)
|
|||||||
*
|
*
|
||||||
* @param string $to Recipient email address.
|
* @param string $to Recipient email address.
|
||||||
* @param string $subject Subject of the message.
|
* @param string $subject Subject of the message.
|
||||||
* @param string $body Message body in html format.
|
* @param string $body Message body in HTML format.
|
||||||
* @param string $altBody Alternative message body, plain text.
|
* @param string $altBody Alternative message body, plain text.
|
||||||
* @return bool PHPMailer status returned (success/failure).
|
* @return bool PHPMailer status returned (success/failure).
|
||||||
|
* @throws \PHPMailer\PHPMailer\Exception
|
||||||
*/
|
*/
|
||||||
function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
|
function _mail(string $to, string $subject, string $body, string $altBody = ''): bool
|
||||||
{
|
{
|
||||||
global $mailer, $config;
|
global $mailer, $config;
|
||||||
|
|
||||||
@@ -900,12 +900,6 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
|
|||||||
$mailer->clearAllRecipients();
|
$mailer->clearAllRecipients();
|
||||||
}
|
}
|
||||||
|
|
||||||
$signature_html = setting('core.mail_signature_html');
|
|
||||||
if($add_html_tags && isset($body[0]))
|
|
||||||
$tmp_body = '<html><head></head><body>' . $body . '<br/><br/>' . $signature_html . '</body></html>';
|
|
||||||
else
|
|
||||||
$tmp_body = $body . '<br/><br/>' . $signature_html;
|
|
||||||
|
|
||||||
$mailOption = setting('core.mail_option');
|
$mailOption = setting('core.mail_option');
|
||||||
if($mailOption == MAIL_SMTP)
|
if($mailOption == MAIL_SMTP)
|
||||||
{
|
{
|
||||||
@@ -932,6 +926,9 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
|
|||||||
$mailer->isMail();
|
$mailer->isMail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$signature_html = setting('core.mail_signature_html');
|
||||||
|
$tmp_body = $body . '<br/><br/>' . $signature_html;
|
||||||
|
|
||||||
$mailer->isHTML(isset($body[0]) > 0);
|
$mailer->isHTML(isset($body[0]) > 0);
|
||||||
$mailer->From = setting('core.mail_address');
|
$mailer->From = setting('core.mail_address');
|
||||||
$mailer->Sender = setting('core.mail_address');
|
$mailer->Sender = setting('core.mail_address');
|
||||||
@@ -1381,17 +1378,7 @@ function getCustomPage($name, &$success): string
|
|||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$oldLoader = $twig->getLoader();
|
$content .= $twig->renderInline($page['body']);
|
||||||
|
|
||||||
$twig_loader_array = new Twig_ArrayLoader(array(
|
|
||||||
'content.html' => $page['body']
|
|
||||||
));
|
|
||||||
|
|
||||||
$twig->setLoader($twig_loader_array);
|
|
||||||
|
|
||||||
$content .= $twig->render('content.html');
|
|
||||||
|
|
||||||
$twig->setLoader($oldLoader);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ if($player_name != null) {
|
|||||||
'description' => 'The character information has been changed.'
|
'description' => 'The character information has been changed.'
|
||||||
));
|
));
|
||||||
$show_form = false;
|
$show_form = false;
|
||||||
|
|
||||||
|
$hooks->trigger(HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_SUCCESS, ['player' => $player]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -70,9 +72,11 @@ if($show_form) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isset($player) && $player) {
|
if(isset($player) && $player) {
|
||||||
$twig->display('account.characters.change-comment.html.twig', array(
|
$_player = $player->toArray();
|
||||||
'player' => $player->toArray()
|
$_player['id'] = $player->id; // Hack, as it's somehow missing in the toArray() function
|
||||||
));
|
|
||||||
|
$twig->display('account.characters.change-comment.html.twig', [
|
||||||
|
'player' => $_player,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ if(Forum::canPost($account_logged)) {
|
|||||||
$thread = $db->query("SELECT `author_guid`, `author_aid`, `first_post`, `post_topic`, `post_date`, `post_text`, `post_smile`, `post_html`, `id`, `section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `id` = ".$post_id." LIMIT 1")->fetch();
|
$thread = $db->query("SELECT `author_guid`, `author_aid`, `first_post`, `post_topic`, `post_date`, `post_text`, `post_smile`, `post_html`, `id`, `section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `id` = ".$post_id." LIMIT 1")->fetch();
|
||||||
if(isset($thread['id'])) {
|
if(isset($thread['id'])) {
|
||||||
$first_post = $db->query("SELECT `" . FORUM_TABLE_PREFIX . "forum`.`author_guid`, `" . FORUM_TABLE_PREFIX . "forum`.`author_aid`, `" . FORUM_TABLE_PREFIX . "forum`.`first_post`, `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`post_text`, `" . FORUM_TABLE_PREFIX . "forum`.`post_smile`, `" . FORUM_TABLE_PREFIX . "forum`.`id`, `" . FORUM_TABLE_PREFIX . "forum`.`section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `" . FORUM_TABLE_PREFIX . "forum`.`id` = ".(int) $thread['first_post']." LIMIT 1")->fetch();
|
$first_post = $db->query("SELECT `" . FORUM_TABLE_PREFIX . "forum`.`author_guid`, `" . FORUM_TABLE_PREFIX . "forum`.`author_aid`, `" . FORUM_TABLE_PREFIX . "forum`.`first_post`, `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`post_text`, `" . FORUM_TABLE_PREFIX . "forum`.`post_smile`, `" . FORUM_TABLE_PREFIX . "forum`.`id`, `" . FORUM_TABLE_PREFIX . "forum`.`section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `" . FORUM_TABLE_PREFIX . "forum`.`id` = ".(int) $thread['first_post']." LIMIT 1")->fetch();
|
||||||
echo '<a href="' . getLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($thread['section']) . '">'.$sections[$thread['section']]['name'].'</a> >> <a href="' . getForumThreadLink($thread['first_post']) . '">'.htmlspecialchars($first_post['post_topic']).'</a> >> <b>Edit post</b>';
|
echo '<a href="' . getLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($thread['section']) . '">'.escapeHtml($sections[$thread['section']]['name']).'</a> >> <a href="' . getForumThreadLink($thread['first_post']) . '">'.htmlspecialchars($first_post['post_topic']).'</a> >> <b>Edit post</b>';
|
||||||
|
|
||||||
if(Forum::hasAccess($thread['section'] && ($account_logged->getId() == $thread['author_aid'] || Forum::isModerator()))) {
|
if(Forum::hasAccess($thread['section']) && ($account_logged->getId() == $thread['author_aid'] || Forum::isModerator())) {
|
||||||
$char_id = $post_topic = $text = $smile = $html = null;
|
$char_id = $post_topic = $text = $smile = $html = null;
|
||||||
$players_from_account = $db->query("SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = ".(int) $account_logged->getId())->fetchAll();
|
$players_from_account = $db->query("SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = ".(int) $account_logged->getId())->fetchAll();
|
||||||
$saved = false;
|
$saved = false;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ if(Forum::canPost($account_logged)) {
|
|||||||
$thread = $db->query("SELECT `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`id`, `" . FORUM_TABLE_PREFIX . "forum`.`section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `" . FORUM_TABLE_PREFIX . "forum`.`id` = ".(int) $thread_id." AND `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = ".$thread_id." LIMIT 1")->fetch();
|
$thread = $db->query("SELECT `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`id`, `" . FORUM_TABLE_PREFIX . "forum`.`section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `" . FORUM_TABLE_PREFIX . "forum`.`id` = ".(int) $thread_id." AND `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = ".$thread_id." LIMIT 1")->fetch();
|
||||||
|
|
||||||
if(isset($thread['id']) && Forum::hasAccess($thread['section'])) {
|
if(isset($thread['id']) && Forum::hasAccess($thread['section'])) {
|
||||||
echo '<a href="' . getLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($thread['section']) . '">'.$sections[$thread['section']]['name'].'</a> >> <a href="' . getForumThreadLink($thread_id) . '">'.htmlspecialchars($thread['post_topic']).'</a> >> <b>Post new reply</b><br /><h3>'.htmlspecialchars($thread['post_topic']).'</h3>';
|
echo '<a href="' . getLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($thread['section']) . '">'.escapeHtml($sections[$thread['section']]['name']).'</a> >> <a href="' . getForumThreadLink($thread_id) . '">'.htmlspecialchars($thread['post_topic']).'</a> >> <b>Post new reply</b><br /><h3>'.htmlspecialchars($thread['post_topic']).'</h3>';
|
||||||
|
|
||||||
$quote = isset($_REQUEST['quote']) ? (int) $_REQUEST['quote'] : NULL;
|
$quote = isset($_REQUEST['quote']) ? (int) $_REQUEST['quote'] : NULL;
|
||||||
$text = isset($_POST['text']) ? stripslashes(trim($_POST['text'])) : NULL;
|
$text = isset($_POST['text']) ? stripslashes(trim($_POST['text'])) : NULL;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ if(Forum::canPost($account_logged)) {
|
|||||||
$players_from_account = $db->query('SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = '.(int) $account_logged->getId())->fetchAll();
|
$players_from_account = $db->query('SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = '.(int) $account_logged->getId())->fetchAll();
|
||||||
$section_id = $_REQUEST['section_id'] ?? null;
|
$section_id = $_REQUEST['section_id'] ?? null;
|
||||||
if($section_id !== null) {
|
if($section_id !== null) {
|
||||||
echo '<a href="' . getLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($section_id) . '">' . $sections[$section_id]['name'] . '</a> >> <b>Post new thread</b><br />';
|
echo '<a href="' . getLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($section_id) . '">' . escapeHtml($sections[$section_id]['name']) . '</a> >> <b>Post new thread</b><br />';
|
||||||
|
|
||||||
if(isset($sections[$section_id]['name']) && Forum::hasAccess($section_id)) {
|
if(isset($sections[$section_id]['name']) && Forum::hasAccess($section_id)) {
|
||||||
if ($sections[$section_id]['closed'] && !Forum::isModerator())
|
if ($sections[$section_id]['closed'] && !Forum::isModerator())
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ for($i = 0; $i < $threads_count['threads_count'] / setting('core.forum_threads_p
|
|||||||
$links_to_pages .= '<b>'.($i + 1).' </b>';
|
$links_to_pages .= '<b>'.($i + 1).' </b>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<a href="' . getLink('forum') . '">Boards</a> >> <b>'.$sections[$section_id]['name'].'</b>';
|
echo '<a href="' . getLink('forum') . '">Boards</a> >> <b>'.escapeHtml($sections[$section_id]['name']).'</b>';
|
||||||
|
|
||||||
if($logged && (!$sections[$section_id]['closed'] || Forum::isModerator())) {
|
if($logged && (!$sections[$section_id]['closed'] || Forum::isModerator())) {
|
||||||
echo '<br /><br />
|
echo '<br /><br />
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ foreach($posts as &$post) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$post['group'] = $groupName;
|
$post['group'] = $groupName;
|
||||||
$post['player_link'] = getPlayerLink($player->getName());
|
$post['player_link'] = '<a href="' . getPlayerLink($player, false) . '" style="position: relative;">' . $player->getName() . '</a>';
|
||||||
|
|
||||||
$post['vocation'] = $player->getVocationName();
|
$post['vocation'] = $player->getVocationName();
|
||||||
|
|
||||||
|
|||||||
@@ -122,18 +122,21 @@ class Settings implements \ArrayAccess
|
|||||||
public static function display($plugin, $settings): array
|
public static function display($plugin, $settings): array
|
||||||
{
|
{
|
||||||
$settingsDb = ModelsSettings::where('name', $plugin)->pluck('value', 'key')->toArray();
|
$settingsDb = ModelsSettings::where('name', $plugin)->pluck('value', 'key')->toArray();
|
||||||
$config = [];
|
|
||||||
require BASE . 'config.local.php';
|
|
||||||
|
|
||||||
foreach ($config as $key => $value) {
|
if ($plugin === 'core') {
|
||||||
if (is_bool($value)) {
|
$config = [];
|
||||||
$settingsDb[$key] = $value ? 'true' : 'false';
|
require BASE . 'config.local.php';
|
||||||
}
|
|
||||||
elseif (is_array($value)) {
|
foreach ($config as $key => $value) {
|
||||||
$settingsDb[$key] = $value;
|
if (is_bool($value)) {
|
||||||
}
|
$settingsDb[$key] = $value ? 'true' : 'false';
|
||||||
else {
|
}
|
||||||
$settingsDb[$key] = (string)$value;
|
elseif (is_array($value)) {
|
||||||
|
$settingsDb[$key] = $value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$settingsDb[$key] = (string)$value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace MyAAC\Twig;
|
namespace MyAAC\Twig;
|
||||||
|
|
||||||
use Twig\Environment;
|
use Twig\Environment;
|
||||||
|
use Twig\Loader\ArrayLoader as Twig_ArrayLoader;
|
||||||
|
|
||||||
class EnvironmentBridge extends Environment
|
class EnvironmentBridge extends Environment
|
||||||
{
|
{
|
||||||
@@ -25,4 +26,21 @@ class EnvironmentBridge extends Environment
|
|||||||
|
|
||||||
return parent::render($name, $context);
|
return parent::render($name, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function renderInline($content, array $context = []): string
|
||||||
|
{
|
||||||
|
$oldLoader = $this->getLoader();
|
||||||
|
|
||||||
|
$twig_loader_array = new Twig_ArrayLoader(array(
|
||||||
|
'content.html' => $content
|
||||||
|
));
|
||||||
|
|
||||||
|
$this->setLoader($twig_loader_array);
|
||||||
|
|
||||||
|
$ret = $this->render('content.html', $context);
|
||||||
|
|
||||||
|
$this->setLoader($oldLoader);
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ define('HOOK_CHARACTERS_AFTER_CHARACTERS', ++$i);
|
|||||||
define('HOOK_LOGIN', ++$i);
|
define('HOOK_LOGIN', ++$i);
|
||||||
define('HOOK_LOGIN_ATTEMPT', ++$i);
|
define('HOOK_LOGIN_ATTEMPT', ++$i);
|
||||||
define('HOOK_LOGOUT', ++$i);
|
define('HOOK_LOGOUT', ++$i);
|
||||||
|
define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_SUCCESS', ++$i);
|
||||||
|
define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_NAME', ++$i);
|
||||||
|
define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_HIDE_ACCOUNT', ++$i);
|
||||||
|
define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_COMMENT', ++$i);
|
||||||
define('HOOK_ACCOUNT_CHANGE_PASSWORD_AFTER_OLD_PASSWORD', ++$i);
|
define('HOOK_ACCOUNT_CHANGE_PASSWORD_AFTER_OLD_PASSWORD', ++$i);
|
||||||
define('HOOK_ACCOUNT_CHANGE_PASSWORD_AFTER_NEW_PASSWORD', ++$i);
|
define('HOOK_ACCOUNT_CHANGE_PASSWORD_AFTER_NEW_PASSWORD', ++$i);
|
||||||
define('HOOK_ACCOUNT_CHANGE_PASSWORD_POST', ++$i);
|
define('HOOK_ACCOUNT_CHANGE_PASSWORD_POST', ++$i);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ If you do not want to specify a certain field, just leave it blank.<br/><br/>
|
|||||||
<td class="LabelV">Name:</td>
|
<td class="LabelV">Name:</td>
|
||||||
<td style="width:80%;" >{{ player.name }}</td>
|
<td style="width:80%;" >{{ player.name }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_NAME') }}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="LabelV" >Hide Account:</td>
|
<td class="LabelV" >Hide Account:</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -42,6 +43,7 @@ If you do not want to specify a certain field, just leave it blank.<br/><br/>
|
|||||||
{% if player.group_id > 1 %} (you will be also hidden on the Team page!){% endif %}
|
{% if player.group_id > 1 %} (you will be also hidden on the Team page!){% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_HIDE_ACCOUNT') }}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -65,6 +67,7 @@ If you do not want to specify a certain field, just leave it blank.<br/><br/>
|
|||||||
<td class="LabelV" ><span>Comment:</span></td>
|
<td class="LabelV" ><span>Comment:</span></td>
|
||||||
<td style="width:80%;"><textarea name="comment" rows="10" cols="50" wrap="virtual">{{ player.comment|raw }}</textarea><br>[max. length: 2000 chars, 50 lines (ENTERs)]</td>
|
<td style="width:80%;"><textarea name="comment" rows="10" cols="50" wrap="virtual">{{ player.comment|raw }}</textarea><br>[max. length: 2000 chars, 50 lines (ENTERs)]</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_COMMENT') }}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -114,7 +114,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr style="background-color: {{ config.darkborder }};" >
|
<tr style="background-color: {{ config.darkborder }};" >
|
||||||
<td>Last Login:</td>
|
<td>Last Login:</td>
|
||||||
<td>{{ "now"|date("j F Y, G:i:s") }}</td>
|
<td>{{ account_logged.getCustomField('web_lastlogin')|date("j F Y, G:i:s") }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% autoescape false %}
|
{% autoescape false %}
|
||||||
<tr style="background-color: {{ config.lightborder }};" >
|
<tr style="background-color: {{ config.lightborder }};" >
|
||||||
|
|||||||
@@ -37,21 +37,31 @@
|
|||||||
{% for key, value in settings %}
|
{% for key, value in settings %}
|
||||||
{% if value.show_if is defined %}
|
{% if value.show_if is defined %}
|
||||||
$(function () {
|
$(function () {
|
||||||
$('input[name="settings[{{ value.show_if[0] }}]"]').change(function () {
|
{% set inputType = 'input' %}
|
||||||
|
|
||||||
|
{% if settings[value.show_if[0]]['type'] == 'options' %}
|
||||||
|
{% set inputType = 'select' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
$('{{ inputType }}[name="settings[{{ value.show_if[0] }}]"]').change(function () {
|
||||||
performChecks_{{ key }}(this);
|
performChecks_{{ key }}(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
{% if settings[value.show_if[0]]['type'] == 'boolean' %}
|
{% if settings[value.show_if[0]]['type'] == 'boolean' %}
|
||||||
performChecks_{{ key }}('input[name="settings[{{ value.show_if[0] }}]"]:checked');
|
performChecks_{{ key }}('input[name="settings[{{ value.show_if[0] }}]"]:checked');
|
||||||
{% else %}
|
{% else %}
|
||||||
performChecks_{{ key }}('input[name="settings[{{ value.show_if[0] }}]"]');
|
performChecks_{{ key }}('{{ inputType }}[name="settings[{{ value.show_if[0] }}]"]');
|
||||||
{% endif %}
|
{% endif %}
|
||||||
});
|
});
|
||||||
|
|
||||||
function performChecks_{{ key }}(el)
|
function performChecks_{{ key }}(el)
|
||||||
{
|
{
|
||||||
let success = false;
|
let success = false;
|
||||||
|
|
||||||
let thisVal = $(el).val();
|
let thisVal = $(el).val();
|
||||||
|
{% if settings[value.show_if[0]]['type'] == 'options' %}
|
||||||
|
thisVal = $(el).find(":selected").val();
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
let operator = '{{ value.show_if[1]|raw }}';
|
let operator = '{{ value.show_if[1]|raw }}';
|
||||||
if (operator === '>') {
|
if (operator === '>') {
|
||||||
|
|||||||
@@ -151,7 +151,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr style="background-color: {{ config.darkborder }};" >
|
<tr style="background-color: {{ config.darkborder }};" >
|
||||||
<td class="LabelV" >Last Login:</td>
|
<td class="LabelV" >Last Login:</td>
|
||||||
<td>{{ "now"|date("j F Y, G:i:s") }}</td>
|
<td>{{ account_logged.getCustomField('web_lastlogin')|date("j F Y, G:i:s") }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% autoescape false %}
|
{% autoescape false %}
|
||||||
<tr style="background-color: {{ config.lightborder }};">
|
<tr style="background-color: {{ config.lightborder }};">
|
||||||
|
|||||||
Reference in New Issue
Block a user