mirror of
https://github.com/slawkens/myaac.git
synced 2025-09-14 04:23:34 +02:00
Compare commits
56 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 | ||
![]() |
89b76e721d | ||
![]() |
6091290efe | ||
![]() |
e4c4990e7f | ||
![]() |
4f1235bfe9 | ||
![]() |
bf9d440a95 | ||
![]() |
59a149c253 | ||
![]() |
563099f290 | ||
![]() |
3732bf988d | ||
![]() |
ab964fa1de | ||
![]() |
b5c694224e | ||
![]() |
23810345f6 | ||
![]() |
b574a29331 | ||
![]() |
6593e32d83 | ||
![]() |
b09adc836d | ||
![]() |
dcf9a45974 | ||
![]() |
21258313ef | ||
![]() |
f851fa3845 | ||
![]() |
2fdd507902 | ||
![]() |
b850e56ff1 | ||
![]() |
8d10082179 | ||
![]() |
996ae625c9 | ||
![]() |
467f7ef927 | ||
![]() |
fa015b8d39 | ||
![]() |
4b4864561c | ||
![]() |
475cea8549 | ||
![]() |
760214fdbd | ||
![]() |
9c5dcd7b19 | ||
![]() |
720e400f7c | ||
![]() |
c261c6ba48 |
15
.gitignore
vendored
15
.gitignore
vendored
@@ -2,6 +2,9 @@ Thumbs.db
|
||||
.DS_Store
|
||||
.idea
|
||||
|
||||
#
|
||||
/.htaccess
|
||||
|
||||
# composer
|
||||
composer.lock
|
||||
vendor
|
||||
@@ -9,6 +12,10 @@ vendor
|
||||
# npm
|
||||
node_modules
|
||||
|
||||
# cypress
|
||||
cypress.env.json
|
||||
cypress/e2e/2-advanced-examples
|
||||
|
||||
# created by release.sh
|
||||
releases
|
||||
tmp
|
||||
@@ -28,6 +35,12 @@ images/guilds/*
|
||||
images/editor/*
|
||||
!images/editor/index.html
|
||||
|
||||
# gallery images
|
||||
images/gallery/*
|
||||
!images/gallery/index.html
|
||||
!images/gallery/demon.jpg
|
||||
!images/gallery/demon_thumb.gif
|
||||
|
||||
# cache
|
||||
system/cache/*
|
||||
!system/cache/index.html
|
||||
@@ -37,7 +50,7 @@ system/cache/*
|
||||
|
||||
# php sessions
|
||||
system/php_sessions/*
|
||||
!system/php_sessions//index.html
|
||||
!system/php_sessions/index.html
|
||||
|
||||
# logs
|
||||
system/logs/*
|
||||
|
51
CHANGELOG.md
51
CHANGELOG.md
@@ -1,5 +1,56 @@
|
||||
# Changelog
|
||||
|
||||
## [0.8.13 - 16.09.2023]
|
||||
|
||||
### Added
|
||||
* latest client versions to config
|
||||
* patching from develop - twig context for hooks
|
||||
|
||||
### Fixed
|
||||
* fixed XSS vulnerability in some pages
|
||||
|
||||
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]
|
||||
|
||||
### Added
|
||||
* new function from 0.9 - Cache::remember($key, $ttl, $callback)
|
||||
* new characters page hooks
|
||||
* line number & file to exception handler, to easier localize exceptions
|
||||
|
||||
### Changed
|
||||
* rename to .htaccess.dist, causes some problems on default setup
|
||||
* removing unneccessary PHP closing tags to prevent potential issues (by @SRNT-GG)
|
||||
* display warning if hook file does not exist
|
||||
|
||||
### Fixed
|
||||
* important: Not allow create char if limit is exceeded (by @anyeor) could have been used to spam database
|
||||
* deleted chars: cannot change comment, name, gender, cannot create guild, cannot be invited, cannot accept invite, cannot be passed leadership to
|
||||
* forum: quote and edit post buttons not being shown
|
||||
* twig exception thrown when player does not exist, on character change comment (thanks @anyeor)
|
||||
* BASE_DIR when accessing /tools
|
||||
* do not display warning if HTTP_ACCEPT_LANGUAGE is not set
|
||||
|
||||
## [0.8.10 - 18.05.2023]
|
||||
|
||||
### Changed
|
||||
|
28
README.md
28
README.md
@@ -1,19 +1,25 @@
|
||||
# [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.
|
||||
|
||||
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 |
|
||||
|:-----------|:------------------------------------------|:--------|:---------------|
|
||||
| **0.10.x** | **Active development** | develop | **PHP >= 8.0** |
|
||||
| 0.9.x | Active support | 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
|
||||
|
||||
- PHP 5.6 or later
|
||||
- PHP 7.2.5 or later
|
||||
- MySQL database
|
||||
- PDO PHP Extension
|
||||
- XML PHP Extension
|
||||
@@ -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
|
||||
|
||||
## 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
|
||||
|
||||
This program and all associated files are released under the GNU Public License.
|
||||
|
@@ -1 +1,2 @@
|
||||
<?php
|
||||
<?php
|
||||
// nothing yet here
|
@@ -68,4 +68,4 @@ ob_end_clean();
|
||||
// template
|
||||
$template_path = 'template/';
|
||||
require ADMIN . $template_path . 'template.php';
|
||||
?>
|
||||
|
||||
|
@@ -426,7 +426,7 @@ else if ($id > 0 && isset($account) && $account->isLoaded()) {
|
||||
<div class="box-body">
|
||||
<form action="<?php echo $base; ?>" method="post">
|
||||
<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">
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" type="button" class="btn btn-info btn-flat">Search</button>
|
||||
|
@@ -196,5 +196,3 @@ class Pages
|
||||
return !count($errors);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -784,7 +784,7 @@ else if ($id > 0 && isset($player) && $player->isLoaded())
|
||||
<div class="box-body">
|
||||
<form action="<?php echo $base; ?>" method="post">
|
||||
<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">
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" type="button" class="btn btn-info btn-flat">Search</button>
|
||||
|
@@ -36,4 +36,3 @@ $twig->display('admin.statistics.html.twig', array(
|
||||
'account_type' => (USE_ACCOUNT_NAME ? 'name' : 'number'),
|
||||
'points' => $points
|
||||
));
|
||||
?>
|
@@ -47,4 +47,3 @@ function version_revert($version)
|
||||
$release = $version;
|
||||
return $major . '.' . $minor . '.' . $release;
|
||||
}*/
|
||||
?>
|
||||
|
@@ -13,4 +13,3 @@ if(!function_exists('phpinfo'))
|
||||
die('phpinfo() disabled on this web server.');
|
||||
|
||||
phpinfo();
|
||||
?>
|
||||
|
@@ -26,7 +26,7 @@
|
||||
if (version_compare(phpversion(), '7.2.5', '<')) die('PHP version 7.2.5 or higher is required.');
|
||||
|
||||
define('MYAAC', true);
|
||||
define('MYAAC_VERSION', '0.8.10');
|
||||
define('MYAAC_VERSION', '0.8.13');
|
||||
define('DATABASE_VERSION', 33);
|
||||
define('TABLE_PREFIX', 'myaac_');
|
||||
define('START_TIME', microtime(true));
|
||||
@@ -97,7 +97,7 @@ $size = count($tmp) - 1;
|
||||
for($i = 1; $i < $size; $i++)
|
||||
$basedir .= '/' . $tmp[$i];
|
||||
|
||||
$basedir = str_replace(array('/admin', '/install'), '', $basedir);
|
||||
$basedir = str_replace(array('/admin', '/install', '/tools'), '', $basedir);
|
||||
define('BASE_DIR', $basedir);
|
||||
|
||||
if(!IS_CLI) {
|
||||
|
0
images/gallery/index.html
Normal file
0
images/gallery/index.html
Normal file
13
index.php
13
index.php
@@ -167,7 +167,7 @@ else {
|
||||
}
|
||||
|
||||
// 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';
|
||||
$found = true;
|
||||
}
|
||||
@@ -298,6 +298,7 @@ if($config['backward_support']) {
|
||||
$config['site'] = &$config;
|
||||
$config['server'] = &$config['lua'];
|
||||
$config['site']['shop_system'] = $config['gifts_system'];
|
||||
$config['site']['gallery_page'] = true;
|
||||
|
||||
if(!isset($config['vdarkborder']))
|
||||
$config['vdarkborder'] = '#505050';
|
||||
@@ -345,12 +346,10 @@ if($load_it)
|
||||
)) . $content;
|
||||
}
|
||||
} else {
|
||||
$file = TEMPLATES . $template_name . '/pages/' . $page . '.php';
|
||||
if(!@file_exists($file) || preg_match('/[^A-z0-9_\-]/', $page))
|
||||
{
|
||||
$file = SYSTEM . 'pages/' . $page . '.php';
|
||||
if(!@file_exists($file) || preg_match('/[^A-z0-9_\-]/', $page))
|
||||
{
|
||||
$file = TEMPLATES . "$template_name/pages/$page.php";
|
||||
if(!@file_exists($file) || preg_match('/[^A-z0-9_\-]/', $page)) {
|
||||
$file = SYSTEM . "pages/$page.php";
|
||||
if(!@file_exists($file) || preg_match('/[^A-z0-9_\-]/', $page)) {
|
||||
$page = '404';
|
||||
$file = SYSTEM . 'pages/404.php';
|
||||
}
|
||||
|
@@ -38,4 +38,3 @@ if(!isset($error) || !$error) {
|
||||
$error = true;
|
||||
}
|
||||
}
|
||||
?>
|
@@ -5,4 +5,3 @@ $twig->display('install.license.html.twig', array(
|
||||
'license' => file_get_contents(BASE . 'LICENSE'),
|
||||
'buttons' => next_buttons()
|
||||
));
|
||||
?>
|
||||
|
@@ -18,4 +18,3 @@ $twig->display('install.config.html.twig', array(
|
||||
'errors' => isset($errors) ? $errors : null,
|
||||
'buttons' => next_buttons()
|
||||
));
|
||||
?>
|
@@ -32,6 +32,6 @@ server {
|
||||
include snippets/fastcgi-php.conf;
|
||||
fastcgi_read_timeout 240;
|
||||
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
|
||||
# for ubuntu 22.04+ it will be php8.1-fpm.-sock
|
||||
# for ubuntu 22.04+ it will be php8.1-fpm.sock
|
||||
}
|
||||
}
|
||||
|
@@ -4,12 +4,12 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
$reward = config('account_mail_confirmed_reward');
|
||||
|
||||
$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.');
|
||||
}
|
||||
|
||||
if (!isset($account) || !$account->isLoaded()) {
|
||||
log_append('email_confirm_error.log', 'Account not loaded.');
|
||||
//log_append('email_confirm_error.log', 'Account not loaded.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -99,4 +99,10 @@ $config['clients'] = [
|
||||
1291,
|
||||
|
||||
1300,
|
||||
1310,
|
||||
1311,
|
||||
1312,
|
||||
1316,
|
||||
1320,
|
||||
1321,
|
||||
];
|
||||
|
@@ -9,7 +9,30 @@
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
class Player extends OTS_Player {}
|
||||
class Guild extends OTS_Guild {}
|
||||
class Account extends OTS_Account {
|
||||
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 House extends OTS_House {}
|
||||
|
@@ -10,6 +10,14 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
switch($page)
|
||||
{
|
||||
case 'adminpanel':
|
||||
header('Location: ' . ADMIN_URL);
|
||||
die;
|
||||
|
||||
case 'archive':
|
||||
$page = 'newsarchive';
|
||||
break;
|
||||
|
||||
case 'whoisonline':
|
||||
$page = 'online';
|
||||
break;
|
||||
@@ -37,4 +45,3 @@ switch($page)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
@@ -51,4 +51,3 @@ else
|
||||
updateDatabaseConfig('views_counter', $views_counter); // update counter
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -116,5 +116,4 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
'<li>MySQL is not configured propertly in <i>config.lua</i>.</li>' .
|
||||
'<li>MySQL server is not running.</li>' .
|
||||
'</ul>' . $error->getMessage());
|
||||
|
||||
}
|
@@ -23,6 +23,8 @@ function exception_handler($exception) {
|
||||
|
||||
$backtrace_formatted = nl2br($exception->getTraceAsString());
|
||||
|
||||
$message = $message . "<br/><br/>File: {$exception->getFile()}<br/>Line: {$exception->getLine()}";
|
||||
|
||||
// display basic error message without template
|
||||
// template is missing, why? probably someone deleted templates dir, or it wasn't downloaded right
|
||||
$template_file = SYSTEM . 'templates/exception.html.twig';
|
||||
|
@@ -7,11 +7,10 @@
|
||||
* @copyright 2019 MyAAC
|
||||
* @link https://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
use Twig\Loader\ArrayLoader as Twig_ArrayLoader;
|
||||
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
function message($message, $type, $return)
|
||||
{
|
||||
if(IS_CLI) {
|
||||
@@ -757,10 +756,10 @@ function get_browser_languages()
|
||||
{
|
||||
$ret = array();
|
||||
|
||||
$acceptLang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
|
||||
if(!isset($acceptLang[0]))
|
||||
if(empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||
return $ret;
|
||||
|
||||
$acceptLang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
|
||||
$languages = strtolower($acceptLang);
|
||||
// $languages = 'pl,en-us;q=0.7,en;q=0.3 ';
|
||||
// need to remove spaces from strings to avoid error
|
||||
@@ -798,7 +797,7 @@ function get_plugins()
|
||||
$ret = array();
|
||||
|
||||
$path = PLUGINS;
|
||||
foreach(scandir($path, 0) as $file) {
|
||||
foreach(scandir($path, SCANDIR_SORT_ASCENDING) as $file) {
|
||||
$file_ext = pathinfo($file, PATHINFO_EXTENSION);
|
||||
$file_name = pathinfo($file, PATHINFO_FILENAME);
|
||||
if ($file === '.' || $file === '..' || $file === 'disabled' || $file === 'example.json' || $file_ext !== 'json' || is_dir($path . $file))
|
||||
@@ -924,8 +923,8 @@ function load_config_lua($filename)
|
||||
$config_file = $filename;
|
||||
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));
|
||||
throw new RuntimeException('ERROR: Cannot find ' . $filename . ' file. More info in system/logs/error.log');
|
||||
log_append('error.log', '[load_config_file] Fatal error: Cannot load config.lua (' . $filename . ').');
|
||||
throw new RuntimeException('ERROR: Cannot find ' . $filename . ' file.');
|
||||
}
|
||||
|
||||
$result = array();
|
||||
@@ -1248,6 +1247,36 @@ function escapeHtml($html) {
|
||||
return htmlentities($html, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
}
|
||||
|
||||
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
|
||||
require_once LIBS . 'validator.php';
|
||||
require_once SYSTEM . 'compat/base.php';
|
||||
|
@@ -9,41 +9,47 @@
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
define('HOOK_STARTUP', 1);
|
||||
define('HOOK_BEFORE_PAGE', 2);
|
||||
define('HOOK_AFTER_PAGE', 3);
|
||||
define('HOOK_FINISH', 4);
|
||||
define('HOOK_TIBIACOM_ARTICLE', 5);
|
||||
define('HOOK_TIBIACOM_BORDER_3', 6);
|
||||
define('HOOK_CHARACTERS_BEFORE_INFORMATIONS', 7);
|
||||
define('HOOK_CHARACTERS_AFTER_INFORMATIONS', 8);
|
||||
define('HOOK_CHARACTERS_BEFORE_SIGNATURE', 9);
|
||||
define('HOOK_CHARACTERS_AFTER_SIGNATURE', 10);
|
||||
define('HOOK_CHARACTERS_AFTER_ACCOUNT', 11);
|
||||
define('HOOK_CHARACTERS_AFTER_CHARACTERS', 12);
|
||||
define('HOOK_LOGIN', 13);
|
||||
define('HOOK_LOGIN_ATTEMPT', 14);
|
||||
define('HOOK_LOGOUT', 15);
|
||||
define('HOOK_ACCOUNT_CREATE_BEFORE_FORM', 16);
|
||||
define('HOOK_ACCOUNT_CREATE_BEFORE_BOXES', 17);
|
||||
define('HOOK_ACCOUNT_CREATE_BETWEEN_BOXES_1', 18);
|
||||
define('HOOK_ACCOUNT_CREATE_BETWEEN_BOXES_2', 19);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_BOXES', 20);
|
||||
define('HOOK_ACCOUNT_CREATE_BEFORE_ACCOUNT', 21);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_ACCOUNT', 22);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_EMAIL', 23);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_COUNTRY', 24);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_PASSWORDS', 25);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_RECAPTCHA', 26);
|
||||
define('HOOK_ACCOUNT_CREATE_BEFORE_CHARACTER_NAME', 27);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_CHARACTER_NAME', 28);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_SEX', 29);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_VOCATION', 30);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_TOWNS', 31);
|
||||
define('HOOK_ACCOUNT_CREATE_BEFORE_SUBMIT_BUTTON', 32);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_FORM', 33);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_SUBMIT', 34);
|
||||
define('HOOK_EMAIL_CONFIRMED', 35);
|
||||
$i = 0;
|
||||
define('HOOK_STARTUP', ++$i);
|
||||
define('HOOK_BEFORE_PAGE', ++$i);
|
||||
define('HOOK_AFTER_PAGE', ++$i);
|
||||
define('HOOK_FINISH', ++$i);
|
||||
define('HOOK_TIBIACOM_ARTICLE', ++$i);
|
||||
define('HOOK_TIBIACOM_BORDER_3', ++$i);
|
||||
define('HOOK_CHARACTERS_BEFORE_INFORMATIONS', ++$i);
|
||||
define('HOOK_CHARACTERS_AFTER_INFORMATIONS', ++$i);
|
||||
define('HOOK_CHARACTERS_BEFORE_SKILLS', ++$i);
|
||||
define('HOOK_CHARACTERS_AFTER_SKILLS', ++$i);
|
||||
define('HOOK_CHARACTERS_AFTER_QUESTS', ++$i);
|
||||
define('HOOK_CHARACTERS_AFTER_EQUIPMENT', ++$i);
|
||||
define('HOOK_CHARACTERS_BEFORE_DEATHS', ++$i);
|
||||
define('HOOK_CHARACTERS_BEFORE_SIGNATURE', ++$i);
|
||||
define('HOOK_CHARACTERS_AFTER_SIGNATURE', ++$i);
|
||||
define('HOOK_CHARACTERS_AFTER_ACCOUNT', ++$i);
|
||||
define('HOOK_CHARACTERS_AFTER_CHARACTERS', ++$i);
|
||||
define('HOOK_LOGIN', ++$i);
|
||||
define('HOOK_LOGIN_ATTEMPT', ++$i);
|
||||
define('HOOK_LOGOUT', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_BEFORE_FORM', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_BEFORE_BOXES', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_BETWEEN_BOXES_1', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_BETWEEN_BOXES_2', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_BOXES', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_BEFORE_ACCOUNT', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_ACCOUNT', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_EMAIL', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_COUNTRY', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_PASSWORDS', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_RECAPTCHA', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_BEFORE_CHARACTER_NAME', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_CHARACTER_NAME', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_SEX', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_VOCATION', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_TOWNS', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_BEFORE_SUBMIT_BUTTON', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_FORM', ++$i);
|
||||
define('HOOK_ACCOUNT_CREATE_AFTER_SUBMIT', ++$i);
|
||||
define('HOOK_EMAIL_CONFIRMED', ++$i);
|
||||
define('HOOK_FIRST', HOOK_STARTUP);
|
||||
define('HOOK_LAST', HOOK_EMAIL_CONFIRMED);
|
||||
|
||||
@@ -68,9 +74,7 @@ class Hook
|
||||
}*/
|
||||
|
||||
global $db, $config, $template_path, $ots, $content, $twig;
|
||||
if(file_exists(BASE . $this->_file)) {
|
||||
$ret = require BASE . $this->_file;
|
||||
}
|
||||
$ret = include BASE . $this->_file;
|
||||
|
||||
return !isset($ret) || $ret == 1 || $ret;
|
||||
}
|
||||
|
@@ -111,7 +111,7 @@ if(!isset($foundValue)) {
|
||||
$config['data_path'] = $foundValue;
|
||||
unset($foundValue);
|
||||
|
||||
// new config values for compability
|
||||
// new config values for compatibility
|
||||
if(!isset($config['highscores_ids_hidden']) || count($config['highscores_ids_hidden']) == 0) {
|
||||
$config['highscores_ids_hidden'] = array(0);
|
||||
}
|
||||
|
@@ -58,4 +58,3 @@ function outputItem($id = 100, $count = 1)
|
||||
$file_name = Items_Images::$outputDir . $file_name . '.gif';
|
||||
readfile($file_name);
|
||||
}
|
||||
?>
|
||||
|
@@ -138,7 +138,7 @@ class CreateCharacter
|
||||
|
||||
if(empty($errors))
|
||||
{
|
||||
$number_of_players_on_account = $account->getPlayersList(false)->count();
|
||||
$number_of_players_on_account = $account->getPlayersList(true)->count();
|
||||
if($number_of_players_on_account >= config('characters_per_account'))
|
||||
$errors[] = 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.config('characters_per_account').')</b>!';
|
||||
}
|
||||
|
@@ -110,4 +110,21 @@ class Cache
|
||||
* @return bool
|
||||
*/
|
||||
public function enabled() {return false;}
|
||||
|
||||
public static function remember($key, $ttl, $callback)
|
||||
{
|
||||
$cache = self::getInstance();
|
||||
if(!$cache->enabled()) {
|
||||
return $callback();
|
||||
}
|
||||
|
||||
$value = null;
|
||||
if ($cache->fetch($key, $value)) {
|
||||
return unserialize($value);
|
||||
}
|
||||
|
||||
$value = $callback();
|
||||
$cache->set($key, serialize($value),$ttl);
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
@@ -41,4 +41,3 @@ class Data
|
||||
return $db->update($this->table, $data, $where);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -74,6 +74,10 @@ class Plugins {
|
||||
if (isset($plugin['hooks'])) {
|
||||
foreach ($plugin['hooks'] as $_name => $info) {
|
||||
if (defined('HOOK_'. $info['type'])) {
|
||||
if (strpos($info['type'], 'HOOK_') !== false) {
|
||||
$info['type'] = str_replace('HOOK_', '', $info['type']);
|
||||
}
|
||||
|
||||
$hook = constant('HOOK_'. $info['type']);
|
||||
$hooks[] = ['name' => $_name, 'type' => $hook, 'file' => $info['file']];
|
||||
} else {
|
||||
|
@@ -32,5 +32,3 @@ class E_OTS_ErrorCode extends Exception
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -36,5 +36,3 @@ class E_OTS_Generic extends E_OTS_ErrorCode
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -22,5 +22,3 @@ class E_OTS_NotAContainer extends Exception
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -32,5 +32,3 @@ class E_OTS_OTBMError extends E_OTS_ErrorCode
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -22,5 +22,3 @@ class E_OTS_ReadOnly extends Exception
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -37,5 +37,3 @@ interface IOTS_Cipher
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -89,5 +89,3 @@ interface IOTS_DataDisplay
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -96,5 +96,3 @@ interface IOTS_Display
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -67,5 +67,3 @@ interface IOTS_GuildAction
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -922,7 +922,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
$access = 0;
|
||||
|
||||
// finds ranks of all characters
|
||||
foreach($this->getPlayersList() as $player)
|
||||
foreach($this->getPlayersList(false) as $player)
|
||||
{
|
||||
$rank = $player->getRank();
|
||||
|
||||
@@ -1126,5 +1126,3 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -34,5 +34,3 @@ class OTS_AccountBans_List extends OTS_Bans_List
|
||||
$this->setFilter($filter);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -735,5 +735,3 @@ class OTS_Admin
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -100,5 +100,3 @@ class OTS_Bans_List extends OTS_Base_List
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -248,5 +248,3 @@ abstract class OTS_Base_DB extends PDO implements IOTS_DB
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -146,5 +146,3 @@ class OTS_BinaryTools
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -149,5 +149,3 @@ class OTS_Container extends OTS_Item implements IteratorAggregate
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -357,5 +357,3 @@ class OTS_FileLoader
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -671,5 +671,3 @@ class OTS_Group extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -837,5 +837,3 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -72,5 +72,3 @@ class OTS_GuildRanks_List extends OTS_Base_List
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -529,5 +529,3 @@ class OTS_House extends OTS_Row_DAO
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -34,5 +34,3 @@ class OTS_IPBans_List extends OTS_Bans_List
|
||||
$this->setFilter($filter);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -387,5 +387,3 @@ class OTS_InfoRespond extends DOMDocument
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -676,5 +676,3 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -130,5 +130,3 @@ class OTS_MapCoords
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -299,5 +299,3 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -3627,5 +3627,3 @@ class OTS_Player extends OTS_Row_DAO
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -34,5 +34,3 @@ class OTS_PlayerBans_List extends OTS_Bans_List
|
||||
$this->setFilter($filter);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -75,5 +75,3 @@ abstract class OTS_Row_DAO extends OTS_Base_DAO
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -121,5 +121,3 @@ class OTS_SQLField
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
/**
|
||||
* Various server status querying methods.
|
||||
*
|
||||
*
|
||||
* @package POT
|
||||
* @property-read OTS_InfoRespond|bool $status status() method wrapper.
|
||||
* @property-read OTS_ServerStatus|bool $info Full info() method wrapper.
|
||||
@@ -23,21 +23,21 @@ class OTS_ServerInfo
|
||||
{
|
||||
/**
|
||||
* Server address.
|
||||
*
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $server;
|
||||
|
||||
/**
|
||||
* Connection port.
|
||||
*
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $port;
|
||||
|
||||
/**
|
||||
* Creates handler for new server.
|
||||
*
|
||||
*
|
||||
* @param string $server Server IP/domain.
|
||||
* @param int $port OTServ port.
|
||||
*/
|
||||
@@ -49,7 +49,7 @@ class OTS_ServerInfo
|
||||
|
||||
/**
|
||||
* Sends packet to server.
|
||||
*
|
||||
*
|
||||
* @param OTS_Buffer|string $packet Buffer to send.
|
||||
* @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.
|
||||
@@ -75,7 +75,7 @@ class OTS_ServerInfo
|
||||
|
||||
// reads respond
|
||||
//$data = stream_get_contents($socket);
|
||||
$data = '';
|
||||
$data = '';
|
||||
while (!feof($socket))
|
||||
$data .= fgets($socket, 1024);
|
||||
|
||||
@@ -97,11 +97,11 @@ class OTS_ServerInfo
|
||||
|
||||
/**
|
||||
* Queries server status.
|
||||
*
|
||||
*
|
||||
* <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.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @return OTS_InfoRespond|bool Respond content document (false when server is offline).
|
||||
* @throws DOMException On DOM operation error.
|
||||
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
||||
@@ -123,7 +123,7 @@ class OTS_ServerInfo
|
||||
{
|
||||
// loads respond XML
|
||||
$info = new OTS_InfoRespond();
|
||||
if(!$info->loadXML( utf8_encode($status->getBuffer())))
|
||||
if(!$info->loadXML( $status->getBuffer()))
|
||||
return false;
|
||||
|
||||
return $info;
|
||||
@@ -135,11 +135,11 @@ class OTS_ServerInfo
|
||||
|
||||
/**
|
||||
* Queries server information.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* This method uses binary info protocol. It provides more infromation then {@link OTS_Toolbox::serverStatus() XML way}.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param int $flags Requested info flags.
|
||||
* @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.
|
||||
@@ -169,11 +169,11 @@ class OTS_ServerInfo
|
||||
|
||||
/**
|
||||
* Checks player online status.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* This method uses binary info protocol.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @param string $name Player name.
|
||||
* @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.
|
||||
@@ -204,7 +204,7 @@ class OTS_ServerInfo
|
||||
|
||||
/**
|
||||
* Magic PHP5 method.
|
||||
*
|
||||
*
|
||||
* @param string $name Property name.
|
||||
* @param mixed $value Property value.
|
||||
* @throws OutOfBoundsException For non-supported properties.
|
||||
@@ -227,5 +227,3 @@ class OTS_ServerInfo
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -482,5 +482,3 @@ class OTS_Spell
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -113,5 +113,3 @@ class OTS_Toolbox
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -151,5 +151,3 @@ class OTS_XTEA implements IOTS_Cipher
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
||||
?>
|
||||
|
@@ -282,4 +282,3 @@ class TokenAuth6238 {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -432,4 +432,3 @@ class Validator
|
||||
return self::$lastError;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -6,4 +6,3 @@
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
*/
|
||||
$locale['title'] = 'MyAAC Admin';
|
||||
?>
|
||||
|
@@ -11,5 +11,4 @@ $locale['encoding'] = 'utf-8';
|
||||
$locale['direction']= 'ltr';
|
||||
|
||||
$locale['error404'] = 'Diese Seite konnte nicht gefunden werden.';
|
||||
$locale['news'] = 'Neuesten Nachrichten';
|
||||
?>
|
||||
$locale['news'] = 'Neuesten Nachrichten';
|
@@ -123,4 +123,3 @@ $locale['step_finish_title'] = 'Installation finished!';
|
||||
$locale['step_finish_desc'] = 'Congratulations! <b>MyAAC</b> is ready to use!<br/>You can now login to $ADMIN_PANEL$, or visit $HOMEPAGE$.<br/><br/>
|
||||
<span style="color: red">Please delete install/ directory.</span><br/><br/>
|
||||
Post bugs and suggestions at $LINK$, thanks!';
|
||||
?>
|
||||
|
@@ -6,4 +6,3 @@
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
*/
|
||||
$locale['title'] = 'MyAAC Admin';
|
||||
?>
|
||||
|
@@ -11,5 +11,4 @@ $locale['encoding'] = 'utf-8';
|
||||
$locale['direction']= 'ltr';
|
||||
|
||||
$locale['error404'] = 'Strona nie została odnaleziona.';
|
||||
$locale['news'] = 'Ostatnie newsy';
|
||||
?>
|
||||
$locale['news'] = 'Ostatnie newsy';
|
@@ -121,4 +121,3 @@ $locale['step_finish'] = 'Finalizar';
|
||||
$locale['step_finish_title'] = 'Instalação terminada!';
|
||||
$locale['step_finish_desc'] = 'Parabéns! <b>MyAAC</b> está pronto para uso!<br/>Agora você pode fazer login em $ADMIN_PANEL$ ou visitar $HOMEPAGE$.<br/><br/>
|
||||
<span style = "color: red">Por favor remova a pasta install/.</span><br/><br/>Postar bugs e sugestões em $LINK$, obrigado!';
|
||||
?>
|
||||
|
@@ -6,4 +6,3 @@
|
||||
* @author Sizaro <sizaro@live.se>
|
||||
*/
|
||||
$locale['title'] = 'MyAAC Admin';
|
||||
?>
|
||||
|
@@ -12,4 +12,3 @@ $locale['direction']= 'ltr';
|
||||
|
||||
$locale['error404'] = 'Sidan kunde inte hittas.';
|
||||
$locale['news'] = 'Senaste nyheterna';
|
||||
?>
|
@@ -10,6 +10,7 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$logged = false;
|
||||
$logged_flags = 0;
|
||||
$account_logged = new OTS_Account();
|
||||
|
||||
$action = isset($_REQUEST['action']) ? strtolower($_REQUEST['action']) : '';
|
||||
if(!defined('ACTION')) {
|
||||
@@ -20,7 +21,6 @@ if(!defined('ACTION')) {
|
||||
$current_session = getSession('account');
|
||||
if($current_session !== false)
|
||||
{
|
||||
$account_logged = new OTS_Account();
|
||||
$account_logged->load($current_session);
|
||||
if($account_logged->isLoaded() && $account_logged->getPassword() == getSession('password')
|
||||
//&& (!isset($_SESSION['admin']) || admin())
|
||||
@@ -84,7 +84,6 @@ else
|
||||
$t = isset($tmp[$ip]) ? $tmp[$ip] : NULL;
|
||||
}
|
||||
|
||||
$account_logged = new OTS_Account();
|
||||
if(USE_ACCOUNT_NAME)
|
||||
$account_logged->find($login_account);
|
||||
else
|
||||
|
@@ -16,5 +16,4 @@
|
||||
'image' => str_replace('/screenshots/', '/gallery/', $item['image']),
|
||||
'thumb' => str_replace('/screenshots/', '/gallery/', $item['thumb']),
|
||||
), array('id' => $item['id']));
|
||||
}
|
||||
?>
|
||||
}
|
@@ -1,4 +1,3 @@
|
||||
<?php
|
||||
if($db->hasColumn(TABLE_PREFIX . 'spells', 'spell'))
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` DROP COLUMN `spell`;");
|
||||
?>
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "spells` DROP COLUMN `spell`;");
|
@@ -8,4 +8,3 @@ if(!$db->hasColumn(TABLE_PREFIX . 'forum_boards', 'guild')) {
|
||||
if(!$db->hasColumn(TABLE_PREFIX . 'forum_boards', 'access')) {
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "forum_boards` ADD `access` TINYINT(1) NOT NULL DEFAULT 0 AFTER `guild`;");
|
||||
}
|
||||
?>
|
@@ -86,4 +86,3 @@ INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VA
|
||||
INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Shop History', 'gifts/history', 6, 2);
|
||||
");
|
||||
}
|
||||
?>
|
@@ -1,3 +1,2 @@
|
||||
<?php
|
||||
// this migration has been removed, but file kept for compability
|
||||
?>
|
||||
// this migration has been removed, but file kept for compatibility
|
||||
|
@@ -3,4 +3,3 @@
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "movies` MODIFY `title` VARCHAR(100) NOT NULL DEFAULT '';");
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "news` MODIFY `title` VARCHAR(100) NOT NULL DEFAULT '';");
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "news` MODIFY `body` TEXT NOT NULL DEFAULT '';");
|
||||
?>
|
||||
|
@@ -45,4 +45,3 @@ function databaseMigration20(&$content = '') {
|
||||
file_put_contents($config_file, $content, FILE_APPEND);
|
||||
return true;
|
||||
}
|
||||
?>
|
@@ -1,4 +1,3 @@
|
||||
<?php
|
||||
if(!$db->hasColumn(TABLE_PREFIX . 'monsters', 'id'))
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `id` int(11) NOT NULL AUTO_INCREMENT primary key FIRST;");
|
||||
?>
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "monsters` ADD `id` int(11) NOT NULL AUTO_INCREMENT primary key FIRST;");
|
@@ -1,4 +1,3 @@
|
||||
<?php
|
||||
if(!$db->hasColumn(TABLE_PREFIX . 'hooks', 'enabled'))
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "hooks` ADD `enabled` INT(1) NOT NULL DEFAULT 1;");
|
||||
?>
|
||||
$db->query("ALTER TABLE `" . TABLE_PREFIX . "hooks` ADD `enabled` INT(1) NOT NULL DEFAULT 1;");
|
@@ -14,5 +14,4 @@
|
||||
|
||||
foreach($boards as $id => $board)
|
||||
$db->query('UPDATE `' . TABLE_PREFIX . 'forum_boards` SET `ordering` = ' . $id . ' WHERE `name` = ' . $db->quote($board));
|
||||
}
|
||||
?>
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Account confirm mail
|
||||
* Keept for compability
|
||||
* Keept for compatibility
|
||||
*
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
@@ -13,4 +13,3 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
if($action == 'confirm_email') {
|
||||
require_once PAGES . 'account/confirm_email.php';
|
||||
}
|
||||
?>
|
||||
|
@@ -21,15 +21,22 @@ if($player_name != null) {
|
||||
if ($player->isLoaded()) {
|
||||
$player_account = $player->getAccount();
|
||||
if ($account_logged->getId() == $player_account->getId()) {
|
||||
if ($player->isDeleted()) {
|
||||
$errors[] = 'This character is deleted.';
|
||||
$player = null;
|
||||
}
|
||||
|
||||
if (isset($_POST['changecommentsave']) && $_POST['changecommentsave'] == 1) {
|
||||
$player->setCustomField("hidden", $new_hideacc);
|
||||
$player->setCustomField("comment", $new_comment);
|
||||
$account_logged->logAction('Changed comment for character <b>' . $player->getName() . '</b>.');
|
||||
$twig->display('success.html.twig', array(
|
||||
'title' => 'Character Information Changed',
|
||||
'description' => 'The character information has been changed.'
|
||||
));
|
||||
$show_form = false;
|
||||
if(empty($errors)) {
|
||||
$player->setCustomField("hidden", $new_hideacc);
|
||||
$player->setCustomField("comment", $new_comment);
|
||||
$account_logged->logAction('Changed comment for character <b>' . $player->getName() . '</b>.');
|
||||
$twig->display('success.html.twig', array(
|
||||
'title' => 'Character Information Changed',
|
||||
'description' => 'The character information has been changed.'
|
||||
));
|
||||
$show_form = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$errors[] = 'Error. Character <b>' . $player_name . '</b> is not on your account.';
|
||||
@@ -50,10 +57,10 @@ if($show_form) {
|
||||
$twig->display('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
|
||||
if(isset($player)) {
|
||||
if(isset($player) && $player->isLoaded()) {
|
||||
$twig->display('account.change_comment.html.twig', array(
|
||||
'player' => $player
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@@ -159,4 +159,3 @@ if(isset($_POST['emailchangecancel']) && $_POST['emailchangecancel'] == 1) {
|
||||
'custom_buttons' => $custom_buttons
|
||||
));
|
||||
}
|
||||
?>
|
@@ -43,6 +43,10 @@ else
|
||||
if($player->isLoaded()) {
|
||||
$player_account = $player->getAccount();
|
||||
if($account_logged->getId() == $player_account->getId()) {
|
||||
if ($player->isDeleted()) {
|
||||
$errors[] = 'This character is deleted.';
|
||||
}
|
||||
|
||||
if($player->isOnline()) {
|
||||
$errors[] = 'This character is online.';
|
||||
}
|
||||
@@ -61,7 +65,7 @@ else
|
||||
}
|
||||
}
|
||||
else {
|
||||
$errors[] = 'Character <b>' . $player_name . '</b> is not on your account.';
|
||||
$errors[] = 'Character is not on your account.';
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -82,5 +86,3 @@ else
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -23,7 +23,7 @@ else
|
||||
}
|
||||
$password_strlen = strlen($new_password);
|
||||
if($new_password != $new_password2) {
|
||||
$errors[] = "The new passwords do not match!";
|
||||
$errors[] = 'The new passwords do not match!';
|
||||
}
|
||||
|
||||
if(empty($errors)) {
|
||||
@@ -31,6 +31,7 @@ else
|
||||
$errors[] = Validator::getLastError();
|
||||
}
|
||||
|
||||
/** @var OTS_Account $account_logged */
|
||||
$old_password = encrypt(($config_salt_enabled ? $account_logged->getCustomField('salt') : '') . $old_password);
|
||||
if($old_password != $account_logged->getPassword()) {
|
||||
$errors[] = "Current password is incorrect!";
|
||||
@@ -78,6 +79,4 @@ else
|
||||
));
|
||||
setSession('password', $new_password);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
@@ -34,6 +34,10 @@ else
|
||||
$player_account = $player->getAccount();
|
||||
|
||||
if($account_logged->getId() == $player_account->getId()) {
|
||||
if ($player->isDeleted()) {
|
||||
$errors[] = 'This character is deleted.';
|
||||
}
|
||||
|
||||
if($player->isOnline()) {
|
||||
$errors[] = 'This character is online.';
|
||||
}
|
||||
@@ -64,7 +68,7 @@ else
|
||||
}
|
||||
}
|
||||
else {
|
||||
$errors[] = 'Character <b>'.$player_name.'</b> is not on your account.';
|
||||
$errors[] = 'Character is not on your account.';
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -78,11 +82,9 @@ else
|
||||
$twig->display('error_box.html.twig', array('errors' => $errors));
|
||||
}
|
||||
$twig->display('account.change_sex.html.twig', array(
|
||||
'players' => $account_logged->getPlayersList(),
|
||||
'players' => $account_logged->getPlayersList(false),
|
||||
'player_sex' => isset($player) ? $player->getSex() : -1,
|
||||
'points' => $points
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -31,6 +31,14 @@ if(isset($_POST['deletecharactersave']) && $_POST['deletecharactersave'] == 1) {
|
||||
}
|
||||
}
|
||||
|
||||
$ownerid = 'ownerid';
|
||||
if($db->hasColumn('guilds', 'owner_id'))
|
||||
$ownerid = 'owner_id';
|
||||
$guild = $db->query('SELECT `name` FROM `guilds` WHERE `' . $ownerid . '` = '.$player->getId());
|
||||
if($guild->rowCount() > 0) {
|
||||
$errors[] = 'You cannot delete a character when they own a guild.';
|
||||
}
|
||||
|
||||
if(empty($errors)) {
|
||||
//dont show table "delete character" again
|
||||
$show_form = false;
|
||||
@@ -80,4 +88,3 @@ if($show_form) {
|
||||
}
|
||||
$twig->display('account.delete_character.html.twig');
|
||||
}
|
||||
?>
|
||||
|
@@ -202,4 +202,3 @@ function getPlayerNameByAccount($id)
|
||||
|
||||
return '';
|
||||
}
|
||||
?>
|
||||
|
@@ -339,4 +339,3 @@ $showed = $post = $reply = false;
|
||||
{
|
||||
echo '<br><br><a href="?subtopic=bugtracker&control=true">[ADMIN PANEL]</a>';
|
||||
}
|
||||
?>
|
||||
|
@@ -66,4 +66,3 @@ echo '<div style="text-align:center"><h3>Experience stages</h3></div>
|
||||
</tbody></table>
|
||||
</td></tr>
|
||||
</tbody></table>';
|
||||
?>
|
||||
|
@@ -185,4 +185,3 @@ class FAQ
|
||||
return !count($errors);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user