Compare commits

..

59 Commits

Author SHA1 Message Date
slawkens
d297e434b8 Add latest clients versions 2023-08-31 14:20:39 +02:00
slawkens
c7966b7c55 Update plugins.php 2023-08-26 07:12:15 +02:00
slawkens
3e12f70861 thanks @elsongabriel, seems str_contains is not available in php 7 2023-08-26 07:11:43 +02:00
slawkens
4aede4c626 Allow hooks to be prefixed with HOOK_ 2023-08-23 11:58:14 +02:00
slawkens
57643bb4aa Patching from develop - twig context for hooks 2023-08-21 12:27:39 +02:00
slawkens
0139e4b446 Update twig.php 2023-08-21 12:20:57 +02:00
slawkens
e15b57f967 Ignore gallery 2023-08-21 09:43:44 +02:00
slawkens
30fe42939d Fix FAQ actions 2023-08-21 09:38:23 +02:00
slawkens
1f95a415aa Fix tabs 2023-08-15 22:06:09 +02:00
slawkens
370cc554ad Fix success & error class (bootstrap) 2023-08-15 22:04:43 +02:00
slawkens
2991696a60 typo 2023-08-12 13:34:53 +02:00
slawkens
a1ecdd228d Fixes in getPlayerNameByAccountId + add getPlayerNameById 2023-08-12 13:34:25 +02:00
slawkens
3dd493b790 banned_by is player_id. type = 2 is namelock in tfs 0.3 2023-08-12 13:23:53 +02:00
slawkens
cfbcabbfdb Fix accounts editor store_history column not found 2023-08-12 08:13:29 +02:00
slawkens
538723c405 Added JetBrains logo + notice, thanks for support! 2023-08-11 22:16:07 +02:00
slawkens
a70daa8830 Add version support table + fix badges 2023-08-11 22:11:10 +02:00
slawkens
d8f1bf0a50 Fix exception when monster doesn't have look defined 2023-08-11 18:52:11 +02:00
Gabriel Pedro
cfc4f3601b feat: add more tests (#229) 2023-08-11 06:40:53 +02:00
slawkens
23266e05ed Update README.md 2023-08-10 12:02:43 +02:00
slawkens
aacc120360 Remove deprecated utf8_decode 2023-08-05 20:52:01 +02:00
slawkens
757ec28028 Removed deprecated functions: utf8_encode & decode 2023-08-05 20:51:18 +02:00
slawkens
41fa695d8b Add some functions to compatibility layer of gesioraac 2023-08-05 20:50:33 +02:00
slawkens
fcb2fc3002 Add .htaccess to .gitignore 2023-08-05 11:57:27 +02:00
slawkens
53221a9fd1 There is no more info. That never worked. 2023-07-29 07:27:07 +02:00
slawkens
23047aa608 Fix multiple redirects error in browser 2023-07-22 14:46:20 +02:00
slawkens
4a629b4418 Add protection, nothing important - thrown exception before 2023-07-22 14:03:57 +02:00
slawkens
5791d1e7f9 Update template.php 2023-07-21 21:22:23 +02:00
slawkens
a9cb017def Fix menu highlighting & opening 2023-07-21 21:22:13 +02:00
slawkens
7588904372 Remove debugging var_dump 2023-07-21 16:38:10 +02:00
slawkens
5fa4890b70 Add support for menu_default_color 2023-07-21 15:54:22 +02:00
slawkens
ca56b4f101 Fix menu cannot remove 2023-07-21 15:12:07 +02:00
slawkens
848c5c0887 Change default timezone 2023-07-21 11:58:18 +02:00
slawkens
df7c82c571 Fix highscores if there is only 1 record 2023-07-19 11:57:32 +02:00
slawkens
e49690b52b Thanks @anyeor for previous fix 2023-07-13 11:03:37 +02:00
slawkens
f9d35b719b Fix: cannot create topic on this board (check wasn't working) 2023-07-11 11:17:34 +02:00
slawkens
e7e9d8e3b9 Shorten some forum code about length 2023-07-07 17:20:50 +02:00
slawkens
8cf0e80019 Forum: better error messages (Suggested by @anyeor) 2023-07-07 17:20:23 +02:00
slawkens
c392fa7272 Fix guild description on guilds page 2023-07-02 13:48:57 +02:00
slawkens
3a31a0326c Fix guild description not shown 2023-07-02 00:26:33 +02:00
slawkens
d1953470d9 Add word-break on forum thread & reply
When someone inserts long word, is will break into multiple lines
2023-06-30 19:43:31 +02:00
slawkens
5aed9ee1a4 Forum: Fix quote and edit post buttons not being shown 2023-06-30 17:30:29 +02:00
slawkens
8318169c39 Fix twig exception thrown when player does not exist 2023-06-30 17:30:01 +02:00
slawkens
ad00cf3fc3 Fix BASE_DIR when accessing /tools 2023-06-30 17:29:49 +02:00
slawkens
3ff7b21287 Move <base href> above, so it works, thanks @Leesneaks 2023-06-30 17:28:34 +02:00
slawkens
36fbae850d Revert "<base> is not working properly, use full URL instead"
This reverts commit fa015b8d39.
2023-06-30 17:28:19 +02:00
slawkens
24ff5684cd More changes to deleted characters (Account, guilds)
Account: Cannot change name, comment, gender
+ Cannot be deleted if owns a guild
Guilds: Cannot create, cannot be invited, cannot accept invite, cannot be passed leadership to
2023-06-30 17:27:31 +02:00
slawkens
aab62fb724 Important fix: Not allow create char if limit is exceeded (by @anyeor )
Could have been used to spam database, now it doesn't ignore deleted characters

He is not my brother :P Just same last name
2023-06-30 17:25:32 +02:00
slawkens
a810890614 code formatting 2023-06-30 17:25:21 +02:00
slawkens
a7dc719934 small adjustments 2023-06-25 08:54:22 +02:00
slawkens
30d62bda3b Better Gesior support 2023-06-23 21:52:11 +02:00
slawkens
cc7703766e Patching some changes from master 2023-06-19 08:05:58 +02:00
SRNT-GG
76bfab1303 WIP - Removing unneccessary closing tags to prevent potential issues. (#223)
* Part 1

Removing closing tags when no HTML or other output comes after the last PHP codeblock.

* Further removals

* nothing

---------

Co-authored-by: slawkens <slawkens@gmail.com>
2023-06-15 21:06:22 +02:00
slawkens
171c114b0f Fix links to edit/delete/hide directly from page 2023-06-11 18:57:52 +02:00
slawkens
b1d2ac34a2 Update branch name 2023-06-03 18:51:57 +02:00
slawkens
c7ce87c4b6 do not report if CI test 2 2023-06-03 18:50:43 +02:00
slawkens
4e22c42b10 test dump env 2023-06-03 18:50:34 +02:00
slawkens
eabe789bbb Disable reporting on CI 2023-06-03 18:50:22 +02:00
slawkens
5bb3e57b7b Rename to .htaccess.dist
Causes problems on default setup
2023-06-03 09:04:30 +02:00
slawkens
82092338d6 Install composer deps with --no-dev 2023-06-03 06:47:06 +02:00
152 changed files with 669 additions and 375 deletions

View File

@@ -1,9 +1,9 @@
name: Cypress name: Cypress
on: on:
pull_request: pull_request:
branches: [develop] branches: [0.9]
push: push:
branches: [develop] branches: [0.9]
jobs: jobs:
cypress: cypress:
@@ -34,7 +34,7 @@ jobs:
- name: Checkout MyAAC - name: Checkout MyAAC
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
ref: develop ref: 0.9
- name: Checkout TFS - name: Checkout TFS
uses: actions/checkout@v3 uses: actions/checkout@v3

9
.gitignore vendored
View File

@@ -2,6 +2,9 @@ Thumbs.db
.DS_Store .DS_Store
.idea .idea
#
/.htaccess
# composer # composer
composer.lock composer.lock
vendor vendor
@@ -32,6 +35,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

View File

@@ -1,23 +1,29 @@
# [MyAAC](https://my-aac.org) # [MyAAC](https://my-aac.org)
[![Build Status Master](https://img.shields.io/travis/slawkens/myaac/master)](https://travis-ci.org/github/slawkens/myaac)
[![License: GPL-3.0](https://img.shields.io/github/license/slawkens/myaac)](https://opensource.org/licenses/gpl-license)
[![Downloads Count](https://img.shields.io/github/downloads/slawkens/myaac/total)](https://github.com/slawkens/myaac/releases)
[![PHP Versions](https://img.shields.io/travis/php-v/slawkens/myaac/master)](https://github.com/slawkens/myaac/blob/d8b3b4135827ee17e3c6d41f08a925e718c587ed/.travis.yml#L3)
[![OpenTibia Discord](https://img.shields.io/discord/288399552581468162)](https://discord.gg/2J39Wus)
[![Closed Issues](https://img.shields.io/github/issues-closed-raw/slawkens/myaac)](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
[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/slawkens/myaac/cypress.yml)](https://github.com/slawkens/myaac/actions)
[![License: GPL-3.0](https://img.shields.io/github/license/slawkens/myaac)](https://opensource.org/licenses/gpl-license)
[![Downloads Count](https://img.shields.io/github/downloads/slawkens/myaac/total)](https://github.com/slawkens/myaac/releases)
[![OpenTibia Discord](https://img.shields.io/discord/288399552581468162)](https://discord.gg/2J39Wus)
[![Closed Issues](https://img.shields.io/github/issues-closed-raw/slawkens/myaac)](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 ### Requirements
- PHP 5.6 or later - PHP 7.2.5 or later
- MySQL database - MySQL database
- PDO PHP Extension - PDO PHP Extension
- XML PHP Extension - XML PHP Extension
- ZIP PHP Extension - (optional) ZIP PHP Extension
- (optional) mod_rewrite to use friendly_urls - (optional) mod_rewrite to use friendly_urls
### Installation ### Installation
@@ -71,7 +77,13 @@ Look: [Contributing](https://github.com/otsoft/myaac/wiki/Contributing) in our w
### Other Notes ### Other Notes
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.
[![JetBrains](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/?from=https://github.com/slawkens)
### License ### License

View File

@@ -1 +1,2 @@
<?php <?php
// nothing yet here

View File

@@ -272,7 +272,7 @@ else if (isset($_REQUEST['search'])) {
</li> </li>
<?php endif; <?php endif;
if ($db->hasTable('store_history')) : ?> if ($db->hasTable('store_history') && $db->hasColumn('store_history', 'time')) : ?>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" id="accounts-store-tab" data-toggle="pill" href="#accounts-store">Store History</a> <a class="nav-link" id="accounts-store-tab" data-toggle="pill" href="#accounts-store">Store History</a>
</li> </li>
@@ -523,7 +523,7 @@ else if (isset($_REQUEST['search'])) {
} ?> } ?>
</div> </div>
<?php endif; <?php endif;
if ($db->hasTable('store_history')) { ?> if ($db->hasTable('store_history') && $db->hasColumn('store_history', 'time')) { ?>
<div class="tab-pane fade" id="accounts-store"> <div class="tab-pane fade" id="accounts-store">
<?php $store_history = $db->query('SELECT * FROM `store_history` WHERE `account_id` = "' . $account->getId() . '" ORDER BY `time` DESC')->fetchAll(); ?> <?php $store_history = $db->query('SELECT * FROM `store_history` WHERE `account_id` = "' . $account->getId() . '" ORDER BY `time` DESC')->fetchAll(); ?>
<table class="table table-striped table-condensed table-responsive d-md-table"> <table class="table table-striped table-condensed table-responsive d-md-table">

View File

@@ -12,7 +12,7 @@ $title = 'Login';
require PAGES . 'account/login.php'; require PAGES . 'account/login.php';
if ($logged) { if ($logged) {
header('Location: ' . ADMIN_URL); header('Location: ' . (admin() ? ADMIN_URL : BASE_URL));
return; return;
} }

View File

@@ -46,6 +46,7 @@ if (isset($_REQUEST['template'])) {
if ($cache->enabled()) { if ($cache->enabled()) {
$cache->delete('template_menus'); $cache->delete('template_menus');
} }
success('Saved at ' . date('H:i')); success('Saved at ' . date('H:i'));
} }
@@ -56,6 +57,7 @@ if (isset($_REQUEST['template'])) {
echo 'Cannot find template config.php file.'; echo 'Cannot find template config.php file.';
return; return;
} }
if (!isset($config['menu_categories'])) { if (!isset($config['menu_categories'])) {
echo "No menu categories set in template config.php.<br/>This template doesn't support dynamic menus."; echo "No menu categories set in template config.php.<br/>This template doesn't support dynamic menus.";
return; return;
@@ -91,15 +93,16 @@ if (isset($_REQUEST['template'])) {
<ul class="sortable" id="sortable-<?php echo $id ?>"> <ul class="sortable" id="sortable-<?php echo $id ?>">
<?php <?php
if (isset($menus[$id])) { if (isset($menus[$id])) {
foreach ($menus[$id] as $i => $menu): $i = 0;
foreach ($menus[$id] as $menu):
?> ?>
<li class="ui-state-default" id="list-<?php echo $id ?>-<?php echo $i ?>"><label>Name:</label> <input type="text" name="menu[<?php echo $id ?>][]" value="<?php echo escapeHtml($menu['name']); ?>"/> <li class="ui-state-default" id="list-<?php echo $id ?>-<?php echo $i ?>"><label>Name:</label> <input type="text" name="menu[<?php echo $id ?>][]" value="<?php echo escapeHtml($menu['name']); ?>"/>
<label>Link:</label> <input type="text" name="menu_link[<?php echo $id ?>][]" value="<?php echo $menu['link'] ?>"/> <label>Link:</label> <input type="text" name="menu_link[<?php echo $id ?>][]" value="<?php echo $menu['link'] ?>"/>
<input type="hidden" name="menu_blank[<?php echo $id ?>][]" value="0"/> <input type="hidden" name="menu_blank[<?php echo $id ?>][]" value="0"/>
<label><input class="blank-checkbox" type="checkbox" <?php echo($menu['blank'] == 1 ? 'checked' : '') ?>/><span title="Open in New Window">New Window</span></label> <label><input class="blank-checkbox" type="checkbox" <?php echo($menu['blank'] == 1 ? 'checked' : '') ?>/><span title="Open in New Window">New Window</span></label>
<input class="color-picker" type="text" name="menu_color[<?php echo $id ?>][]" value="#<?php echo $menu['color'] ?>"/> <input class="color-picker" type="text" name="menu_color[<?php echo $id ?>][]" value="<?php echo (empty($menu['color']) ? ($config['menu_default_color'] ?? '#ffffff') : $menu['color']); ?>"/>
<a class="remove-button" id="remove-button-<?php echo $id ?>-<?php echo $i ?>"><i class="fas fa-trash"></a></i></li> <a class="remove-button" id="remove-button-<?php echo $id ?>-<?php echo $i ?>"><i class="fas fa-trash"></a></i></li>
<?php $last_id[$id] = $i; <?php $i++; $last_id[$id] = $i;
endforeach; endforeach;
} ?> } ?>
</ul> </ul>
@@ -120,7 +123,8 @@ if (isset($_REQUEST['template'])) {
<?php <?php
$twig->display('admin.menus.js.html.twig', array( $twig->display('admin.menus.js.html.twig', array(
'menus' => $menus, 'menus' => $menus,
'last_id' => $last_id 'last_id' => $last_id,
'menu_default_color' => $config['menu_default_color'] ?? '#ffffff'
)); ));
?> ?>
<?php <?php

View File

@@ -1,4 +1,6 @@
<?php <?php
defined('MYAAC') or die('Direct access not allowed!');
$balance = ($db->hasColumn('players', 'balance') ? $db->query('SELECT `balance`, `id`, `name`,`level` FROM `players` ORDER BY `balance` DESC LIMIT 10;') : 0); $balance = ($db->hasColumn('players', 'balance') ? $db->query('SELECT `balance`, `id`, `name`,`level` FROM `players` ORDER BY `balance` DESC LIMIT 10;') : 0);
$twig->display('balance.html.twig', array( $twig->display('balance.html.twig', array(

View File

@@ -1,4 +1,6 @@
<?php <?php
defined('MYAAC') or die('Direct access not allowed!');
$coins = ($db->hasColumn('accounts', 'coins') ? $db->query('SELECT `coins`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `coins` DESC LIMIT 10;') : 0); $coins = ($db->hasColumn('accounts', 'coins') ? $db->query('SELECT `coins`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `coins` DESC LIMIT 10;') : 0);
$twig->display('coins.html.twig', array( $twig->display('coins.html.twig', array(

View File

@@ -1,4 +1,6 @@
<?php <?php
defined('MYAAC') or die('Direct access not allowed!');
$players = ($db->hasColumn('accounts', 'created') ? $db->query('SELECT `created`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `created` DESC LIMIT 10;') : 0); $players = ($db->hasColumn('accounts', 'created') ? $db->query('SELECT `created`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `created` DESC LIMIT 10;') : 0);
$twig->display('created.html.twig', array( $twig->display('created.html.twig', array(

View File

@@ -1,4 +1,6 @@
<?php <?php
defined('MYAAC') or die('Direct access not allowed!');
$players = ($db->hasColumn('players', 'lastlogin') ? $db->query('SELECT name, level, lastlogin FROM players ORDER BY lastlogin DESC LIMIT 10;') : 0); $players = ($db->hasColumn('players', 'lastlogin') ? $db->query('SELECT name, level, lastlogin FROM players ORDER BY lastlogin DESC LIMIT 10;') : 0);
$twig->display('lastlogin.html.twig', array( $twig->display('lastlogin.html.twig', array(
'players' => $players, 'players' => $players,

View File

@@ -1,4 +1,6 @@
<?php <?php
defined('MYAAC') or die('Direct access not allowed!');
$points = ($db->hasColumn('accounts', 'premium_points') ? $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;') : 0); $points = ($db->hasColumn('accounts', 'premium_points') ? $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;') : 0);
$twig->display('points.html.twig', array( $twig->display('points.html.twig', array(

View File

@@ -258,5 +258,3 @@ class Pages
return !count($errors); return !count($errors);
} }
} }
?>

View File

@@ -36,4 +36,3 @@ $twig->display('admin.statistics.html.twig', array(
'account_type' => (USE_ACCOUNT_NAME ? 'name' : 'number'), 'account_type' => (USE_ACCOUNT_NAME ? 'name' : 'number'),
'points' => $points 'points' => $points
)); ));
?>

View File

@@ -47,4 +47,3 @@ function version_revert($version)
$release = $version; $release = $version;
return $major . '.' . $minor . '.' . $release; return $major . '.' . $minor . '.' . $release;
}*/ }*/
?>

View File

@@ -68,7 +68,7 @@
if (!$has_child) { ?> if (!$has_child) { ?>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link<?php echo(strpos($menu['link'], $page) !== false ? ' active' : '') ?>" href="?p=<?php echo $menu['link'] ?>"> <a class="nav-link<?php echo(strpos($menu['link'], $page) !== false ? ' active' : '') ?>" href="?p=<?php echo $menu['link'] ?>">
<i class="nav-icon fas fa-<?php echo(isset($menu['icon']) ? $menu['icon'] : 'link') ?>"></i> <i class="nav-icon fas fa-<?php echo($menu['icon'] ?? 'link') ?>"></i>
<p><?php echo $menu['name'] ?></p> <p><?php echo $menu['name'] ?></p>
</a> </a>
</li> </li>
@@ -76,9 +76,9 @@
} else if ($has_child) { } else if ($has_child) {
$used_menu = null; $used_menu = null;
$nav_construct = ''; $nav_construct = '';
foreach ($menu['link'] as $category => $sub_menu) { foreach ($menu['link'] as $sub_category => $sub_menu) {
$nav_construct .= '<li class="nav-item"><a href="?p=' . $sub_menu['link'] . '" class="nav-link'; $nav_construct .= '<li class="nav-item"><a href="?p=' . $sub_menu['link'] . '" class="nav-link';
if ($page == $sub_menu['link']) { if ($_SERVER['QUERY_STRING'] == 'p=' . $sub_menu['link']) {
$nav_construct .= ' active'; $nav_construct .= ' active';
$used_menu = true; $used_menu = true;
} }

View File

@@ -13,4 +13,3 @@ if(!function_exists('phpinfo'))
die('phpinfo() disabled on this web server.'); die('phpinfo() disabled on this web server.');
phpinfo(); phpinfo();
?>

View File

@@ -0,0 +1,174 @@
describe('Check Public Pages', () => {
/// news
it('Go to news page', () => {
cy.visit({
url: Cypress.env('URL') + '/news',
method: 'GET',
})
})
it('Go to news archive page', () => {
cy.visit({
url: Cypress.env('URL') + '/news/archive',
method: 'GET',
})
})
it('Go to changelog page', () => {
cy.visit({
url: Cypress.env('URL') + '/changelog',
method: 'GET',
})
})
/// account management
it('Go to account manage page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/manage',
method: 'GET',
})
})
it('Go to account create page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/create',
method: 'GET',
})
})
it('Go to account lost page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/lost',
method: 'GET',
})
})
it('Go to rules page', () => {
cy.visit({
url: Cypress.env('URL') + '/rules',
method: 'GET',
})
})
// community
it('Go to online page', () => {
cy.visit({
url: Cypress.env('URL') + '/online',
method: 'GET',
})
})
it('Go to characters list page', () => {
cy.visit({
url: Cypress.env('URL') + '/characters',
method: 'GET',
})
})
it('Go to guilds page', () => {
cy.visit({
url: Cypress.env('URL') + '/guilds',
method: 'GET',
})
})
it('Go to highscores page', () => {
cy.visit({
url: Cypress.env('URL') + '/highscores',
method: 'GET',
})
})
it('Go to last kills page', () => {
cy.visit({
url: Cypress.env('URL') + '/lastkills',
method: 'GET',
})
})
it('Go to houses page', () => {
cy.visit({
url: Cypress.env('URL') + '/houses',
method: 'GET',
})
})
it('Go to bans page', () => {
cy.visit({
url: Cypress.env('URL') + '/bans',
method: 'GET',
})
})
it('Go to forum page', () => {
cy.visit({
url: Cypress.env('URL') + '/forum',
method: 'GET',
})
})
it('Go to team page', () => {
cy.visit({
url: Cypress.env('URL') + '/team',
method: 'GET',
})
})
// library
it('Go to creatures page', () => {
cy.visit({
url: Cypress.env('URL') + '/creatures',
method: 'GET',
})
})
it('Go to spells page', () => {
cy.visit({
url: Cypress.env('URL') + '/spells',
method: 'GET',
})
})
it('Go to server info page', () => {
cy.visit({
url: Cypress.env('URL') + '/serverInfo',
method: 'GET',
})
})
it('Go to commands page', () => {
cy.visit({
url: Cypress.env('URL') + '/commands',
method: 'GET',
})
})
it('Go to downloads page', () => {
cy.visit({
url: Cypress.env('URL') + '/downloads',
method: 'GET',
})
})
it('Go to gallery page', () => {
cy.visit({
url: Cypress.env('URL') + '/gallery',
method: 'GET',
})
})
it('Go to experience table page', () => {
cy.visit({
url: Cypress.env('URL') + '/experienceTable',
method: 'GET',
})
})
it('Go to faq page', () => {
cy.visit({
url: Cypress.env('URL') + '/faq',
method: 'GET',
})
})
})

View File

@@ -0,0 +1,81 @@
const REQUIRED_LOGIN_MESSAGE = 'Please enter your account name and your password.';
const YOU_ARE_NOT_LOGGEDIN = 'You are not logged in.';
describe('Check Protected Pages', () => {
// character actions
it('Go to accouht character creation page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/character/create',
method: 'GET',
})
cy.contains(REQUIRED_LOGIN_MESSAGE)
})
it('Go to accouht character deletion page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/character/delete',
method: 'GET',
})
cy.contains(REQUIRED_LOGIN_MESSAGE)
})
// account actions
it('Go to accouht email change page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/email',
method: 'GET',
})
cy.contains(REQUIRED_LOGIN_MESSAGE)
})
it('Go to accouht password change page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/password',
method: 'GET',
})
cy.contains(REQUIRED_LOGIN_MESSAGE)
})
it('Go to accouht info change page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/info',
method: 'GET',
})
cy.contains(REQUIRED_LOGIN_MESSAGE)
})
it('Go to accouht logout change page', () => {
cy.visit({
url: Cypress.env('URL') + '/account/logout',
method: 'GET',
})
cy.contains(REQUIRED_LOGIN_MESSAGE)
})
// guild actions
it('Go to guild creation page', () => {
cy.visit({
url: Cypress.env('URL') + '/?subtopic=guilds&action=create',
method: 'GET',
})
cy.contains(YOU_ARE_NOT_LOGGEDIN)
})
it('Go to guilds cleanup players action page', () => {
cy.visit({
url: Cypress.env('URL') + '/?subtopic=guilds&action=cleanup_players',
method: 'GET',
})
cy.contains(YOU_ARE_NOT_LOGGEDIN)
})
it('Go to guilds cleanup guilds action page', () => {
cy.visit({
url: Cypress.env('URL') + '/?subtopic=guilds&action=cleanup_guilds',
method: 'GET',
})
cy.contains(YOU_ARE_NOT_LOGGEDIN)
})
})

View File

View File

@@ -166,6 +166,7 @@ if($config['backward_support']) {
$config['site'] = &$config; $config['site'] = &$config;
$config['server'] = &$config['lua']; $config['server'] = &$config['lua'];
$config['site']['shop_system'] = $config['gifts_system']; $config['site']['shop_system'] = $config['gifts_system'];
$config['site']['gallery_page'] = true;
if(!isset($config['vdarkborder'])) if(!isset($config['vdarkborder']))
$config['vdarkborder'] = '#505050'; $config['vdarkborder'] = '#505050';

View File

@@ -38,4 +38,3 @@ if(!isset($error) || !$error) {
$error = true; $error = true;
} }
} }
?>

View File

@@ -5,4 +5,3 @@ $twig->display('install.license.html.twig', array(
'license' => file_get_contents(BASE . 'LICENSE'), 'license' => file_get_contents(BASE . 'LICENSE'),
'buttons' => next_buttons() 'buttons' => next_buttons()
)); ));
?>

View File

@@ -18,4 +18,3 @@ $twig->display('install.config.html.twig', array(
'errors' => isset($errors) ? $errors : null, 'errors' => isset($errors) ? $errors : null,
'buttons' => next_buttons() 'buttons' => next_buttons()
)); ));
?>

View File

@@ -122,18 +122,21 @@ else {
)); ));
if(!isset($_SESSION['installed'])) { if(!isset($_SESSION['installed'])) {
$report_url = 'https://my-aac.org/report_install.php?v=' . MYAAC_VERSION . '&b=' . urlencode(BASE_URL); if (!array_key_exists('CI', getenv())) {
if (function_exists('curl_version')) $report_url = 'https://my-aac.org/report_install.php?v=' . MYAAC_VERSION . '&b=' . urlencode(BASE_URL);
{ if (function_exists('curl_version'))
$curl = curl_init(); {
curl_setopt($curl, CURLOPT_URL, $report_url); $curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_URL, $report_url);
curl_exec($curl); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_close($curl); curl_exec($curl);
} curl_close($curl);
else if (ini_get('allow_url_fopen') ) { }
file_get_contents($report_url); else if (ini_get('allow_url_fopen') ) {
file_get_contents($report_url);
}
} }
$_SESSION['installed'] = true; $_SESSION['installed'] = true;
} }

View File

@@ -32,6 +32,6 @@ server {
include snippets/fastcgi-php.conf; include snippets/fastcgi-php.conf;
fastcgi_read_timeout 240; fastcgi_read_timeout 240;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; 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
} }
} }

View File

@@ -1,4 +1,7 @@
{ {
"scripts": {
"cypress:open": "cypress open"
},
"devDependencies": { "devDependencies": {
"cypress": "^12.12.0" "cypress": "^12.12.0"
} }

View File

@@ -38,7 +38,7 @@ if [ $1 = "prepare" ]; then
cd $dir || exit cd $dir || exit
# dependencies # dependencies
composer install composer install --no-dev
echo "Now you can make changes to $dir. When you are ready, type 'release.sh pack'" echo "Now you can make changes to $dir. When you are ready, type 'release.sh pack'"
exit exit

View File

@@ -99,4 +99,10 @@ $config['clients'] = [
1291, 1291,
1300, 1300,
1310,
1311,
1312,
1316,
1320,
1321,
]; ];

View File

@@ -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 {}

View File

@@ -10,6 +10,10 @@
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
switch($page) switch($page)
{ {
case 'adminpanel':
header('Location: ' . ADMIN_URL);
die;
case 'createaccount': case 'createaccount':
$page = 'account/create'; $page = 'account/create';
break; break;
@@ -30,6 +34,7 @@ switch($page)
$page = 'news'; $page = 'news';
break; break;
case 'archive':
case 'newsarchive': case 'newsarchive':
$page = 'news/archive'; $page = 'news/archive';
break; break;

View File

@@ -51,4 +51,3 @@ else
updateDatabaseConfig('views_counter', $views_counter); // update counter updateDatabaseConfig('views_counter', $views_counter); // update counter
} }
} }
?>

View File

@@ -929,8 +929,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();
@@ -1362,39 +1362,48 @@ function getChangelogWhere($v)
return 'unknown'; return 'unknown';
} }
function getPlayerNameByAccount($id)
function getPlayerNameByAccountId($id)
{ {
global $vowels, $ots, $db; global $db;
if(is_numeric($id))
{
$player = new OTS_Player();
$player->load($id);
if($player->isLoaded())
return $player->getName();
else
{
$playerQuery = $db->query('SELECT `id` FROM `players` WHERE `account_id` = ' . $id . ' ORDER BY `lastlogin` DESC LIMIT 1;')->fetch();
$tmp = "*Error*"; if (!is_numeric($id)) {
/* return '';
$acco = new OTS_Account(); }
$acco->load($id);
if(!$acco->isLoaded())
return "Unknown name";
foreach($acco->getPlayersList() as $p) $account = new OTS_Account();
{ $account->load($id);
$player= new OTS_Player(); if ($account->isLoaded()) {
$player->find($p);*/ $query = $db->query('SELECT `name` FROM `players` WHERE `account_id` = ' . $id . ' ORDER BY `lastlogin` DESC LIMIT 1;');
$player->load($playerQuery['id']);
//echo 'id gracza = ' . $p . '<br/>';
if($player->isLoaded())
$tmp = $player->getName();
// break;
//}
return $tmp; if (!$query || !$query->rowCount()) {
return '';
} }
return $query->fetch(PDO::FETCH_ASSOC)['name'];
}
return '';
}
function getPlayerNameByAccount($account) {
if (is_numeric($account)) {
return getPlayerNameByAccountId($account);
}
return '';
}
function getPlayerNameById($id)
{
if (!is_numeric($id)) {
return '';
}
$player = new OTS_Player();
$player->load($id);
if ($player->isLoaded()) {
return $player->getName();
} }
return ''; return '';
@@ -1402,13 +1411,13 @@ function getPlayerNameByAccount($id)
function echo_success($message) function echo_success($message)
{ {
echo '<div class="col-12 success mb-2">' . $message . '</div>'; echo '<div class="col-12 alert alert-success mb-2">' . $message . '</div>';
} }
function echo_error($message) function echo_error($message)
{ {
global $error; global $error;
echo '<div class="col-12 error mb-2">' . $message . '</div>'; echo '<div class="col-12 alert alert-error mb-2">' . $message . '</div>';
$error = true; $error = true;
} }
@@ -1580,6 +1589,14 @@ function getGuildLogoById($id)
return BASE_URL . GUILD_IMAGES_DIR . $logo; return BASE_URL . GUILD_IMAGES_DIR . $logo;
} }
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('')
]);
}
// validator functions // validator functions
require_once LIBS . 'validator.php'; require_once LIBS . 'validator.php';
require_once SYSTEM . 'compat/base.php'; require_once SYSTEM . 'compat/base.php';

View File

@@ -122,7 +122,7 @@ if(!isset($foundValue)) {
$config['data_path'] = $foundValue; $config['data_path'] = $foundValue;
unset($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) { if(!isset($config['highscores_ids_hidden']) || count($config['highscores_ids_hidden']) == 0) {
$config['highscores_ids_hidden'] = array(0); $config['highscores_ids_hidden'] = array(0);
} }

View File

@@ -58,4 +58,3 @@ function outputItem($id = 100, $count = 1)
$file_name = Items_Images::$outputDir . $file_name . '.gif'; $file_name = Items_Images::$outputDir . $file_name . '.gif';
readfile($file_name); readfile($file_name);
} }
?>

View File

@@ -138,7 +138,7 @@ class CreateCharacter
if(empty($errors)) 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')) 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>!'; $errors[] = 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.config('characters_per_account').')</b>!';
} }

View File

@@ -41,4 +41,3 @@ class Data
return $db->update($this->table, $data, $where); return $db->update($this->table, $data, $where);
} }
} }
?>

View File

@@ -151,6 +151,10 @@ class Plugins {
foreach(self::getAllPluginsJson() as $plugin) { foreach(self::getAllPluginsJson() as $plugin) {
if (isset($plugin['hooks'])) { if (isset($plugin['hooks'])) {
foreach ($plugin['hooks'] as $_name => $info) { foreach ($plugin['hooks'] as $_name => $info) {
if (strpos($info['type'], 'HOOK_') !== false) {
$info['type'] = str_replace('HOOK_', '', $info['type']);
}
if (defined('HOOK_'. $info['type'])) { if (defined('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']];

View File

@@ -32,5 +32,3 @@ class E_OTS_ErrorCode extends Exception
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -36,5 +36,3 @@ class E_OTS_Generic extends E_OTS_ErrorCode
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -22,5 +22,3 @@ class E_OTS_NotAContainer extends Exception
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -32,5 +32,3 @@ class E_OTS_OTBMError extends E_OTS_ErrorCode
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -22,5 +22,3 @@ class E_OTS_ReadOnly extends Exception
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -37,5 +37,3 @@ interface IOTS_Cipher
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -89,5 +89,3 @@ interface IOTS_DataDisplay
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -96,5 +96,3 @@ interface IOTS_Display
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -67,5 +67,3 @@ interface IOTS_GuildAction
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -994,7 +994,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
$access = 0; $access = 0;
// finds ranks of all characters // finds ranks of all characters
foreach($this->getPlayersList() as $player) foreach($this->getPlayersList(false) as $player)
{ {
$rank = $player->getRank(); $rank = $player->getRank();
@@ -1198,5 +1198,3 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -34,5 +34,3 @@ class OTS_AccountBans_List extends OTS_Bans_List
$this->setFilter($filter); $this->setFilter($filter);
} }
} }
?>

View File

@@ -735,5 +735,3 @@ class OTS_Admin
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -100,5 +100,3 @@ class OTS_Bans_List extends OTS_Base_List
} }
} }
} }
?>

View File

@@ -265,5 +265,3 @@ abstract class OTS_Base_DB extends PDO implements IOTS_DB
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -146,5 +146,3 @@ class OTS_BinaryTools
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -149,5 +149,3 @@ class OTS_Container extends OTS_Item implements IteratorAggregate
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -357,5 +357,3 @@ class OTS_FileLoader
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -671,5 +671,3 @@ class OTS_Group extends OTS_Row_DAO implements IteratorAggregate, Countable
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -837,5 +837,3 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -72,5 +72,3 @@ class OTS_GuildRanks_List extends OTS_Base_List
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -529,5 +529,3 @@ class OTS_House extends OTS_Row_DAO
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -34,5 +34,3 @@ class OTS_IPBans_List extends OTS_Bans_List
$this->setFilter($filter); $this->setFilter($filter);
} }
} }
?>

View File

@@ -387,5 +387,3 @@ class OTS_InfoRespond extends DOMDocument
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -676,5 +676,3 @@ class OTS_ItemsList extends OTS_FileLoader implements IteratorAggregate, Countab
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -130,5 +130,3 @@ class OTS_MapCoords
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -276,7 +276,7 @@ class OTS_Monster extends DOMDocument
/** /**
* Returns look of the monster. * Returns look of the monster.
* *
* @return array Look with all the attributes of the look. * @return array Look with all the attributes of the look.
* @throws DOMException On DOM operation error. * @throws DOMException On DOM operation error.
*/ */
@@ -286,6 +286,10 @@ class OTS_Monster extends DOMDocument
$element = $this->documentElement->getElementsByTagName('look')->item(0); $element = $this->documentElement->getElementsByTagName('look')->item(0);
if (!$element) {
return $look;
}
$look['type'] = $element->getAttribute('type'); $look['type'] = $element->getAttribute('type');
$look['typeex'] = $element->getAttribute('typeex'); $look['typeex'] = $element->getAttribute('typeex');
$look['head'] = $element->getAttribute('head'); $look['head'] = $element->getAttribute('head');

View File

@@ -299,5 +299,3 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -3627,5 +3627,3 @@ class OTS_Player extends OTS_Row_DAO
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -34,5 +34,3 @@ class OTS_PlayerBans_List extends OTS_Bans_List
$this->setFilter($filter); $this->setFilter($filter);
} }
} }
?>

View File

@@ -75,5 +75,3 @@ abstract class OTS_Row_DAO extends OTS_Base_DAO
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -121,5 +121,3 @@ class OTS_SQLField
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -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;
@@ -227,5 +227,3 @@ class OTS_ServerInfo
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -482,5 +482,3 @@ class OTS_Spell
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -113,5 +113,3 @@ class OTS_Toolbox
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -151,5 +151,3 @@ class OTS_XTEA implements IOTS_Cipher
} }
/**#@-*/ /**#@-*/
?>

View File

@@ -282,4 +282,3 @@ class TokenAuth6238 {
return $result; return $result;
} }
} }
?>

View File

@@ -451,4 +451,3 @@ class Validator
return self::$lastError; return self::$lastError;
} }
} }
?>

View File

@@ -6,4 +6,3 @@
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
*/ */
$locale['title'] = 'MyAAC Admin'; $locale['title'] = 'MyAAC Admin';
?>

View File

@@ -11,5 +11,4 @@ $locale['encoding'] = 'utf-8';
$locale['direction']= 'ltr'; $locale['direction']= 'ltr';
$locale['error404'] = 'Diese Seite konnte nicht gefunden werden.'; $locale['error404'] = 'Diese Seite konnte nicht gefunden werden.';
$locale['news'] = 'Neuesten Nachrichten'; $locale['news'] = 'Neuesten Nachrichten';
?>

View File

@@ -131,4 +131,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/> $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/> <span style="color: red">Please delete install/ directory.</span><br/><br/>
Post bugs and suggestions at $LINK$, thanks!'; Post bugs and suggestions at $LINK$, thanks!';
?>

View File

@@ -6,4 +6,3 @@
* @author Slawkens <slawkens@gmail.com> * @author Slawkens <slawkens@gmail.com>
*/ */
$locale['title'] = 'MyAAC Admin'; $locale['title'] = 'MyAAC Admin';
?>

View File

@@ -12,4 +12,4 @@ $locale['direction']= 'ltr';
$locale['error404'] = 'Strona nie została odnaleziona.'; $locale['error404'] = 'Strona nie została odnaleziona.';
$locale['news'] = 'Ostatnie newsy'; $locale['news'] = 'Ostatnie newsy';
$locale['loaded_in_ms'] = 'w $TIME$ ms'; $locale['loaded_in_ms'] = 'w $TIME$ ms';

View File

@@ -118,4 +118,3 @@ $locale['step_finish'] = 'Finalizar';
$locale['step_finish_title'] = 'Instalação terminada!'; $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/> $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!'; <span style = "color: red">Por favor remova a pasta install/.</span><br/><br/>Postar bugs e sugestões em $LINK$, obrigado!';
?>

View File

@@ -6,4 +6,3 @@
* @author Sizaro <sizaro@live.se> * @author Sizaro <sizaro@live.se>
*/ */
$locale['title'] = 'MyAAC Admin'; $locale['title'] = 'MyAAC Admin';
?>

View File

@@ -12,4 +12,3 @@ $locale['direction']= 'ltr';
$locale['error404'] = 'Sidan kunde inte hittas.'; $locale['error404'] = 'Sidan kunde inte hittas.';
$locale['news'] = 'Senaste nyheterna'; $locale['news'] = 'Senaste nyheterna';
?>

View File

@@ -10,12 +10,12 @@
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$logged = false; $logged = false;
$logged_flags = 0; $logged_flags = 0;
$account_logged = new OTS_Account();
// stay-logged with sessions // stay-logged with sessions
$current_session = getSession('account'); $current_session = getSession('account');
if($current_session !== false) if($current_session !== false)
{ {
$account_logged = new OTS_Account();
$account_logged->load($current_session); $account_logged->load($current_session);
if($account_logged->isLoaded() && $account_logged->getPassword() == getSession('password') if($account_logged->isLoaded() && $account_logged->getPassword() == getSession('password')
//&& (!isset($_SESSION['admin']) || admin()) //&& (!isset($_SESSION['admin']) || admin())

View File

@@ -17,4 +17,3 @@
'thumb' => str_replace('/screenshots/', '/gallery/', $item['thumb']), 'thumb' => str_replace('/screenshots/', '/gallery/', $item['thumb']),
), array('id' => $item['id'])); ), array('id' => $item['id']));
} }
?>

View File

@@ -1,4 +1,3 @@
<?php <?php
if($db->hasColumn(TABLE_PREFIX . 'spells', 'spell')) 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`;");
?>

View File

@@ -8,4 +8,3 @@ if(!$db->hasColumn(TABLE_PREFIX . 'forum_boards', 'guild')) {
if(!$db->hasColumn(TABLE_PREFIX . 'forum_boards', 'access')) { 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`;"); $db->query("ALTER TABLE `" . TABLE_PREFIX . "forum_boards` ADD `access` TINYINT(1) NOT NULL DEFAULT 0 AFTER `guild`;");
} }
?>

View File

@@ -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); INSERT INTO `myaac_menu` (`template`, `name`, `link`, `category`, `ordering`) VALUES ('tibiacom', 'Shop History', 'gifts/history', 6, 2);
"); ");
} }
?>

View File

@@ -1,3 +1,2 @@
<?php <?php
// this migration has been removed, but file kept for compability // this migration has been removed, but file kept for compatibility
?>

View File

@@ -3,4 +3,3 @@
$db->query("ALTER TABLE `" . TABLE_PREFIX . "movies` MODIFY `title` VARCHAR(100) NOT NULL DEFAULT '';"); $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 `title` VARCHAR(100) NOT NULL DEFAULT '';");
$db->query("ALTER TABLE `" . TABLE_PREFIX . "news` MODIFY `body` TEXT NOT NULL DEFAULT '';"); $db->query("ALTER TABLE `" . TABLE_PREFIX . "news` MODIFY `body` TEXT NOT NULL DEFAULT '';");
?>

View File

@@ -45,4 +45,3 @@ function databaseMigration20(&$content = '') {
file_put_contents($config_file, $content, FILE_APPEND); file_put_contents($config_file, $content, FILE_APPEND);
return true; return true;
} }
?>

View File

@@ -1,4 +1,3 @@
<?php <?php
if(!$db->hasColumn(TABLE_PREFIX . 'monsters', 'id')) 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;");
?>

View File

@@ -1,4 +1,3 @@
<?php <?php
if(!$db->hasColumn(TABLE_PREFIX . 'hooks', 'enabled')) 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;");
?>

View File

@@ -14,5 +14,4 @@
foreach($boards as $id => $board) foreach($boards as $id => $board)
$db->query('UPDATE `' . TABLE_PREFIX . 'forum_boards` SET `ordering` = ' . $id . ' WHERE `name` = ' . $db->quote($board)); $db->query('UPDATE `' . TABLE_PREFIX . 'forum_boards` SET `ordering` = ' . $id . ' WHERE `name` = ' . $db->quote($board));
} }
?>

View File

@@ -28,15 +28,22 @@ if($player_name != null) {
if ($player->isLoaded()) { if ($player->isLoaded()) {
$player_account = $player->getAccount(); $player_account = $player->getAccount();
if ($account_logged->getId() == $player_account->getId()) { if ($account_logged->getId() == $player_account->getId()) {
if ($player->isDeleted()) {
$errors[] = 'This character is deleted.';
$player = null;
}
if (isset($_POST['changecommentsave']) && $_POST['changecommentsave'] == 1) { if (isset($_POST['changecommentsave']) && $_POST['changecommentsave'] == 1) {
$player->setCustomField("hidden", $new_hideacc); if(empty($errors)) {
$player->setCustomField("comment", $new_comment); $player->setCustomField("hidden", $new_hideacc);
$account_logged->logAction('Changed comment for character <b>' . $player->getName() . '</b>.'); $player->setCustomField("comment", $new_comment);
$twig->display('success.html.twig', array( $account_logged->logAction('Changed comment for character <b>' . $player->getName() . '</b>.');
'title' => 'Character Information Changed', $twig->display('success.html.twig', array(
'description' => 'The character information has been changed.' 'title' => 'Character Information Changed',
)); 'description' => 'The character information has been changed.'
$show_form = false; ));
$show_form = false;
}
} }
} else { } else {
$errors[] = 'Error. Character <b>' . $player_name . '</b> is not on your account.'; $errors[] = 'Error. Character <b>' . $player_name . '</b> is not on your account.';
@@ -57,7 +64,7 @@ if($show_form) {
$twig->display('error_box.html.twig', array('errors' => $errors)); $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( $twig->display('account.change_comment.html.twig', array(
'player' => $player 'player' => $player
)); ));

View File

@@ -166,4 +166,3 @@ if(isset($_POST['emailchangecancel']) && $_POST['emailchangecancel'] == 1) {
'custom_buttons' => $custom_buttons 'custom_buttons' => $custom_buttons
)); ));
} }
?>

View File

@@ -50,6 +50,10 @@ else
if($player->isLoaded()) { if($player->isLoaded()) {
$player_account = $player->getAccount(); $player_account = $player->getAccount();
if($account_logged->getId() == $player_account->getId()) { if($account_logged->getId() == $player_account->getId()) {
if ($player->isDeleted()) {
$errors[] = 'This character is deleted.';
}
if($player->isOnline()) { if($player->isOnline()) {
$errors[] = 'This character is online.'; $errors[] = 'This character is online.';
} }
@@ -91,7 +95,7 @@ else
} }
} }
else { else {
$errors[] = 'Character <b>' . $player_name . '</b> is not on your account.'; $errors[] = 'Character is not on your account.';
} }
} }
else { else {
@@ -112,5 +116,3 @@ else
)); ));
} }
} }
?>

View File

@@ -89,6 +89,4 @@ else
)); ));
setSession('password', $new_password); setSession('password', $new_password);
} }
} }
?>

View File

@@ -41,6 +41,10 @@ else
$player_account = $player->getAccount(); $player_account = $player->getAccount();
if($account_logged->getId() == $player_account->getId()) { if($account_logged->getId() == $player_account->getId()) {
if ($player->isDeleted()) {
$errors[] = 'This character is deleted.';
}
if($player->isOnline()) { if($player->isOnline()) {
$errors[] = 'This character is online.'; $errors[] = 'This character is online.';
} }
@@ -71,7 +75,7 @@ else
} }
} }
else { else {
$errors[] = 'Character <b>'.$player_name.'</b> is not on your account.'; $errors[] = 'Character is not on your account.';
} }
} }
else { else {
@@ -85,11 +89,9 @@ else
$twig->display('error_box.html.twig', array('errors' => $errors)); $twig->display('error_box.html.twig', array('errors' => $errors));
} }
$twig->display('account.change_sex.html.twig', array( $twig->display('account.change_sex.html.twig', array(
'players' => $account_logged->getPlayersList(), 'players' => $account_logged->getPlayersList(false),
'player_sex' => isset($player) ? $player->getSex() : -1, 'player_sex' => isset($player) ? $player->getSex() : -1,
'points' => $points 'points' => $points
)); ));
} }
} }
?>

Some files were not shown because too many files have changed in this diff Show More