mirror of
https://github.com/slawkens/myaac.git
synced 2025-09-14 12:33:35 +02:00
Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f503e140f3 | ||
![]() |
f875f3cd20 | ||
![]() |
72632c7b45 | ||
![]() |
1f2e7bd72d | ||
![]() |
016138ab55 | ||
![]() |
77efb80a12 | ||
![]() |
02eea950e4 | ||
![]() |
2793c41655 | ||
![]() |
62d3c198d5 | ||
![]() |
ef62b53cec | ||
![]() |
7181b988e9 | ||
![]() |
8b0b123f42 | ||
![]() |
f98332c698 | ||
![]() |
b1660bf27a | ||
![]() |
191ad25eb2 | ||
![]() |
7469be6efb | ||
![]() |
47a3bfd265 | ||
![]() |
5ae0be2323 | ||
![]() |
42154d55a0 | ||
![]() |
9dcc08ee6e | ||
![]() |
ba537b42bb | ||
![]() |
9c318f9012 | ||
![]() |
a88103a956 | ||
![]() |
e26e6f3a1c | ||
![]() |
08d67a07e0 | ||
![]() |
6e9a89cb2e | ||
![]() |
e3aa3d4031 | ||
![]() |
156a68f8bd | ||
![]() |
6a28da5d33 | ||
![]() |
ee32384dca | ||
![]() |
19afd73e8a | ||
![]() |
eead6a2975 |
2
.github/workflows/phplint.yml
vendored
2
.github/workflows/phplint.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: overtrue/phplint@7.4
|
- uses: overtrue/phplint@3.4.0
|
||||||
with:
|
with:
|
||||||
path: .
|
path: .
|
||||||
options: --exclude="system/libs/polyfill-mbstring/bootstrap80.php"
|
options: --exclude="system/libs/polyfill-mbstring/bootstrap80.php"
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -11,10 +11,12 @@ vendor
|
|||||||
|
|
||||||
# npm
|
# npm
|
||||||
node_modules
|
node_modules
|
||||||
|
tools/ext
|
||||||
|
|
||||||
# cypress
|
# cypress
|
||||||
cypress.env.json
|
cypress.env.json
|
||||||
cypress/e2e/2-advanced-examples
|
cypress/e2e/2-advanced-examples
|
||||||
|
cypress/screenshots
|
||||||
|
|
||||||
# created by release.sh
|
# created by release.sh
|
||||||
releases
|
releases
|
||||||
|
30
CHANGELOG.md
30
CHANGELOG.md
@@ -1,5 +1,35 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.8.18 - 29.05.2024]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
* hook in guilds page to support guild wars (https://github.com/slawkens/myaac/commit/f875f3cd2059fac5c23a08ce73dd8621a66613e0)
|
||||||
|
|
||||||
|
## [0.8.17 - 18.05.2024]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
* TwigTypeCastingExtension (https://github.com/slawkens/myaac/commit/7181b988e9518320d57486670ca4e2d3b2fe1cfa)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* fix XSS in creatures.php (https://github.com/slawkens/myaac/commit/02eea950e4fd756e8d5c32e56181986d51f5ac70, @gesior)
|
||||||
|
* don't allow redirect to external website (https://github.com/slawkens/myaac/commit/ef62b53cec5a479cc85aa15940ad9ebbcefde876)
|
||||||
|
* change_info if account_country is disabled (https://github.com/slawkens/myaac/commit/62d3c198d567541a90900fe2d7ede070e7b1ff68)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
* use word-break: break-all in guilds description + character comment (https://github.com/slawkens/myaac/commit/191ad25eb2d4c1cec6f6668da7a345fec0ad2a7f)
|
||||||
|
* set default status_ip to 127.0.0.1, most server are hosted locally anyway (https://github.com/slawkens/myaac/commit/2793c41655b47f7db295143a298ccda70f11462b)
|
||||||
|
|
||||||
|
## [0.8.16 - 12.02.2024]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* broken installation
|
||||||
|
* database and finish step warnings/errors (https://github.com/slawkens/myaac/pull/245, @danilopucci)
|
||||||
|
* silently ignore if the hook does not exist
|
||||||
|
|
||||||
|
## [0.8.15 - 09.12.2023]
|
||||||
|
|
||||||
|
More security fixes, especially in bugtracker.
|
||||||
|
|
||||||
## [0-8.14 - 27.11.2023]
|
## [0-8.14 - 27.11.2023]
|
||||||
Security fixes.
|
Security fixes.
|
||||||
|
|
||||||
|
24
README.md
24
README.md
@@ -10,21 +10,20 @@ Official website: https://my-aac.org
|
|||||||
[](https://discord.gg/2J39Wus)
|
[](https://discord.gg/2J39Wus)
|
||||||
[](https://github.com/slawkens/myaac/issues?q=is%3Aissue+is%3Aclosed)
|
[](https://github.com/slawkens/myaac/issues?q=is%3Aissue+is%3Aclosed)
|
||||||
|
|
||||||
| Version | Status | Branch | Requirements |
|
| Version | Status | Branch | Requirements |
|
||||||
|:-----------|:------------------------------------------|:--------|:---------------|
|
|:--------|:-----------------------|:--------|:---------------|
|
||||||
| **0.10.x** | **Active development** | develop | **PHP >= 8.0** |
|
| **1.x** | **Active development** | develop | **PHP >= 8.1** |
|
||||||
| 0.9.x | Active support | 0.9 | PHP >= 7.2.5 |
|
| 0.9.x | Not developed anymore | 0.9 | PHP >= 7.2.5 |
|
||||||
| 0.8.x | Active support | master | PHP >= 7.2.5 |
|
| 0.8.x | Active support | master | PHP >= 7.2.5 |
|
||||||
| 0.7.x | End Of Life | 0.7 | PHP >= 5.3.3 |
|
| 0.7.x | End Of Life | 0.7 | PHP >= 5.3.3 |
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- PHP 7.2.5 or later
|
|
||||||
- MySQL database
|
- MySQL database
|
||||||
- PDO PHP Extension
|
- PHP Extensions: pdo, xml, json
|
||||||
- XML PHP Extension
|
- (optional) apache2 mod_rewrite (to use friendly_urls)
|
||||||
- ZIP PHP Extension
|
- (optional) zip PHP Extension (to install plugins)
|
||||||
- (optional) mod_rewrite to use friendly_urls
|
- (optional) gd PHP Extension (for generating signature images)
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
@@ -48,7 +47,8 @@ Official website: https://my-aac.org
|
|||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
Check *config.php* to get more informations.
|
Check *config.php* to get more informations. (Notice: MyAAC 1.0+ doesn't use config.php anymore, it has been moved to Admin Panel - Settings page).
|
||||||
|
|
||||||
Use *config.local.php* for your local configuration changes.
|
Use *config.local.php* for your local configuration changes.
|
||||||
|
|
||||||
### Branches
|
### Branches
|
||||||
|
16
SECURITY.md
Normal file
16
SECURITY.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 1.x.y | :white_check_mark: |
|
||||||
|
| 0.9.x | :x: |
|
||||||
|
| 0.8.x | :white_check_mark: |
|
||||||
|
| < 0.7 | :x: |
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
If you found a security vulnerability, please write an email to security@my-aac.org
|
||||||
|
|
||||||
|
All reports will be taken very seriously, and a fix will be posted as soon as possible.
|
11
common.php
11
common.php
@@ -26,7 +26,7 @@
|
|||||||
if (version_compare(phpversion(), '7.2.5', '<')) die('PHP version 7.2.5 or higher is required.');
|
if (version_compare(phpversion(), '7.2.5', '<')) die('PHP version 7.2.5 or higher is required.');
|
||||||
|
|
||||||
define('MYAAC', true);
|
define('MYAAC', true);
|
||||||
define('MYAAC_VERSION', '0.8.14');
|
define('MYAAC_VERSION', '0.8.18');
|
||||||
define('DATABASE_VERSION', 33);
|
define('DATABASE_VERSION', 33);
|
||||||
define('TABLE_PREFIX', 'myaac_');
|
define('TABLE_PREFIX', 'myaac_');
|
||||||
define('START_TIME', microtime(true));
|
define('START_TIME', microtime(true));
|
||||||
@@ -100,6 +100,10 @@ for($i = 1; $i < $size; $i++)
|
|||||||
$basedir = str_replace(array('/admin', '/install', '/tools'), '', $basedir);
|
$basedir = str_replace(array('/admin', '/install', '/tools'), '', $basedir);
|
||||||
define('BASE_DIR', $basedir);
|
define('BASE_DIR', $basedir);
|
||||||
|
|
||||||
|
if (file_exists(BASE . 'config.local.php') && !defined('MYAAC_INSTALL')) {
|
||||||
|
require BASE . 'config.local.php';
|
||||||
|
}
|
||||||
|
|
||||||
if(!IS_CLI) {
|
if(!IS_CLI) {
|
||||||
if (isset($_SERVER['HTTP_HOST'][0])) {
|
if (isset($_SERVER['HTTP_HOST'][0])) {
|
||||||
$baseHost = $_SERVER['HTTP_HOST'];
|
$baseHost = $_SERVER['HTTP_HOST'];
|
||||||
@@ -116,7 +120,8 @@ if(!IS_CLI) {
|
|||||||
define('ADMIN_URL', SERVER_URL . BASE_DIR . '/admin/');
|
define('ADMIN_URL', SERVER_URL . BASE_DIR . '/admin/');
|
||||||
|
|
||||||
//define('CURRENT_URL', BASE_URL . $_SERVER['REQUEST_URI']);
|
//define('CURRENT_URL', BASE_URL . $_SERVER['REQUEST_URI']);
|
||||||
|
if(@$config['env'] === 'dev') {
|
||||||
require SYSTEM . 'exception.php';
|
require SYSTEM . 'exception.php';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
require SYSTEM . 'autoload.php';
|
require SYSTEM . 'autoload.php';
|
||||||
|
@@ -268,9 +268,9 @@ $config = array(
|
|||||||
|
|
||||||
// status, took automatically from config file if empty
|
// status, took automatically from config file if empty
|
||||||
'status_enabled' => true, // you can disable status checking by settings this to "false"
|
'status_enabled' => true, // you can disable status checking by settings this to "false"
|
||||||
'status_ip' => '',
|
'status_ip' => '127.0.0.1',
|
||||||
'status_port' => '',
|
'status_port' => '',
|
||||||
'status_timeout' => 2, // how long to wait for the initial response from the server (default: 2 seconds)
|
'status_timeout' => 1.0, // how long to wait for the initial response from the server (default: 1 second)
|
||||||
|
|
||||||
// how often to connect to server and update status (default: every minute)
|
// how often to connect to server and update status (default: every minute)
|
||||||
// if your status timeout in config.lua is bigger, that it will be used instead
|
// if your status timeout in config.lua is bigger, that it will be used instead
|
||||||
@@ -290,12 +290,12 @@ $config = array(
|
|||||||
'footer_show_load_time' => true, // display load time of the page in the footer
|
'footer_show_load_time' => true, // display load time of the page in the footer
|
||||||
|
|
||||||
'npc' => array(),
|
'npc' => array(),
|
||||||
|
|
||||||
// character name blocked
|
// character name blocked
|
||||||
'character_name_blocked' => array(
|
'character_name_blocked' => array(
|
||||||
'prefix' => array(),
|
'prefix' => array(),
|
||||||
'names' => array(),
|
'names' => array(),
|
||||||
'words' => array(),
|
'words' => array(),
|
||||||
),
|
),
|
||||||
|
|
||||||
);
|
);
|
||||||
|
@@ -11,8 +11,10 @@ $error = false;
|
|||||||
require BASE . 'install/includes/config.php';
|
require BASE . 'install/includes/config.php';
|
||||||
|
|
||||||
ini_set('max_execution_time', 300);
|
ini_set('max_execution_time', 300);
|
||||||
|
|
||||||
|
@ob_end_flush();
|
||||||
ob_implicit_flush();
|
ob_implicit_flush();
|
||||||
ob_end_flush();
|
|
||||||
header('X-Accel-Buffering: no');
|
header('X-Accel-Buffering: no');
|
||||||
|
|
||||||
if(!$error) {
|
if(!$error) {
|
||||||
|
@@ -8,8 +8,10 @@ require BASE . 'install/includes/functions.php';
|
|||||||
require BASE . 'install/includes/locale.php';
|
require BASE . 'install/includes/locale.php';
|
||||||
|
|
||||||
ini_set('max_execution_time', 300);
|
ini_set('max_execution_time', 300);
|
||||||
|
|
||||||
|
@ob_end_flush();
|
||||||
ob_implicit_flush();
|
ob_implicit_flush();
|
||||||
ob_end_flush();
|
|
||||||
header('X-Accel-Buffering: no');
|
header('X-Accel-Buffering: no');
|
||||||
|
|
||||||
if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved'])) {
|
if(isset($config['installed']) && $config['installed'] && !isset($_SESSION['saved'])) {
|
||||||
|
@@ -13,9 +13,16 @@ server {
|
|||||||
return 404;
|
return 404;
|
||||||
}
|
}
|
||||||
|
|
||||||
# block .htaccess
|
location /vendor {
|
||||||
location ~ /\.ht {
|
|
||||||
deny all;
|
deny all;
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# block .htaccess, CHANGELOG.md, composer.json etc.
|
||||||
|
# this is to prevent finding software versions
|
||||||
|
location ~\.(ht|md|json|dist)$ {
|
||||||
|
deny all;
|
||||||
|
return 404;
|
||||||
}
|
}
|
||||||
|
|
||||||
# block git files and folders
|
# block git files and folders
|
||||||
|
@@ -1265,7 +1265,7 @@ function getCustomPage($page, &$success)
|
|||||||
}
|
}
|
||||||
|
|
||||||
function escapeHtml($html) {
|
function escapeHtml($html) {
|
||||||
return htmlentities($html, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
return htmlspecialchars($html);
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayErrorBoxWithBackButton($errors, $action = null) {
|
function displayErrorBoxWithBackButton($errors, $action = null) {
|
||||||
|
@@ -50,6 +50,7 @@ define('HOOK_ACCOUNT_CREATE_BEFORE_SUBMIT_BUTTON', ++$i);
|
|||||||
define('HOOK_ACCOUNT_CREATE_AFTER_FORM', ++$i);
|
define('HOOK_ACCOUNT_CREATE_AFTER_FORM', ++$i);
|
||||||
define('HOOK_ACCOUNT_CREATE_AFTER_SUBMIT', ++$i);
|
define('HOOK_ACCOUNT_CREATE_AFTER_SUBMIT', ++$i);
|
||||||
define('HOOK_EMAIL_CONFIRMED', ++$i);
|
define('HOOK_EMAIL_CONFIRMED', ++$i);
|
||||||
|
define('HOOK_GUILDS_AFTER_INVITED_CHARACTERS', ++$i);
|
||||||
define('HOOK_FIRST', HOOK_STARTUP);
|
define('HOOK_FIRST', HOOK_STARTUP);
|
||||||
define('HOOK_LAST', HOOK_EMAIL_CONFIRMED);
|
define('HOOK_LAST', HOOK_EMAIL_CONFIRMED);
|
||||||
|
|
||||||
|
36
system/libs/TwigTypeCastingExtension.php
Normal file
36
system/libs/TwigTypeCastingExtension.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace MyAAC\Twig\Extension;
|
||||||
|
|
||||||
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFilter;
|
||||||
|
|
||||||
|
final class TwigTypeCastingExtension extends AbstractExtension
|
||||||
|
{
|
||||||
|
/** @return array<int, TwigFilter> */
|
||||||
|
public function getFilters(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
new TwigFilter('int', function ($value) {
|
||||||
|
return (int)$value;
|
||||||
|
}),
|
||||||
|
new TwigFilter('float', function ($value) {
|
||||||
|
return (float)$value;
|
||||||
|
}),
|
||||||
|
new TwigFilter('string', function ($value) {
|
||||||
|
return (string)$value;
|
||||||
|
}),
|
||||||
|
new TwigFilter('bool', function ($value) {
|
||||||
|
return (bool)$value;
|
||||||
|
}),
|
||||||
|
new TwigFilter('array', function (object $value) {
|
||||||
|
return (array)$value;
|
||||||
|
}),
|
||||||
|
new TwigFilter('object', function (array $value) {
|
||||||
|
return (object)$value;
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@@ -42,12 +42,6 @@ if(ACTION === 'logout' && !isset($_REQUEST['account_login'])) {
|
|||||||
|
|
||||||
$logged = false;
|
$logged = false;
|
||||||
unset($account_logged);
|
unset($account_logged);
|
||||||
|
|
||||||
if(isset($_REQUEST['redirect']))
|
|
||||||
{
|
|
||||||
header('Location: ' . urldecode($_REQUEST['redirect']));
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,18 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(!$db->hasColumn(TABLE_PREFIX . 'monsters', 'elements')) {
|
// removed, but kept for compatibility
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `elements` TEXT NOT NULL AFTER `immunities`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `pushable` TINYINT(1) NOT NULL DEFAULT '0' AFTER `convinceable`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `canpushitems` TINYINT(1) NOT NULL DEFAULT '0' AFTER `pushable`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `canpushcreatures` TINYINT(1) NOT NULL DEFAULT '0' AFTER `canpushitems`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `canwalkonenergy` TINYINT(1) NOT NULL DEFAULT '0' AFTER `canpushitems`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `canwalkonpoison` TINYINT(1) NOT NULL DEFAULT '0' AFTER `canwalkonenergy`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `canwalkonfire` TINYINT(1) NOT NULL DEFAULT '0' AFTER `canwalkonpoison`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `runonhealth` TINYINT(1) NOT NULL DEFAULT '0' AFTER `canwalkonfire`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `hostile` TINYINT(1) NOT NULL DEFAULT '0' AFTER `runonhealth`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `attackable` TINYINT(1) NOT NULL DEFAULT '0' AFTER `hostile`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `rewardboss` TINYINT(1) NOT NULL DEFAULT '0' AFTER `attackable`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `defense` INT(11) NOT NULL DEFAULT '0' AFTER `rewardboss`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `armor` INT(11) NOT NULL DEFAULT '0' AFTER `defense`;");
|
|
||||||
$db->exec("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `summons` TEXT NOT NULL AFTER `loot`;");
|
|
||||||
}
|
|
||||||
|
@@ -11,19 +11,28 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
|
|
||||||
$show_form = true;
|
$show_form = true;
|
||||||
$new_rlname = isset($_POST['info_rlname']) ? htmlspecialchars(stripslashes($_POST['info_rlname'])) : NULL;
|
$new_rlname = isset($_POST['info_rlname']) ? htmlspecialchars(stripslashes($_POST['info_rlname'])) : '';
|
||||||
$new_location = isset($_POST['info_location']) ? htmlspecialchars(stripslashes($_POST['info_location'])) : NULL;
|
$new_location = isset($_POST['info_location']) ? htmlspecialchars(stripslashes($_POST['info_location'])) : '';
|
||||||
$new_country = isset($_POST['info_country']) ? htmlspecialchars(stripslashes($_POST['info_country'])) : NULL;
|
$new_country = isset($_POST['info_country']) ? htmlspecialchars(stripslashes($_POST['info_country'])) : '';
|
||||||
if(isset($_POST['changeinfosave']) && $_POST['changeinfosave'] == 1) {
|
if(isset($_POST['changeinfosave']) && $_POST['changeinfosave'] == 1) {
|
||||||
if(!isset($config['countries'][$new_country]))
|
if(config('account_country') && !isset($config['countries'][$new_country])) {
|
||||||
$errors[] = 'Country is not correct.';
|
$errors[] = 'Country is not correct.';
|
||||||
|
}
|
||||||
|
|
||||||
if(empty($errors)) {
|
if(empty($errors)) {
|
||||||
//save data from form
|
//save data from form
|
||||||
$account_logged->setCustomField("rlname", $new_rlname);
|
$account_logged->setCustomField("rlname", $new_rlname);
|
||||||
$account_logged->setCustomField("location", $new_location);
|
$account_logged->setCustomField("location", $new_location);
|
||||||
$account_logged->setCustomField("country", $new_country);
|
$account_logged->setCustomField("country", $new_country);
|
||||||
$account_logged->logAction('Changed Real Name to <b>' . $new_rlname . '</b>, Location to <b>' . $new_location . '</b> and Country to <b>' . $config['countries'][$new_country] . '</b>.');
|
|
||||||
|
$log = 'Changed Real Name to <b>' . $new_rlname . '</b>, Location to <b>' . $new_location . '</b>';
|
||||||
|
if (config('account_country')) {
|
||||||
|
$log .= ' and Country to <b>' . $config['countries'][$new_country] . '</b>';
|
||||||
|
}
|
||||||
|
$log .= '.';
|
||||||
|
|
||||||
|
$account_logged->logAction($log);
|
||||||
|
|
||||||
$twig->display('success.html.twig', array(
|
$twig->display('success.html.twig', array(
|
||||||
'title' => 'Public Information Changed',
|
'title' => 'Public Information Changed',
|
||||||
'description' => 'Your public information has been changed.'
|
'description' => 'Your public information has been changed.'
|
||||||
@@ -59,4 +68,4 @@ if($show_form) {
|
|||||||
'account_country' => isset($account_country) ? $account_country : ''
|
'account_country' => isset($account_country) ? $account_country : ''
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@@ -52,9 +52,16 @@ $errors = array();
|
|||||||
{
|
{
|
||||||
$redirect = urldecode($_REQUEST['redirect']);
|
$redirect = urldecode($_REQUEST['redirect']);
|
||||||
|
|
||||||
|
// should never happen, unless hacker modify the URL
|
||||||
|
if (strpos($_REQUEST['redirect'], BASE_URL) === false) {
|
||||||
|
error('Fatal error: Cannot redirect outside the website.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$twig->display('account.redirect.html.twig', array(
|
$twig->display('account.redirect.html.twig', array(
|
||||||
'redirect' => $redirect
|
'redirect' => $redirect
|
||||||
));
|
));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ $showed = $post = $reply = false;
|
|||||||
$value = '<span style="color: blue">[NEW ANSWER]</span>';
|
$value = '<span style="color: blue">[NEW ANSWER]</span>';
|
||||||
|
|
||||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Bug Tracker</B></TD></TR>';
|
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Bug Tracker</B></TD></TR>';
|
||||||
echo '<TR BGCOLOR="'.$dark.'"><td width=40%><i><b>Subject</b></i></td><td>'.$tags[$bug[2]['tag']].' '.$bug[2]['subject'].' '.$value.'</td></tr>';
|
echo '<TR BGCOLOR="'.$dark.'"><td width=40%><i><b>Subject</b></i></td><td>'.$tags[$bug[2]['tag']].' '.escapeHtml($bug[2]['subject']).' '.$value.'</td></tr>';
|
||||||
echo '<TR BGCOLOR="'.$light.'"><td><i><b>Posted by</b></i></td><td>';
|
echo '<TR BGCOLOR="'.$light.'"><td><i><b>Posted by</b></i></td><td>';
|
||||||
|
|
||||||
foreach($players as $player)
|
foreach($players as $player)
|
||||||
@@ -64,7 +64,7 @@ $showed = $post = $reply = false;
|
|||||||
|
|
||||||
echo '</td></tr>';
|
echo '</td></tr>';
|
||||||
echo '<TR BGCOLOR="'.$dark.'"><td colspan=2><i><b>Description</b></i></td></tr>';
|
echo '<TR BGCOLOR="'.$dark.'"><td colspan=2><i><b>Description</b></i></td></tr>';
|
||||||
echo '<TR BGCOLOR="'.$light.'"><td colspan=2>'.nl2br($bug[2]['text']).'</td></tr>';
|
echo '<TR BGCOLOR="'.$light.'"><td colspan=2>'.nl2br(escapeHtml($bug[2]['text'])).'</td></tr>';
|
||||||
echo '</TABLE>';
|
echo '</TABLE>';
|
||||||
|
|
||||||
$answers = $db->query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'bugtracker').' where `account` = '.$_REQUEST['acc'].' and `id` = '.$_REQUEST['id'].' and `type` = 2 order by `reply`');
|
$answers = $db->query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'bugtracker').' where `account` = '.$_REQUEST['acc'].' and `id` = '.$_REQUEST['id'].' and `type` = 2 order by `reply`');
|
||||||
@@ -75,10 +75,10 @@ $showed = $post = $reply = false;
|
|||||||
else
|
else
|
||||||
$who = '<span style="color: green">[PLAYER]</span>';
|
$who = '<span style="color: green">[PLAYER]</span>';
|
||||||
|
|
||||||
echo '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Answer #'.$answer['reply'].'</B></TD></TR>';
|
echo '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Answer #'.escapeHtml($answer['reply']).'</B></TD></TR>';
|
||||||
echo '<TR BGCOLOR="'.$dark.'"><td width=70%><i><b>Posted by</b></i></td><td>'.$who.'</td></tr>';
|
echo '<TR BGCOLOR="'.$dark.'"><td width=70%><i><b>Posted by</b></i></td><td>'.$who.'</td></tr>';
|
||||||
echo '<TR BGCOLOR="'.$light.'"><td colspan=2><i><b>Description</b></i></td></tr>';
|
echo '<TR BGCOLOR="'.$light.'"><td colspan=2><i><b>Description</b></i></td></tr>';
|
||||||
echo '<TR BGCOLOR="'.$dark.'"><td colspan=2>'.nl2br($answer['text']).'</td></tr>';
|
echo '<TR BGCOLOR="'.$dark.'"><td colspan=2>'.nl2br(escapeHtml($answer['text'])).'</td></tr>';
|
||||||
echo '</TABLE>';
|
echo '</TABLE>';
|
||||||
}
|
}
|
||||||
if($bug[2]['status'] != 3)
|
if($bug[2]['status'] != 3)
|
||||||
@@ -137,7 +137,7 @@ $showed = $post = $reply = false;
|
|||||||
elseif($report['status'] == 1)
|
elseif($report['status'] == 1)
|
||||||
$value = '<span style="color: blue">[NEW ANSWER]</span>';
|
$value = '<span style="color: blue">[NEW ANSWER]</span>';
|
||||||
|
|
||||||
echo '<TR BGCOLOR="' . getStyle($i) . '"><td width=75%><a href="?subtopic=bugtracker&control=true&id='.$report['id'].'&acc='.$report['account'].'">'.$tags[$report['tag']].' '.$report['subject'].'</a></td><td>'.$value.'</td></tr>';
|
echo '<TR BGCOLOR="' . getStyle($i) . '"><td width=75%><a href="?subtopic=bugtracker&control=true&id='.$report['id'].'&acc='.$report['account'].'">'.$tags[$report['tag']].' '.escapeHtml($report['subject']).'</a></td><td>'.$value.'</td></tr>';
|
||||||
|
|
||||||
$showed=true;
|
$showed=true;
|
||||||
$i++;
|
$i++;
|
||||||
@@ -194,10 +194,10 @@ $showed = $post = $reply = false;
|
|||||||
else
|
else
|
||||||
$who = '<span style="color: green">[YOU]</span>';
|
$who = '<span style="color: green">[YOU]</span>';
|
||||||
|
|
||||||
echo '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Answer #'.$answer['reply'].'</B></TD></TR>';
|
echo '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Answer #'.escapeHtml($answer['reply']).'</B></TD></TR>';
|
||||||
echo '<TR BGCOLOR="'.$dark.'"><td width=70%><i><b>Posted by</b></i></td><td>'.$who.'</td></tr>';
|
echo '<TR BGCOLOR="'.$dark.'"><td width=70%><i><b>Posted by</b></i></td><td>'.$who.'</td></tr>';
|
||||||
echo '<TR BGCOLOR="'.$light.'"><td colspan=2><i><b>Description</b></i></td></tr>';
|
echo '<TR BGCOLOR="'.$light.'"><td colspan=2><i><b>Description</b></i></td></tr>';
|
||||||
echo '<TR BGCOLOR="'.$dark.'"><td colspan=2>'.nl2br($answer['text']).'</td></tr>';
|
echo '<TR BGCOLOR="'.$dark.'"><td colspan=2>'.nl2br(escapeHtml($answer['text'])).'</td></tr>';
|
||||||
echo '</TABLE>';
|
echo '</TABLE>';
|
||||||
}
|
}
|
||||||
if($bug[2]['status'] != 3)
|
if($bug[2]['status'] != 3)
|
||||||
|
@@ -400,7 +400,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
|
|||||||
'rank' => isset($guild_name) ? $rank_of_player->getName() : null,
|
'rank' => isset($guild_name) ? $rank_of_player->getName() : null,
|
||||||
'link' => isset($guild_name) ? getGuildLink($guild_name) : null
|
'link' => isset($guild_name) ? getGuildLink($guild_name) : null
|
||||||
),
|
),
|
||||||
'comment' => !empty($comment) ? wordwrap(nl2br($comment), 60, "<br/>", true) : null,
|
'comment' => !empty($comment) ? nl2br($comment) : null,
|
||||||
'skills' => isset($skills) ? $skills : null,
|
'skills' => isset($skills) ? $skills : null,
|
||||||
'quests_enabled' => $quests_enabled,
|
'quests_enabled' => $quests_enabled,
|
||||||
'quests' => isset($quests) ? $quests : null,
|
'quests' => isset($quests) ? $quests : null,
|
||||||
|
@@ -157,7 +157,7 @@ if (empty($_REQUEST['creature'])) {
|
|||||||
echo '</td></tr>';
|
echo '</td></tr>';
|
||||||
echo '</TABLE>';
|
echo '</TABLE>';
|
||||||
} else {
|
} else {
|
||||||
echo "Monster with name <b>" . $monster_name . "</b> doesn't exist.";
|
echo "Monster with name <b>" . htmlspecialchars($monster_name) . "</b> doesn't exist.";
|
||||||
}
|
}
|
||||||
|
|
||||||
//back button
|
//back button
|
||||||
|
@@ -25,7 +25,7 @@ if(count($guilds_list) > 0)
|
|||||||
$description = $guild->getCustomField('description');
|
$description = $guild->getCustomField('description');
|
||||||
$description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count);
|
$description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count);
|
||||||
if ($count < $config['guild_description_lines_limit'])
|
if ($count < $config['guild_description_lines_limit'])
|
||||||
$description = wordwrap(nl2br($description), 60, "<br />", true);
|
$description = nl2br($description);
|
||||||
|
|
||||||
$guildName = $guild->getName();
|
$guildName = $guild->getName();
|
||||||
$guilds[] = array('name' => $guildName, 'logo' => $guild_logo, 'link' => getGuildLink($guildName, false), 'description' => $description);
|
$guilds[] = array('name' => $guildName, 'logo' => $guild_logo, 'link' => getGuildLink($guildName, false), 'description' => $description);
|
||||||
@@ -36,4 +36,4 @@ $twig->display('guilds.list.html.twig', array(
|
|||||||
'guilds' => $guilds,
|
'guilds' => $guilds,
|
||||||
'logged' => isset($logged) ? $logged : false,
|
'logged' => isset($logged) ? $logged : false,
|
||||||
'isAdmin' => admin(),
|
'isAdmin' => admin(),
|
||||||
));
|
));
|
||||||
|
@@ -83,7 +83,7 @@ if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo))
|
|||||||
$description = $guild->getCustomField('description');
|
$description = $guild->getCustomField('description');
|
||||||
$description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count);
|
$description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count);
|
||||||
if($count < $config['guild_description_lines_limit'])
|
if($count < $config['guild_description_lines_limit'])
|
||||||
$description = wordwrap(nl2br($description), 60, "<br />", true);
|
$description = nl2br($description);
|
||||||
//$description = $description_with_lines;
|
//$description = $description_with_lines;
|
||||||
|
|
||||||
$guild_owner = $guild->getOwner();
|
$guild_owner = $guild->getOwner();
|
||||||
@@ -144,6 +144,7 @@ if($db->hasColumn('players', 'guildnick'))
|
|||||||
$useGuildNick = true;
|
$useGuildNick = true;
|
||||||
|
|
||||||
$twig->display('guilds.view.html.twig', array(
|
$twig->display('guilds.view.html.twig', array(
|
||||||
|
'guild' => $guild,
|
||||||
'logo' => $guild_logo,
|
'logo' => $guild_logo,
|
||||||
'guild_name' => $guild_name,
|
'guild_name' => $guild_name,
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
@@ -159,4 +160,4 @@ $twig->display('guilds.view.html.twig', array(
|
|||||||
'invited_list' => $invited_list,
|
'invited_list' => $invited_list,
|
||||||
'show_accept_invite' => $show_accept_invite,
|
'show_accept_invite' => $show_accept_invite,
|
||||||
'useGuildNick' => $useGuildNick
|
'useGuildNick' => $useGuildNick
|
||||||
));
|
));
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% set rows = 0 %}
|
{% set rows = 0 %}
|
||||||
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
|
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
|
||||||
<td><img src="<{{ template_path }}/images/general/blank.gif" width="10" height="1" border="0"></td>
|
<td><img src="{{ template_path }}/images/general/blank.gif" width="10" height="1" border="0"></td>
|
||||||
<td>
|
<td>
|
||||||
{{ hook(constant('HOOK_CHARACTERS_BEFORE_INFORMATIONS')) }}
|
{{ hook(constant('HOOK_CHARACTERS_BEFORE_INFORMATIONS')) }}
|
||||||
{% if canEdit %}
|
{% if canEdit %}
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
{% set rows = rows + 1 %}
|
{% set rows = rows + 1 %}
|
||||||
<tr bgcolor="{{ getStyle(rows) }}">
|
<tr bgcolor="{{ getStyle(rows) }}">
|
||||||
<td valign="top">Comment:</td>
|
<td valign="top">Comment:</td>
|
||||||
<td>{{ comment|raw }}</td>
|
<td style="word-break: break-all">{{ comment|raw }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
<img src="images/guilds/{{ guild.logo }}" width="64" height="64">
|
<img src="images/guilds/{{ guild.logo }}" width="64" height="64">
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td style="word-break: break-all">
|
||||||
<span{% if guild.description is not empty %} valign="top"{% endif %}>
|
<span{% if guild.description is not empty %} valign="top"{% endif %}>
|
||||||
<b>{{ guild.name }}</b>{% if isAdmin %}<a href="?subtopic=guilds&action=delete_by_admin&guild={{ guild.name }}"> - Delete this guild (for ADMIN only!)</a>{% endif %}
|
<b>{{ guild.name }}</b>{% if isAdmin %}<a href="?subtopic=guilds&action=delete_by_admin&guild={{ guild.name }}"> - Delete this guild (for ADMIN only!)</a>{% endif %}
|
||||||
</span>
|
</span>
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
<table style="width:100%;">
|
<table style="width:100%;">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td style="word-break: break-all">
|
||||||
<div id="GuildInformationContainer">
|
<div id="GuildInformationContainer">
|
||||||
{% if description is not empty %}
|
{% if description is not empty %}
|
||||||
{{ description|raw }}
|
{{ description|raw }}
|
||||||
@@ -265,6 +265,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
{{ hook('HOOK_GUILDS_AFTER_INVITED_CHARACTERS', { 'guild': guild, 'isLeader': isLeader }) }}
|
||||||
|
|
||||||
<div class="TableContainer">
|
<div class="TableContainer">
|
||||||
<table class="Table3" cellpadding="0" cellspacing="0">
|
<table class="Table3" cellpadding="0" cellspacing="0">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@@ -24,6 +24,9 @@ if($dev_mode) {
|
|||||||
}
|
}
|
||||||
unset($dev_mode);
|
unset($dev_mode);
|
||||||
|
|
||||||
|
require LIBS . 'TwigTypeCastingExtension.php';
|
||||||
|
$twig->addExtension(new MyAAC\Twig\Extension\TwigTypeCastingExtension());
|
||||||
|
|
||||||
$function = new TwigFunction('getStyle', function ($i) {
|
$function = new TwigFunction('getStyle', function ($i) {
|
||||||
return getStyle($i);
|
return getStyle($i);
|
||||||
});
|
});
|
||||||
@@ -48,7 +51,14 @@ $function = new TwigFunction('hook', function ($context, $hook, array $params =
|
|||||||
global $hooks;
|
global $hooks;
|
||||||
|
|
||||||
if(is_string($hook)) {
|
if(is_string($hook)) {
|
||||||
$hook = constant($hook);
|
if (defined($hook)) {
|
||||||
|
$hook = constant($hook);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// plugin/template has a hook that this version of myaac does not support
|
||||||
|
// just silently return
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$params['context'] = $context;
|
$params['context'] = $context;
|
||||||
|
Reference in New Issue
Block a user