mirror of
https://github.com/slawkens/myaac.git
synced 2025-09-14 12:33:35 +02:00
Compare commits
71 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 | ||
![]() |
11b11dd3ee | ||
![]() |
483155cf4c | ||
![]() |
55dbade8d5 | ||
![]() |
d1bc63d07a | ||
![]() |
83a91ec540 | ||
![]() |
7b43c972dd | ||
![]() |
3fdf1d3f44 | ||
![]() |
764db0c203 | ||
![]() |
538076bc45 | ||
![]() |
4327b66f91 | ||
![]() |
3f27724569 | ||
![]() |
9c0c2bbece | ||
![]() |
946144016b | ||
![]() |
5c3b01aca4 | ||
![]() |
50983a2b85 | ||
![]() |
765886f0c7 | ||
![]() |
8ea78a5852 | ||
![]() |
063cbab93e | ||
![]() |
f1670f4012 | ||
![]() |
6fcf0f7117 | ||
![]() |
7a07763625 | ||
![]() |
8d2172a649 | ||
![]() |
b8f65207b6 | ||
![]() |
ea675afe86 | ||
![]() |
cc1cebf359 | ||
![]() |
1e874c7027 | ||
![]() |
a338fd967c | ||
![]() |
8796ff7e72 | ||
![]() |
a8172a518f | ||
![]() |
559c2c7bd2 | ||
![]() |
7a546e5a41 | ||
![]() |
5f7a9154b7 | ||
![]() |
0d52978d9f | ||
![]() |
df48363ea4 | ||
![]() |
34725e0257 | ||
![]() |
df321154f6 | ||
![]() |
f2a3ec1185 | ||
![]() |
ce4aed0f17 | ||
![]() |
d0c82f6fb0 |
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"
|
||||||
|
11
.gitignore
vendored
11
.gitignore
vendored
@@ -2,16 +2,21 @@ Thumbs.db
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
#
|
||||||
|
/.htaccess
|
||||||
|
|
||||||
# composer
|
# composer
|
||||||
composer.lock
|
composer.lock
|
||||||
vendor
|
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
|
||||||
@@ -32,6 +37,12 @@ images/guilds/*
|
|||||||
images/editor/*
|
images/editor/*
|
||||||
!images/editor/index.html
|
!images/editor/index.html
|
||||||
|
|
||||||
|
# gallery images
|
||||||
|
images/gallery/*
|
||||||
|
!images/gallery/index.html
|
||||||
|
!images/gallery/demon.jpg
|
||||||
|
!images/gallery/demon_thumb.gif
|
||||||
|
|
||||||
# cache
|
# cache
|
||||||
system/cache/*
|
system/cache/*
|
||||||
!system/cache/index.html
|
!system/cache/index.html
|
||||||
|
73
CHANGELOG.md
73
CHANGELOG.md
@@ -1,5 +1,78 @@
|
|||||||
# 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]
|
||||||
|
Security fixes.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* XSS vulnerability in bugtracker (https://github.com/slawkens/myaac/commit/83a91ec540072d319dd338abff45f8d5ebf48190)
|
||||||
|
* XSS vulnerability in forum (https://github.com/slawkens/myaac/commit/d1bc63d07ad88a143358cacd2c417891eea74dcc + https://github.com/slawkens/myaac/commit/55dbade8d5280c5baed45e5f7ebc3613b8e9b9e8)
|
||||||
|
* Session Fixation (https://github.com/slawkens/myaac/commit/483155cf4c1e3068aaee0d44541dfa61f6223379)
|
||||||
|
* displaying ban info on account page (https://github.com/slawkens/myaac/commit/764db0c203d1826ffce3a5a78f83a97e56bd0685)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
* Clear some additional cache keys - like database cache (https://github.com/slawkens/myaac/commit/4327b66f915d06dce504211692173606b9ef3b4e)
|
||||||
|
|
||||||
|
## [0.8.13 - 16.09.2023]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
* latest client versions to config (https://github.com/slawkens/myaac/commit/765886f0c782807400c429577cde5e45bd7c308f)
|
||||||
|
* patching from develop - twig context for hooks (https://github.com/slawkens/myaac/commit/f1670f4012cc7595433fe0b1937c1f9b15a60b07)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* fixed XSS vulnerability in some pages (https://github.com/slawkens/myaac/commit/5c3b01aca4f3cfe8abc86b8ce48194b2da87b808)
|
||||||
|
|
||||||
|
Nothing more or less!
|
||||||
|
|
||||||
|
## [0.8.12 - 07.08.2023]
|
||||||
|
I've moved the repository back to my personal account. (Just so you know!)
|
||||||
|
|
||||||
|
I will also try to add git commits pointed to each change, lets see if you like it or not - you can comment in discussion, that will be created just after releasing this version :)
|
||||||
|
|
||||||
|
### Added
|
||||||
|
* forum: better error messages (Suggested by @anyeor) (https://github.com/slawkens/myaac/commit/34725e0257684fe5fa43875cc3a8f587ba04642e)
|
||||||
|
* more support for GesiorAAC classes, so some of them will work with MyAAC (https://github.com/slawkens/myaac/commit/a8172a518ff8939c4402349b16c064fcaf855d31)
|
||||||
|
* word-break on forum thread & reply (Suggested by @anyeor) (https://github.com/slawkens/myaac/commit/ce4aed0f1719d2aadc749e5238e883e3c10e2686)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* not working pages/links from database, introduced in 0.8.10 (Thanks to OtLand user - https://otland.net/members/0lo.99657/ for report) (https://github.com/slawkens/myaac/commit/1e874c7027769bd09e772a1cdac75d7e37991256)
|
||||||
|
* it was possible to create topic in board that was closed, ommiting the error check (Thanks to @anyeor for report) (https://github.com/slawkens/myaac/commit/0d52978d9fb99869500d35e7676f454ca5eaba14)
|
||||||
|
* PHP 8.2 compatibility - removed deprecated functions utf8_encode & utf8_decode (https://github.com/slawkens/myaac/commit/a338fd967cdbcc89e86be4e6b66b2cad2ff23251)
|
||||||
|
* guild description not being correctly shown (Reported by @anyeor) (https://github.com/slawkens/myaac/commit/f2a3ec1185df64ad9084d4ff55790ae4a5b3e5fd, https://github.com/slawkens/myaac/commit/df321154f63d458a4bc7d83bac5e3447b67317a4)
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
* Some old code for verifying messages length (Reported by @anyeor) (https://github.com/slawkens/myaac/commit/df48363ea4ced4350fd90ffddf57d464ba5afa8b)
|
||||||
|
* some info about config failed to load, was never working (https://github.com/slawkens/myaac/commit/7a546e5a41036b0e9e926d337c6f2e3c41c591d2)
|
||||||
|
|
||||||
## [0.8.11 - 30.06.2023]
|
## [0.8.11 - 30.06.2023]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
38
README.md
38
README.md
@@ -1,24 +1,29 @@
|
|||||||
# [MyAAC](https://my-aac.org)
|
# [MyAAC](https://my-aac.org)
|
||||||
|
|
||||||
[](https://travis-ci.org/github/slawkens/myaac)
|
|
||||||
[](https://opensource.org/licenses/gpl-license)
|
|
||||||
[](https://github.com/slawkens/myaac/releases)
|
|
||||||
[](https://github.com/slawkens/myaac/blob/d8b3b4135827ee17e3c6d41f08a925e718c587ed/.travis.yml#L3)
|
|
||||||
[](https://discord.gg/2J39Wus)
|
|
||||||
[](https://github.com/slawkens/myaac/issues?q=is%3Aissue+is%3Aclosed)
|
|
||||||
|
|
||||||
MyAAC is a free and open-source Automatic Account Creator (AAC) written in PHP. It is a fork of the [Gesior](https://github.com/gesior/Gesior2012) project. It supports only MySQL databases.
|
MyAAC is a free and open-source Automatic Account Creator (AAC) written in PHP. It is a fork of the [Gesior](https://github.com/gesior/Gesior2012) project. It supports only MySQL databases.
|
||||||
|
|
||||||
Official website: https://my-aac.org
|
Official website: https://my-aac.org
|
||||||
|
|
||||||
|
[](https://github.com/slawkens/myaac/actions)
|
||||||
|
[](https://opensource.org/licenses/gpl-license)
|
||||||
|
[](https://github.com/slawkens/myaac/releases)
|
||||||
|
[](https://discord.gg/2J39Wus)
|
||||||
|
[](https://github.com/slawkens/myaac/issues?q=is%3Aissue+is%3Aclosed)
|
||||||
|
|
||||||
|
| Version | Status | Branch | Requirements |
|
||||||
|
|:--------|:-----------------------|:--------|:---------------|
|
||||||
|
| **1.x** | **Active development** | develop | **PHP >= 8.1** |
|
||||||
|
| 0.9.x | Not developed anymore | 0.9 | 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 |
|
||||||
|
|
||||||
### 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
|
||||||
|
|
||||||
@@ -42,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
|
||||||
@@ -73,6 +79,12 @@ Look: [Contributing](https://github.com/otsoft/myaac/wiki/Contributing) in our w
|
|||||||
|
|
||||||
If you have a great idea or want contribute to the project - visit our website at https://www.my-aac.org
|
If you have a great idea or want contribute to the project - visit our website at https://www.my-aac.org
|
||||||
|
|
||||||
|
## Project supported by JetBrains
|
||||||
|
|
||||||
|
Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.
|
||||||
|
|
||||||
|
[](https://www.jetbrains.com/?from=https://github.com/slawkens)
|
||||||
|
|
||||||
### License
|
### License
|
||||||
|
|
||||||
This program and all associated files are released under the GNU Public License.
|
This program and all associated files are released under the GNU Public License.
|
||||||
|
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.
|
@@ -426,7 +426,7 @@ else if ($id > 0 && isset($account) && $account->isLoaded()) {
|
|||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<form action="<?php echo $base; ?>" method="post">
|
<form action="<?php echo $base; ?>" method="post">
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<input type="text" class="form-control" name="search_name" value="<?php echo $search_account; ?>"
|
<input type="text" class="form-control" name="search_name" value="<?php echo escapeHtml($search_account); ?>"
|
||||||
maxlength="32" size="32">
|
maxlength="32" size="32">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button type="submit" type="button" class="btn btn-info btn-flat">Search</button>
|
<button type="submit" type="button" class="btn btn-info btn-flat">Search</button>
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
$title = 'Load items.xml';
|
$title = 'Load items.xml';
|
||||||
|
|
||||||
require LIBS . 'items.php';
|
require_once LIBS . 'items.php';
|
||||||
require LIBS . 'weapons.php';
|
require_once LIBS . 'weapons.php';
|
||||||
|
|
||||||
$twig->display('admin.items.html.twig');
|
$twig->display('admin.items.html.twig');
|
||||||
|
|
||||||
|
@@ -784,7 +784,7 @@ else if ($id > 0 && isset($player) && $player->isLoaded())
|
|||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<form action="<?php echo $base; ?>" method="post">
|
<form action="<?php echo $base; ?>" method="post">
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<input type="text" class="form-control" name="search_name" value="<?php echo $search_name; ?>"
|
<input type="text" class="form-control" name="search_name" value="<?php echo escapeHtml($search_name); ?>"
|
||||||
maxlength="32" size="32">
|
maxlength="32" size="32">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button type="submit" type="button" class="btn btn-info btn-flat">Search</button>
|
<button type="submit" type="button" class="btn btn-info btn-flat">Search</button>
|
||||||
|
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.11');
|
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(),
|
||||||
),
|
),
|
||||||
|
|
||||||
);
|
);
|
||||||
|
0
images/gallery/index.html
Normal file
0
images/gallery/index.html
Normal file
@@ -167,7 +167,7 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handle ?fbclid=x, etc. (show news page)
|
// handle ?fbclid=x, etc. (show news page)
|
||||||
if (!$found && count($_GET) > 0 && !isset($_REQUEST['subtopic']) && !isset($_REQUEST['p'])) {
|
if (!$found && count($_GET) > 0 && !isset($_REQUEST['subtopic']) && !isset($_REQUEST['p']) && !in_array($_SERVER['QUERY_STRING'], getDatabasePages())) {
|
||||||
$_REQUEST['p'] = $_REQUEST['subtopic'] = 'news';
|
$_REQUEST['p'] = $_REQUEST['subtopic'] = 'news';
|
||||||
$found = true;
|
$found = true;
|
||||||
}
|
}
|
||||||
|
@@ -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
|
||||||
@@ -25,7 +32,7 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php;
|
try_files $uri $uri/ /index.php?$query_string;;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
|
@@ -4,12 +4,12 @@ defined('MYAAC') or die('Direct access not allowed!');
|
|||||||
$reward = config('account_mail_confirmed_reward');
|
$reward = config('account_mail_confirmed_reward');
|
||||||
|
|
||||||
$hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
$hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
||||||
if ($reward['coins'] > 0 && $hasCoinsColumn) {
|
if ($reward['coins'] > 0 && !$hasCoinsColumn) {
|
||||||
log_append('email_confirm_error.log', 'accounts.coins column does not exist.');
|
log_append('email_confirm_error.log', 'accounts.coins column does not exist.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($account) || !$account->isLoaded()) {
|
if (!isset($account) || !$account->isLoaded()) {
|
||||||
log_append('email_confirm_error.log', 'Account not loaded.');
|
//log_append('email_confirm_error.log', 'Account not loaded.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -99,4 +99,10 @@ $config['clients'] = [
|
|||||||
1291,
|
1291,
|
||||||
|
|
||||||
1300,
|
1300,
|
||||||
|
1310,
|
||||||
|
1311,
|
||||||
|
1312,
|
||||||
|
1316,
|
||||||
|
1320,
|
||||||
|
1321,
|
||||||
];
|
];
|
||||||
|
@@ -9,7 +9,30 @@
|
|||||||
*/
|
*/
|
||||||
defined('MYAAC') or die('Direct access not allowed!');
|
defined('MYAAC') or die('Direct access not allowed!');
|
||||||
|
|
||||||
class Player extends OTS_Player {}
|
class Account extends OTS_Account {
|
||||||
class Guild extends OTS_Guild {}
|
public function loadById($id) {
|
||||||
|
$this->load($id);
|
||||||
|
}
|
||||||
|
public function loadByName($name) {
|
||||||
|
$this->find($name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Player extends OTS_Player {
|
||||||
|
public function loadById($id) {
|
||||||
|
$this->load($id);
|
||||||
|
}
|
||||||
|
public function loadByName($name) {
|
||||||
|
$this->find($name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class Guild extends OTS_Guild {
|
||||||
|
public function loadById($id) {
|
||||||
|
$this->load($id);
|
||||||
|
}
|
||||||
|
public function loadByName($name) {
|
||||||
|
$this->find($name);
|
||||||
|
}
|
||||||
|
}
|
||||||
class GuildRank extends OTS_GuildRank {}
|
class GuildRank extends OTS_GuildRank {}
|
||||||
class House extends OTS_House {}
|
class House extends OTS_House {}
|
||||||
|
@@ -923,8 +923,8 @@ function load_config_lua($filename)
|
|||||||
$config_file = $filename;
|
$config_file = $filename;
|
||||||
if(!@file_exists($config_file))
|
if(!@file_exists($config_file))
|
||||||
{
|
{
|
||||||
log_append('error.log', '[load_config_file] Fatal error: Cannot load config.lua (' . $filename . '). Error: ' . print_r(error_get_last(), true));
|
log_append('error.log', '[load_config_file] Fatal error: Cannot load config.lua (' . $filename . ').');
|
||||||
throw new RuntimeException('ERROR: Cannot find ' . $filename . ' file. More info in system/logs/error.log');
|
throw new RuntimeException('ERROR: Cannot find ' . $filename . ' file.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
@@ -1146,9 +1146,30 @@ function clearCache()
|
|||||||
if ($cache->fetch('failed_logins', $tmp))
|
if ($cache->fetch('failed_logins', $tmp))
|
||||||
$cache->delete('failed_logins');
|
$cache->delete('failed_logins');
|
||||||
|
|
||||||
global $template_name;
|
foreach (get_templates() as $template) {
|
||||||
if ($cache->fetch('template_ini' . $template_name, $tmp))
|
if ($cache->fetch('template_ini_' . $template, $tmp)) {
|
||||||
$cache->delete('template_ini' . $template_name);
|
$cache->delete('template_ini_' . $template);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($cache->fetch('template_menus', $tmp)) {
|
||||||
|
$cache->delete('template_menus');
|
||||||
|
}
|
||||||
|
if ($cache->fetch('database_tables', $tmp)) {
|
||||||
|
$cache->delete('database_tables');
|
||||||
|
}
|
||||||
|
if ($cache->fetch('database_columns', $tmp)) {
|
||||||
|
$cache->delete('database_columns');
|
||||||
|
}
|
||||||
|
if ($cache->fetch('database_checksum', $tmp)) {
|
||||||
|
$cache->delete('database_checksum');
|
||||||
|
}
|
||||||
|
if ($cache->fetch('hooks', $tmp)) {
|
||||||
|
$cache->delete('hooks');
|
||||||
|
}
|
||||||
|
if ($cache->fetch('last_kills', $tmp)) {
|
||||||
|
$cache->delete('last_kills');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteDirectory(CACHE . 'signatures', ['index.html'], true);
|
deleteDirectory(CACHE . 'signatures', ['index.html'], true);
|
||||||
@@ -1244,7 +1265,37 @@ 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) {
|
||||||
|
global $twig;
|
||||||
|
$twig->display('error_box.html.twig', ['errors' => $errors]);
|
||||||
|
$twig->display('account.back_button.html.twig', [
|
||||||
|
'action' => $action ?: getLink('')
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDatabasePages($withHidden = false): array
|
||||||
|
{
|
||||||
|
global $db, $logged_access;
|
||||||
|
|
||||||
|
if (!isset($logged_access)) {
|
||||||
|
$logged_access = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pages = $db->query('SELECT `name` FROM ' . TABLE_PREFIX . 'pages WHERE ' . ($withHidden ? '' : '`hidden` != 1 AND ') . '`access` <= ' . $db->quote($logged_access));
|
||||||
|
$ret = [];
|
||||||
|
|
||||||
|
if ($pages->rowCount() < 1) {
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($pages->fetchAll() as $page) {
|
||||||
|
$ret[] = $page['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// validator functions
|
// validator functions
|
||||||
|
@@ -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;
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@@ -74,6 +74,10 @@ class Plugins {
|
|||||||
if (isset($plugin['hooks'])) {
|
if (isset($plugin['hooks'])) {
|
||||||
foreach ($plugin['hooks'] as $_name => $info) {
|
foreach ($plugin['hooks'] as $_name => $info) {
|
||||||
if (defined('HOOK_'. $info['type'])) {
|
if (defined('HOOK_'. $info['type'])) {
|
||||||
|
if (strpos($info['type'], 'HOOK_') !== false) {
|
||||||
|
$info['type'] = str_replace('HOOK_', '', $info['type']);
|
||||||
|
}
|
||||||
|
|
||||||
$hook = constant('HOOK_'. $info['type']);
|
$hook = constant('HOOK_'. $info['type']);
|
||||||
$hooks[] = ['name' => $_name, 'type' => $hook, 'file' => $info['file']];
|
$hooks[] = ['name' => $_name, 'type' => $hook, 'file' => $info['file']];
|
||||||
} else {
|
} else {
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Various server status querying methods.
|
* Various server status querying methods.
|
||||||
*
|
*
|
||||||
* @package POT
|
* @package POT
|
||||||
* @property-read OTS_InfoRespond|bool $status status() method wrapper.
|
* @property-read OTS_InfoRespond|bool $status status() method wrapper.
|
||||||
* @property-read OTS_ServerStatus|bool $info Full info() method wrapper.
|
* @property-read OTS_ServerStatus|bool $info Full info() method wrapper.
|
||||||
@@ -23,21 +23,21 @@ class OTS_ServerInfo
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Server address.
|
* Server address.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $server;
|
private $server;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connection port.
|
* Connection port.
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
private $port;
|
private $port;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates handler for new server.
|
* Creates handler for new server.
|
||||||
*
|
*
|
||||||
* @param string $server Server IP/domain.
|
* @param string $server Server IP/domain.
|
||||||
* @param int $port OTServ port.
|
* @param int $port OTServ port.
|
||||||
*/
|
*/
|
||||||
@@ -49,7 +49,7 @@ class OTS_ServerInfo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends packet to server.
|
* Sends packet to server.
|
||||||
*
|
*
|
||||||
* @param OTS_Buffer|string $packet Buffer to send.
|
* @param OTS_Buffer|string $packet Buffer to send.
|
||||||
* @return OTS_Buffer|null Respond buffer (null if server is offline).
|
* @return OTS_Buffer|null Respond buffer (null if server is offline).
|
||||||
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
||||||
@@ -75,7 +75,7 @@ class OTS_ServerInfo
|
|||||||
|
|
||||||
// reads respond
|
// reads respond
|
||||||
//$data = stream_get_contents($socket);
|
//$data = stream_get_contents($socket);
|
||||||
$data = '';
|
$data = '';
|
||||||
while (!feof($socket))
|
while (!feof($socket))
|
||||||
$data .= fgets($socket, 1024);
|
$data .= fgets($socket, 1024);
|
||||||
|
|
||||||
@@ -97,11 +97,11 @@ class OTS_ServerInfo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Queries server status.
|
* Queries server status.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* Sends 'info' packet to OTS server and return output. Returns {@link OTS_InfoRespond OTS_InfoRespond} (wrapper for XML data) with results or <var>false</var> if server is online.
|
* Sends 'info' packet to OTS server and return output. Returns {@link OTS_InfoRespond OTS_InfoRespond} (wrapper for XML data) with results or <var>false</var> if server is online.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return OTS_InfoRespond|bool Respond content document (false when server is offline).
|
* @return OTS_InfoRespond|bool Respond content document (false when server is offline).
|
||||||
* @throws DOMException On DOM operation error.
|
* @throws DOMException On DOM operation error.
|
||||||
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
||||||
@@ -123,7 +123,7 @@ class OTS_ServerInfo
|
|||||||
{
|
{
|
||||||
// loads respond XML
|
// loads respond XML
|
||||||
$info = new OTS_InfoRespond();
|
$info = new OTS_InfoRespond();
|
||||||
if(!$info->loadXML( utf8_encode($status->getBuffer())))
|
if(!$info->loadXML( $status->getBuffer()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return $info;
|
return $info;
|
||||||
@@ -135,11 +135,11 @@ class OTS_ServerInfo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Queries server information.
|
* Queries server information.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* This method uses binary info protocol. It provides more infromation then {@link OTS_Toolbox::serverStatus() XML way}.
|
* This method uses binary info protocol. It provides more infromation then {@link OTS_Toolbox::serverStatus() XML way}.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param int $flags Requested info flags.
|
* @param int $flags Requested info flags.
|
||||||
* @return OTS_ServerStatus|bool Respond content document (false when server is offline).
|
* @return OTS_ServerStatus|bool Respond content document (false when server is offline).
|
||||||
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
||||||
@@ -169,11 +169,11 @@ class OTS_ServerInfo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks player online status.
|
* Checks player online status.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* This method uses binary info protocol.
|
* This method uses binary info protocol.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param string $name Player name.
|
* @param string $name Player name.
|
||||||
* @return bool True if player is online, false if player or server is online.
|
* @return bool True if player is online, false if player or server is online.
|
||||||
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
||||||
@@ -204,7 +204,7 @@ class OTS_ServerInfo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Magic PHP5 method.
|
* Magic PHP5 method.
|
||||||
*
|
*
|
||||||
* @param string $name Property name.
|
* @param string $name Property name.
|
||||||
* @param mixed $value Property value.
|
* @param mixed $value Property value.
|
||||||
* @throws OutOfBoundsException For non-supported properties.
|
* @throws OutOfBoundsException For non-supported properties.
|
||||||
|
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,6 +88,7 @@ else
|
|||||||
&& (!isset($t) || $t['attempts'] < 5)
|
&& (!isset($t) || $t['attempts'] < 5)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
session_regenerate_id();
|
||||||
setSession('account', $account_logged->getId());
|
setSession('account', $account_logged->getId());
|
||||||
setSession('password', encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $login_password));
|
setSession('password', encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $login_password));
|
||||||
if($remember_me) {
|
if($remember_me) {
|
||||||
|
@@ -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++;
|
||||||
@@ -181,9 +181,9 @@ $showed = $post = $reply = false;
|
|||||||
$value = '<span style="color: red">[CLOSED]</span>';
|
$value = '<span style="color: red">[CLOSED]</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 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($bug[2]['text']).'</td></tr>';
|
echo '<TR BGCOLOR="'.$dark.'"><td colspan=2>'.nl2br(escapeHtml($bug[2]['text'])).'</td></tr>';
|
||||||
echo '</TABLE>';
|
echo '</TABLE>';
|
||||||
|
|
||||||
$answers = $db->query('SELECT * FROM '.$db->tableName('myaac_bugtracker').' where `account` = '.$account_logged->getId().' and `id` = '.$id.' and `type` = 2 order by `reply`');
|
$answers = $db->query('SELECT * FROM '.$db->tableName('myaac_bugtracker').' where `account` = '.$account_logged->getId().' and `id` = '.$id.' and `type` = 2 order by `reply`');
|
||||||
@@ -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)
|
||||||
@@ -274,7 +274,7 @@ $showed = $post = $reply = false;
|
|||||||
$bgcolor = $light;
|
$bgcolor = $light;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<TR BGCOLOR="'.$bgcolor.'"><td width=75%><a href="?subtopic=bugtracker&id='.$report['id'].'">'.$tags[$report['tag']].' '.$report['subject'].'</a></td><td>'.$value.'</td></tr>';
|
echo '<TR BGCOLOR="'.$bgcolor.'"><td width=75%><a href="?subtopic=bugtracker&id='.$report['id'].'">'.$tags[$report['tag']].' '.escapeHtml($report['subject']).'</a></td><td>'.$value.'</td></tr>';
|
||||||
|
|
||||||
$showed=true;
|
$showed=true;
|
||||||
}
|
}
|
||||||
|
@@ -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
|
||||||
|
@@ -191,12 +191,13 @@ if(!$logged)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!ctype_alnum(str_replace(array('-', '_'), '', $action))) {
|
if(!ctype_alnum(str_replace(array('-', '_'), '', $action))) {
|
||||||
error('Error: Action contains illegal characters.');
|
$errors[] = 'Error: Action contains illegal characters.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
}
|
}
|
||||||
else if(file_exists(PAGES . 'forum/' . $action . '.php')) {
|
else if(file_exists(PAGES . 'forum/' . $action . '.php')) {
|
||||||
require PAGES . 'forum/' . $action . '.php';
|
require PAGES . 'forum/' . $action . '.php';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
error('This page does not exists.');
|
$errors[] = 'This page does not exists.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
@@ -14,7 +14,8 @@ if(Forum::canPost($account_logged))
|
|||||||
{
|
{
|
||||||
$post_id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : false;
|
$post_id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : false;
|
||||||
if(!$post_id) {
|
if(!$post_id) {
|
||||||
echo 'Please enter post id.';
|
$errors[] = 'Please enter post id.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,24 +36,22 @@ if(Forum::canPost($account_logged))
|
|||||||
$post_topic = stripslashes(trim($_REQUEST['topic']));
|
$post_topic = stripslashes(trim($_REQUEST['topic']));
|
||||||
$smile = isset($_REQUEST['smile']) ? (int)$_REQUEST['smile'] : 0;
|
$smile = isset($_REQUEST['smile']) ? (int)$_REQUEST['smile'] : 0;
|
||||||
$html = isset($_REQUEST['html']) ? (int)$_REQUEST['html'] : 0;
|
$html = isset($_REQUEST['html']) ? (int)$_REQUEST['html'] : 0;
|
||||||
$lenght = 0;
|
|
||||||
for($i = 0; $i < strlen($post_topic); $i++)
|
if (!superAdmin()) {
|
||||||
{
|
$html = 0;
|
||||||
if(ord($post_topic[$i]) >= 33 && ord($post_topic[$i]) <= 126)
|
|
||||||
$lenght++;
|
|
||||||
}
|
}
|
||||||
if(($lenght < 1 || strlen($post_topic) > 60) && $thread['id'] == $thread['first_post'])
|
|
||||||
$errors[] = 'Too short or too long topic (short: '.$lenght.' long: '.strlen($post_topic).' letters). Minimum 1 letter, maximum 60 letters.';
|
$length = strlen($post_topic);
|
||||||
$lenght = 0;
|
if(($length < 1 || $length > 60) && $thread['id'] == $thread['first_post'])
|
||||||
for($i = 0; $i < strlen($text); $i++)
|
$errors[] = "Too short or too long topic (Length: $length letters). Minimum 1 letter, maximum 60 letters.";
|
||||||
{
|
|
||||||
if(ord($text[$i]) >= 33 && ord($text[$i]) <= 126)
|
$length = strlen($text);
|
||||||
$lenght++;
|
if($length < 1 || $length > 15000)
|
||||||
}
|
$errors[] = "Too short or too long post (Length: $length letters). Minimum 1 letter, maximum 15000 letters.";
|
||||||
if($lenght < 1 || strlen($text) > 15000)
|
|
||||||
$errors[] = 'Too short or too long post (short: '.$lenght.' long: '.strlen($text).' letters). Minimum 1 letter, maximum 15000 letters.';
|
|
||||||
if($char_id == 0)
|
if($char_id == 0)
|
||||||
$errors[] = 'Please select a character.';
|
$errors[] = 'Please select a character.';
|
||||||
|
|
||||||
if(empty($post_topic) && $thread['id'] == $thread['first_post'])
|
if(empty($post_topic) && $thread['id'] == $thread['first_post'])
|
||||||
$errors[] = 'Thread topic can\'t be empty.';
|
$errors[] = 'Thread topic can\'t be empty.';
|
||||||
|
|
||||||
@@ -104,11 +103,17 @@ if(Forum::canPost($account_logged))
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
echo '<br/>You are not an author of this post.';
|
$errors[] = 'You are not an author of this post.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$errors[] = "Post with ID $post_id doesn't exist.";
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
echo "<br/>Post with ID " . $post_id . " doesn't exist.";
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
echo "<br/>Your account is banned, deleted or you don't have any player with level " . $config['forum_level_required'] . " on your account. You can't post.";
|
$errors[] = "Your account is banned, deleted or you don't have any player with level " . $config['forum_level_required'] . " on your account. You can't post.";
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
|
}
|
||||||
|
@@ -14,12 +14,13 @@ if(!Forum::isModerator()) {
|
|||||||
echo 'You are not logged in or you are not moderator.';
|
echo 'You are not logged in or you are not moderator.';
|
||||||
}
|
}
|
||||||
|
|
||||||
$save = isset($_REQUEST['save']) ? (int)$_REQUEST['save'] == 1 : false;
|
$save = isset($_REQUEST['save']) && (int)$_REQUEST['save'] == 1;
|
||||||
if($save) {
|
if($save) {
|
||||||
$post_id = (int)$_REQUEST['id'];
|
$post_id = (int)$_REQUEST['id'];
|
||||||
$board = (int)$_REQUEST['section'];
|
$board = (int)$_REQUEST['section'];
|
||||||
if(!Forum::hasAccess($board)) {
|
if(!Forum::hasAccess($board)) {
|
||||||
echo "You don't have access to this board.";
|
$errors[] = "You don't have access to this board.";
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,8 +32,10 @@ if($save) {
|
|||||||
header('Location: ' . getForumBoardLink($nPost['section']));
|
header('Location: ' . getForumBoardLink($nPost['section']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
echo 'Post with ID ' . $post_id . ' does not exist.';
|
$errors[] = 'Post with ID ' . $post_id . ' does not exist.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$post_id = (int)$_REQUEST['id'];
|
$post_id = (int)$_REQUEST['id'];
|
||||||
@@ -58,7 +61,8 @@ else {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
echo 'Post with ID ' . $post_id . ' does not exist.';
|
$errors[] = 'Post with ID ' . $post_id . ' does not exist.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
@@ -15,21 +15,29 @@ 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();
|
||||||
$thread_id = isset($_REQUEST['thread_id']) ? (int) $_REQUEST['thread_id'] : 0;
|
$thread_id = isset($_REQUEST['thread_id']) ? (int) $_REQUEST['thread_id'] : 0;
|
||||||
if($thread_id == 0) {
|
if($thread_id == 0) {
|
||||||
echo "Thread with this id doesn't exist.";
|
$errors[] = "Thread with this id doesn't exist.";
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$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` = ".(int) $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();
|
||||||
echo '<a href="' . getLink('forum') . '">Boards</a> >> <a href="' . getForumBoardLink($thread['section']) . '">'.$sections[$thread['section']]['name'].'</a> >> <a href="' . getForumThreadLink($thread_id) . '">'.$thread['post_topic'].'</a> >> <b>Post new reply</b><br /><h3>'.$thread['post_topic'].'</h3>';
|
|
||||||
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) . '">'.$thread['post_topic'].'</a> >> <b>Post new reply</b><br /><h3>'.$thread['post_topic'].'</h3>';
|
||||||
|
|
||||||
$quote = isset($_REQUEST['quote']) ? (int) $_REQUEST['quote'] : NULL;
|
$quote = isset($_REQUEST['quote']) ? (int) $_REQUEST['quote'] : NULL;
|
||||||
$text = isset($_REQUEST['text']) ? stripslashes(trim($_REQUEST['text'])) : NULL;
|
$text = isset($_REQUEST['text']) ? stripslashes(trim($_REQUEST['text'])) : NULL;
|
||||||
$char_id = (int) (isset($_REQUEST['char_id']) ? $_REQUEST['char_id'] : 0);
|
$char_id = (int) ($_REQUEST['char_id'] ?? 0);
|
||||||
$post_topic = isset($_REQUEST['topic']) ? stripslashes(trim($_REQUEST['topic'])) : '';
|
$post_topic = isset($_REQUEST['topic']) ? stripslashes(trim($_REQUEST['topic'])) : '';
|
||||||
$smile = (isset($_REQUEST['smile']) ? (int)$_REQUEST['smile'] : 0);
|
$smile = (isset($_REQUEST['smile']) ? (int)$_REQUEST['smile'] : 0);
|
||||||
$html = (isset($_REQUEST['html']) ? (int)$_REQUEST['html'] : 0);
|
$html = (isset($_REQUEST['html']) ? (int)$_REQUEST['html'] : 0);
|
||||||
$saved = false;
|
$saved = false;
|
||||||
|
|
||||||
|
if (!superAdmin()) {
|
||||||
|
$html = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($_REQUEST['quote']))
|
if(isset($_REQUEST['quote']))
|
||||||
{
|
{
|
||||||
$quoted_post = $db->query("SELECT `players`.`name`, `" . FORUM_TABLE_PREFIX . "forum`.`post_text`, `" . FORUM_TABLE_PREFIX . "forum`.`post_date` FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` AND `" . FORUM_TABLE_PREFIX . "forum`.`id` = ".(int) $quote)->fetchAll();
|
$quoted_post = $db->query("SELECT `players`.`name`, `" . FORUM_TABLE_PREFIX . "forum`.`post_text`, `" . FORUM_TABLE_PREFIX . "forum`.`post_date` FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` AND `" . FORUM_TABLE_PREFIX . "forum`.`id` = ".(int) $quote)->fetchAll();
|
||||||
@@ -38,14 +46,10 @@ if(Forum::canPost($account_logged))
|
|||||||
}
|
}
|
||||||
elseif(isset($_REQUEST['save']))
|
elseif(isset($_REQUEST['save']))
|
||||||
{
|
{
|
||||||
$lenght = 0;
|
$length = strlen($text);
|
||||||
for($i = 0; $i < strlen($text); $i++)
|
if($length < 1 || strlen($text) > 15000)
|
||||||
{
|
$errors[] = 'Too short or too long post (Length: $length letters). Minimum 1 letter, maximum 15000 letters.';
|
||||||
if(ord($text[$i]) >= 33 && ord($text[$i]) <= 126)
|
|
||||||
$lenght++;
|
|
||||||
}
|
|
||||||
if($lenght < 1 || strlen($text) > 15000)
|
|
||||||
$errors[] = 'Too short or too long post (short: '.$lenght.' long: '.strlen($text).' letters). Minimum 1 letter, maximum 15000 letters.';
|
|
||||||
if($char_id == 0)
|
if($char_id == 0)
|
||||||
$errors[] = 'Please select a character.';
|
$errors[] = 'Please select a character.';
|
||||||
|
|
||||||
@@ -73,8 +77,8 @@ if(Forum::canPost($account_logged))
|
|||||||
if(count($errors) == 0)
|
if(count($errors) == 0)
|
||||||
{
|
{
|
||||||
$saved = true;
|
$saved = true;
|
||||||
Forum::add_post($thread['id'], $thread['section'], $account_logged->getId(), (int) $char_id, $text, $post_topic, $smile, $html, time(), $_SERVER['REMOTE_ADDR']);
|
Forum::add_post($thread['id'], $thread['section'], $account_logged->getId(), (int) $char_id, $text, $post_topic, $smile, $html);
|
||||||
$db->query("UPDATE `" . FORUM_TABLE_PREFIX . "forum` SET `replies`=`replies`+1, `last_post`=".time()." WHERE `id` = ".(int) $thread_id);
|
$db->query("UPDATE `" . FORUM_TABLE_PREFIX . "forum` SET `replies`=`replies`+1, `last_post`=".time()." WHERE `id` = ".$thread_id);
|
||||||
$post_page = $db->query("SELECT COUNT(`" . FORUM_TABLE_PREFIX . "forum`.`id`) AS posts_count FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` AND `" . FORUM_TABLE_PREFIX . "forum`.`post_date` <= ".time()." AND `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread['id'])->fetch();
|
$post_page = $db->query("SELECT COUNT(`" . FORUM_TABLE_PREFIX . "forum`.`id`) AS posts_count FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` AND `" . FORUM_TABLE_PREFIX . "forum`.`post_date` <= ".time()." AND `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread['id'])->fetch();
|
||||||
$_page = (int) ceil($post_page['posts_count'] / $config['forum_threads_per_page']) - 1;
|
$_page = (int) ceil($post_page['posts_count'] / $config['forum_threads_per_page']) - 1;
|
||||||
header('Location: ' . getForumThreadLink($thread_id, $_page));
|
header('Location: ' . getForumThreadLink($thread_id, $_page));
|
||||||
@@ -110,10 +114,14 @@ if(Forum::canPost($account_logged))
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
echo "Thread with ID " . $thread_id . " doesn't exist.";
|
$errors[] = "Thread with ID " . $thread_id . " doesn't exist.";
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$errors[] = "Your account is banned, deleted or you don't have any player with level " . $config['forum_level_required'] . " on your account. You can't post.";
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
echo "Your account is banned, deleted or you don't have any player with level " . $config['forum_level_required'] . " on your account. You can't post.";
|
|
||||||
|
|
||||||
$twig->display('forum.fullscreen.html.twig');
|
$twig->display('forum.fullscreen.html.twig');
|
||||||
|
@@ -13,7 +13,7 @@ defined('MYAAC') or die('Direct access not allowed!');
|
|||||||
if(Forum::canPost($account_logged))
|
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 = isset($_REQUEST['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) . '">' . $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)) {
|
||||||
@@ -26,24 +26,20 @@ if(Forum::canPost($account_logged))
|
|||||||
$post_topic = isset($_REQUEST['topic']) ? stripslashes($_REQUEST['topic']) : '';
|
$post_topic = isset($_REQUEST['topic']) ? stripslashes($_REQUEST['topic']) : '';
|
||||||
$smile = (isset($_REQUEST['smile']) ? (int)$_REQUEST['smile'] : 0);
|
$smile = (isset($_REQUEST['smile']) ? (int)$_REQUEST['smile'] : 0);
|
||||||
$html = (isset($_REQUEST['html']) ? (int)$_REQUEST['html'] : 0);
|
$html = (isset($_REQUEST['html']) ? (int)$_REQUEST['html'] : 0);
|
||||||
|
|
||||||
|
if (!superAdmin()) {
|
||||||
|
$html = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$saved = false;
|
$saved = false;
|
||||||
if (isset($_REQUEST['save'])) {
|
if (isset($_REQUEST['save'])) {
|
||||||
$errors = array();
|
$length = strlen($post_topic);
|
||||||
|
if ($length < 1 || $length > 60)
|
||||||
|
$errors[] = "Too short or too long topic (Length: $length letters). Minimum 1 letter, maximum 60 letters.";
|
||||||
|
|
||||||
$lenght = 0;
|
$length = strlen($text);
|
||||||
for ($i = 0; $i < strlen($post_topic); $i++) {
|
if ($length < 1 || $length > 15000)
|
||||||
if (ord($post_topic[$i]) >= 33 && ord($post_topic[$i]) <= 126)
|
$errors[] = "Too short or too long post (Length: $length letters). Minimum 1 letter, maximum 15000 letters.";
|
||||||
$lenght++;
|
|
||||||
}
|
|
||||||
if ($lenght < 1 || strlen($post_topic) > 60)
|
|
||||||
$errors[] = 'Too short or too long topic (short: ' . $lenght . ' long: ' . strlen($post_topic) . ' letters). Minimum 1 letter, maximum 60 letters.';
|
|
||||||
$lenght = 0;
|
|
||||||
for ($i = 0; $i < strlen($text); $i++) {
|
|
||||||
if (ord($text[$i]) >= 33 && ord($text[$i]) <= 126)
|
|
||||||
$lenght++;
|
|
||||||
}
|
|
||||||
if ($lenght < 1 || strlen($text) > 15000)
|
|
||||||
$errors[] = 'Too short or too long post (short: ' . $lenght . ' long: ' . strlen($text) . ' letters). Minimum 1 letter, maximum 15000 letters.';
|
|
||||||
|
|
||||||
if ($char_id == 0)
|
if ($char_id == 0)
|
||||||
$errors[] = 'Please select a character.';
|
$errors[] = 'Please select a character.';
|
||||||
@@ -93,11 +89,17 @@ if(Forum::canPost($account_logged))
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
echo 'Board with ID ' . $board_id . ' doesn\'t exist.';
|
$errors[] = "Board with ID $section_id doesn't exist.";
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$errors[] = 'Please enter section_id.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
echo 'Please enter section_id.';
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
echo 'Your account is banned, deleted or you don\'t have any player with level '.$config['forum_level_required'].' on your account. You can\'t post.';
|
$errors[] = 'Your account is banned, deleted or you don\'t have any player with level '.$config['forum_level_required'].' on your account. You can\'t post.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
|
}
|
||||||
|
@@ -29,8 +29,12 @@ if(Forum::isModerator())
|
|||||||
header('Location: ' . getForumThreadLink($post['first_post'], (int) $_page));
|
header('Location: ' . getForumThreadLink($post['first_post'], (int) $_page));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
echo 'Post with ID ' . $id . ' does not exist.';
|
$errors[] = 'Post with ID ' . $id . ' does not exist.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$errors[] = 'You are not logged in or you are not moderator.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
echo 'You are not logged in or you are not moderator.';
|
|
@@ -14,12 +14,14 @@ $links_to_pages = '';
|
|||||||
$section_id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null;
|
$section_id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null;
|
||||||
|
|
||||||
if($section_id == null || !isset($sections[$section_id])) {
|
if($section_id == null || !isset($sections[$section_id])) {
|
||||||
echo "Board with this id does't exist.";
|
$errors[] = "Board with this id does't exist.";
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Forum::hasAccess($section_id)) {
|
if(!Forum::hasAccess($section_id)) {
|
||||||
echo "You don't have access to this board.";
|
$errors[] = "You don't have access to this board.";
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,5 +92,3 @@ if(isset($last_threads[0]))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
echo '<h3>No threads in this board.</h3>';
|
echo '<h3>No threads in this board.</h3>';
|
||||||
|
|
||||||
?>
|
|
||||||
|
@@ -16,12 +16,14 @@ $_page = (int) (isset($_REQUEST['page']) ? $_REQUEST['page'] : 0);
|
|||||||
$thread_starter = $db->query("SELECT `players`.`name`, `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`section` FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." AND `" . FORUM_TABLE_PREFIX . "forum`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`first_post` AND `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` LIMIT 1")->fetch();
|
$thread_starter = $db->query("SELECT `players`.`name`, `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`section` FROM `players`, `" . FORUM_TABLE_PREFIX . "forum` WHERE `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." AND `" . FORUM_TABLE_PREFIX . "forum`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`first_post` AND `players`.`id` = `" . FORUM_TABLE_PREFIX . "forum`.`author_guid` LIMIT 1")->fetch();
|
||||||
|
|
||||||
if(empty($thread_starter['name'])) {
|
if(empty($thread_starter['name'])) {
|
||||||
echo 'Thread with this ID does not exits.';
|
$errors[] = 'Thread with this ID does not exists.';
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Forum::hasAccess($thread_starter['section'])) {
|
if(!Forum::hasAccess($thread_starter['section'])) {
|
||||||
echo "You don't have access to view this thread.";
|
$errors[] = "You don't have access to view this thread.";
|
||||||
|
displayErrorBoxWithBackButton($errors, getLink('forum'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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 %}
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% set i = 0 %}
|
{% set i = 0 %}
|
||||||
{% for thread in threads %}
|
{% for thread in threads %}
|
||||||
<tr bgcolor="{{ getStyle(i) }}"><td>{{ thread.name }}</td><td>{{ thread.post|raw }}</td></tr>
|
<tr bgcolor="{{ getStyle(i) }}"><td>{{ thread.name }}</td><td style="word-break: break-all">{{ thread.post|raw }}</td></tr>
|
||||||
{% set i = i + 1 %}
|
{% set i = i + 1 %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
@@ -40,7 +40,7 @@ Page: {{ links_to_pages|raw }}<br/>
|
|||||||
<br />Posts: {{ post.author_posts_count }}<br />
|
<br />Posts: {{ post.author_posts_count }}<br />
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td valign="top">{{ post.content|raw }} </td></tr>
|
<td valign="top" style="word-break: break-all">{{ post.content|raw }} </td></tr>
|
||||||
<tr bgcolor="{{ getStyle(i) }}">
|
<tr bgcolor="{{ getStyle(i) }}">
|
||||||
<td>
|
<td>
|
||||||
<span style="font-size: 10px">{{ post.date|date('d.m.y H:i:s') }}
|
<span style="font-size: 10px">{{ post.date|date('d.m.y H:i:s') }}
|
||||||
|
@@ -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,10 +47,10 @@
|
|||||||
<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 descriptions is not empty %}
|
{% if description is not empty %}
|
||||||
{{ description }}
|
{{ description|raw }}
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -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);
|
||||||
});
|
});
|
||||||
@@ -44,15 +47,23 @@ $function = new TwigFunction('getGuildLink', function ($s, $p) {
|
|||||||
});
|
});
|
||||||
$twig->addFunction($function);
|
$twig->addFunction($function);
|
||||||
|
|
||||||
$function = new TwigFunction('hook', function ($hook) {
|
$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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$hooks->trigger($hook);
|
$params['context'] = $context;
|
||||||
});
|
$hooks->trigger($hook, $params);
|
||||||
|
}, ['needs_context' => true]);
|
||||||
$twig->addFunction($function);
|
$twig->addFunction($function);
|
||||||
|
|
||||||
$function = new TwigFunction('config', function ($key) {
|
$function = new TwigFunction('config', function ($key) {
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<img src="{{ template_path }}/images/content/headline-bracer-left.gif" />
|
<img src="{{ template_path }}/images/content/headline-bracer-left.gif" />
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;" >{{ welcome_message }}<br/></td>
|
<td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;" >{{ welcome_message|raw }}<br/></td>
|
||||||
<td><img src="{{ template_path }}/images/content/headline-bracer-right.gif" /></td>
|
<td><img src="{{ template_path }}/images/content/headline-bracer-right.gif" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@@ -28,7 +28,7 @@ if(!@file_exists($page_file))
|
|||||||
|
|
||||||
// set text
|
// set text
|
||||||
$font = getenv('GDFONTPATH') . DIRECTORY_SEPARATOR . 'martel.ttf';
|
$font = getenv('GDFONTPATH') . DIRECTORY_SEPARATOR . 'martel.ttf';
|
||||||
imagettftext($image, 18, 0, 4, 20, imagecolorallocate($image, 240, 209, 164), $font, utf8_decode($_GET['t']));
|
imagettftext($image, 18, 0, 4, 20, imagecolorallocate($image, 240, 209, 164), $font, $_GET['t']);
|
||||||
|
|
||||||
// header mime type
|
// header mime type
|
||||||
header('Content-type: image/gif');
|
header('Content-type: image/gif');
|
||||||
|
@@ -21,7 +21,7 @@ if(isset($config['boxes']))
|
|||||||
<?php
|
<?php
|
||||||
if(PAGE !== 'news') {
|
if(PAGE !== 'news') {
|
||||||
if(strpos(URI, 'subtopic=') !== false) {
|
if(strpos(URI, 'subtopic=') !== false) {
|
||||||
$tmp = $_REQUEST['subtopic'];
|
$tmp = escapeHtml($_REQUEST['subtopic']);
|
||||||
if($tmp === 'accountmanagement') {
|
if($tmp === 'accountmanagement') {
|
||||||
$tmp = 'accountmanage';
|
$tmp = 'accountmanage';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user