Merge branch 'develop' into feature/settings

This commit is contained in:
slawkens 2023-07-08 19:16:22 +02:00
commit c886384f2c
160 changed files with 2668 additions and 453 deletions

6
.gitattributes vendored
View File

@ -3,8 +3,12 @@
.gitignore export-ignore
.github export-ignore
.editorconfig export-ignore
.travis.yml export-ignore
_config.yml export-ignore
release.sh export-ignore
# cypress
cypress export-ignore
cypress.config.js export-ignore
cypress.env.json
*.sh text eol=lf

120
.github/workflows/cypress.yml vendored Normal file
View File

@ -0,0 +1,120 @@
name: Cypress
on:
pull_request:
branches: [develop]
push:
branches: [develop]
jobs:
cypress:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: myaac
MYSQL_USER: myaac
MYSQL_PASSWORD: myaac
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: [ '7.4', '8.0', '8.1' ]
name: MyAAC on PHP ${{ matrix.php-versions }}
steps:
- name: 📌 MySQL Start & init & show db
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE myaac;' -uroot -proot
mysql -e "SHOW DATABASES" -uroot -proot
- name: Checkout MyAAC
uses: actions/checkout@v3
with:
ref: 0.9
- name: Checkout TFS
uses: actions/checkout@v3
with:
repository: otland/forgottenserver
ref: 1.4
path: tfs
- name: Import TFS Schema
run: |
mysql -uroot -proot myaac < tfs/schema.sql
- name: Rename config.lua
run: mv tfs/config.lua.dist tfs/config.lua
- name: Replace mysqlUser
uses: jacobtomlinson/gha-find-replace@v2
with:
find: 'mysqlUser = "forgottenserver"'
replace: 'mysqlUser = "root"'
regex: false
include: 'tfs/config.lua'
- name: Replace mysqlPass
uses: jacobtomlinson/gha-find-replace@v2
with:
find: 'mysqlPass = ""'
replace: 'mysqlPass = "root"'
regex: false
include: 'tfs/config.lua'
- name: Replace mysqlDatabase
uses: jacobtomlinson/gha-find-replace@v2
with:
find: 'mysqlDatabase = "forgottenserver"'
replace: 'mysqlDatabase = "myaac"'
regex: false
include: 'tfs/config.lua'
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql, json, xml, pdo, pdo_mysql
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run PHP server
run: nohup php -S localhost:8080 > php.log 2>&1 &
- name: Cypress Run
uses: cypress-io/github-action@v5
env:
CYPRESS_URL: http://localhost:8080
CYPRESS_SERVER_PATH: /home/runner/work/myaac/myaac/tfs
- name: Save screenshots
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-screenshots
path: cypress/screenshots
- name: Upload Cypress Videos
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos

4
.gitignore vendored
View File

@ -9,6 +9,10 @@ vendor
# npm
node_modules
# cypress
cypress.env.json
cypress/e2e/2-advanced-examples
# created by release.sh
releases
tmp

View File

@ -6,6 +6,10 @@
Options -MultiViews
</IfModule>
<FilesMatch "^(CHANGELOG\.md|README\.md|composer\.json|composer\.lock|package\.json|package-lock\.json|cypress\.env\.json)$">
Require all denied
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On

View File

@ -1,18 +0,0 @@
language: php
php:
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
cache:
directories:
- $HOME/.composer/cache
before_script:
- composer require php-parallel-lint/php-parallel-lint --no-suggest --no-progress --no-interaction --no-ansi --quiet --optimize-autoloader
script:
- php vendor/bin/parallel-lint --no-progress --no-colors --exclude vendor --exclude "system/libs/pot/OTS_DB_PDOQuery.php" .

View File

@ -1,6 +1,6 @@
# Changelog
## [0.9.0-alpha - x.x.2023]
## [0.9.0-alpha - 02.06.2023]
Minimum PHP version for this release is 7.2.5.
@ -12,9 +12,10 @@ Minimum PHP version for this release is 7.2.5.
* new Admin Bar showed on top when admin logged in
* new page: Server Data, to reload server data
* new pages: mass account & teleport tools
* editable changelogs
* changelogs editor
* revised Accounts & Players editors
* option to add/modify menus with plugins
* option to enable/disable plugins
* better, updated TinyMCE editor (v6.x)
* with option to upload images
* list of open source libraries used in project
@ -29,11 +30,12 @@ Minimum PHP version for this release is 7.2.5.
* support for Account Number
* suggest account number option
* many new functions, hooks and configurables
* better Exception Handler (Whoops - https://github.com/filp/whoops)
* add Cypress testing
### Changed
* Composer is now used for external libraries like: Twig, PHPMailer, fast-route etc.
* mail support is disabled on fresh install, can be manually enabled by user
* don't show PHP errors on prod
* disable add php pages in admin panel for security. Option to disable plugins upload
* visitors counter shows now user browser, and also if its bot
* changes in required and optional PHP extensions
@ -43,6 +45,7 @@ Minimum PHP version for this release is 7.2.5.
* Highscores
* frags works for TFS 1.x
* cached
* creatures
* moved pages to Twig:
* experience stages
* update player_deaths entries on name change

View File

@ -1,3 +1,3 @@
* Gesior.pl (2007 - 2008)
* Slawkens (2009 - 2022)
* Slawkens (2009 - 2023)
* Contributors listed in CONTRIBUTORS.txt

View File

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

View File

@ -10,7 +10,7 @@
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Account editor';
$admin_base = BASE_URL . 'admin/?p=accounts';
$admin_base = ADMIN_URL . '?p=accounts';
$use_datatable = true;
if ($config['account_country'])

View File

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

View File

@ -16,4 +16,4 @@ if (!function_exists('phpinfo')) { ?>
<?php return;
}
?>
<iframe src="<?php echo BASE_URL; ?>admin/tools/phpinfo.php" width="1024" height="550"></iframe>
<iframe src="<?php echo ADMIN_URL; ?>tools/phpinfo.php" width="1024" height="550"></iframe>

View File

@ -10,7 +10,7 @@
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Player editor';
$player_base = BASE_URL . 'admin/?p=players';
$player_base = ADMIN_URL . '?p=players';
$use_datatable = true;
require_once LIBS . 'forum.php';

View File

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

View File

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

View File

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

View File

@ -26,7 +26,7 @@
if (version_compare(phpversion(), '7.2.5', '<')) die('PHP version 7.2.5 or higher is required.');
const MYAAC = true;
const MYAAC_VERSION = '0.9.0-dev';
const MYAAC_VERSION = '0.10.0-dev';
const DATABASE_VERSION = 36;
const TABLE_PREFIX = 'myaac_';
define('START_TIME', microtime(true));
@ -138,11 +138,9 @@ if(!IS_CLI) {
define('SERVER_URL', 'http' . (isset($_SERVER['HTTPS'][0]) && strtolower($_SERVER['HTTPS']) === 'on' ? 's' : '') . '://' . $baseHost);
define('BASE_URL', SERVER_URL . BASE_DIR . '/');
define('ADMIN_URL', SERVER_URL . BASE_DIR . '/admin/');
define('ADMIN_URL', SERVER_URL . BASE_DIR . '/' . ADMIN_PANEL_FOLDER . '/');
//define('CURRENT_URL', BASE_URL . $_SERVER['REQUEST_URI']);
require SYSTEM . 'exception.php';
}
$autoloadFile = VENDOR . 'autoload.php';

View File

@ -12,5 +12,8 @@
"erusev/parsedown": "^1.7",
"nikic/fast-route": "^1.3",
"matomo/device-detector": "^6.0"
},
"require-dev": {
"filp/whoops": "^2.15"
}
}

9
cypress.config.js Normal file
View File

@ -0,0 +1,9 @@
const { defineConfig } = require("cypress");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});

View File

@ -0,0 +1,75 @@
describe('Install MyAAC', () => {
beforeEach(() => {
// Cypress starts out with a blank slate for each test
// so we must tell it to visit our website with the `cy.visit()` command.
// Since we want to visit the same URL at the start of all our tests,
// we include it in our beforeEach function so that it runs before each test
cy.visit(Cypress.env('URL'))
})
it('Go through installer', () => {
cy.visit(Cypress.env('URL') + '/install/?step=welcome')
cy.wait(1000)
cy.screenshot('install-welcome')
// step 1 - Welcome
cy.get('select[name="lang"]').select('en')
//cy.get('input[type=button]').contains('Next »').click()
cy.get('form').submit()
// step 2 - License
// just skip
cy.contains('GNU/GPL License');
cy.get('form').submit()
// step 3 - Requirements
cy.contains('Requirements check');
cy.get('#step').then(elem => {
elem.val('config');
});
cy.get('form').submit()
// step 4 - Configuration
cy.contains('Basic configuration');
cy.get('#vars_server_path').click().clear().type(Cypress.env('SERVER_PATH'))
cy.get('#vars_mail_admin').click().clear().type('noone@example.net')
cy.get('[type="checkbox"]').uncheck() // usage statistics uncheck
cy.wait(1000)
cy.get('form').submit()
// check if there is any error
// step 5 - Import Schema
cy.contains('Import MySQL schema');
// AAC is not installed yet, this message should not come
cy.contains('Seems AAC is already installed. Skipping importing MySQL schema..').should('not.exist')
cy.contains('[class="alert alert-success"]', 'Local configuration has been saved into file: config.local.php').should('be.visible')
cy.get('form').submit()
// step 6 - Admin Account
cy.get('#vars_email').click().clear().type('admin@my-aac.org')
cy.get('#vars_account').click().clear().type('admin')
cy.get('#vars_password').click().clear().type('test1234')
cy.get('#vars_password_confirm').click().clear().type('test1234')
cy.get('#vars_player_name').click().clear().type('Admin')
cy.get('form').submit()
cy.contains('[class="alert alert-success"]', 'Congratulations', { timeout: 30000 }).should('be.visible')
cy.screenshot('install-finish')
})
})

View File

@ -0,0 +1,33 @@
describe('Create Account Page', () => {
beforeEach(() => {
// Cypress starts out with a blank slate for each test
// so we must tell it to visit our website with the `cy.visit()` command.
// Since we want to visit the same URL at the start of all our tests,
// we include it in our beforeEach function so that it runs before each test
cy.visit(Cypress.env('URL') + '/index.php/account/create')
})
it('Create Test Account', () => {
cy.screenshot('create-account-page')
cy.get('#account_input').type('tester')
cy.get('#email').type('tester@example.com')
cy.get('#password').type('test1234')
cy.get('#password2').type('test1234')
cy.get('#character_name').type('Slaw')
cy.get('#sex1').check()
cy.get('#vocation1').check()
cy.get('#accept_rules').check()
cy.get('#createaccount').submit()
// no errors please
cy.contains('The Following Errors Have Occurred:').should('not.exist')
// ss of post page
cy.screenshot('create-account-page-post')
})
})

View File

@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

View File

@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })

20
cypress/support/e2e.js Normal file
View File

@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')

View File

@ -163,6 +163,7 @@ if(setting('core.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';

View File

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

View File

@ -26,13 +26,13 @@ $twig = new Twig_Environment($twig_loader, array(
));
// load installation status
$step = isset($_POST['step']) ? $_POST['step'] : 'welcome';
$step = $_REQUEST['step'] ?? 'welcome';
$install_status = array();
if(file_exists(CACHE . 'install.txt')) {
$install_status = unserialize(file_get_contents(CACHE . 'install.txt'));
if(!isset($_POST['step'])) {
if(!isset($_REQUEST['step'])) {
$step = isset($install_status['step']) ? $install_status['step'] : '';
}
}

View File

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

View File

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

View File

@ -111,7 +111,7 @@ if(!$error) {
<div class="text-center m-3">
<form action="<?php echo BASE_URL; ?>install/" method="post">
<input type="hidden" name="step" id="step" value="admin" />
<?php echo next_buttons(true, $error ? false : true);
<?php echo next_buttons(true, !$error);
?>
</form>
</div>

View File

@ -122,6 +122,7 @@ else {
));
if(!isset($_SESSION['installed'])) {
if (!array_key_exists('CI', getenv())) {
$report_url = 'https://my-aac.org/report_install.php?v=' . MYAAC_VERSION . '&b=' . urlencode(BASE_URL);
if (function_exists('curl_version'))
{
@ -134,6 +135,8 @@ else {
else if (ini_get('allow_url_fopen') ) {
file_get_contents($report_url);
}
}
$_SESSION['installed'] = true;
}

View File

@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $locale['encoding']; ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MyAAC - <?php echo $locale['installation']; ?></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="template/style.css" />
<script type="text/javascript" src="<?php echo BASE_URL; ?>tools/js/jquery.min.js"></script>
</head>
@ -29,7 +29,7 @@
$progress = ($i == 6) ? 100 : $i * 16;
}
echo '<li' . ($step == $value ? ' class="list-group-item active"' : ' class="list-group-item"') . '>' . ++$i . '. ' . $locale['step_' . $value] . '</li>';
echo '<li class="list-group-item' . ($step == $value ? ' active' : '') . '">' . ++$i . '. ' . $locale['step_' . $value] . '</li>';
}
?>

View File

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

1927
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

5
package.json Normal file
View File

@ -0,0 +1,5 @@
{
"devDependencies": {
"cypress": "^12.12.0"
}
}

View File

@ -22,7 +22,7 @@ if [ $1 = "prepare" ]; then
mkdir -p tmp
# get myaac from git archive
git archive --format zip --output tmp/myaac.zip master
git archive --format zip --output tmp/myaac.zip develop
cd tmp/ || exit
@ -35,6 +35,11 @@ if [ $1 = "prepare" ]; then
unzip -q myaac.zip -d $dir
rm myaac.zip
cd $dir || exit
# dependencies
composer install --no-dev
echo "Now you can make changes to $dir. When you are ready, type 'release.sh pack'"
exit
fi

View File

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

View File

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

View File

@ -7,6 +7,20 @@
* @copyright 2023 MyAAC
* @link https://my-aac.org
*/
if (class_exists(\Whoops\Run::class)) {
$whoops = new \Whoops\Run;
if(IS_CLI) {
$whoops->pushHandler(new \Whoops\Handler\PlainTextHandler);
}
else {
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
}
$whoops->register();
return;
}
require LIBS . 'SensitiveException.php';
/**
@ -30,6 +44,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';

View File

@ -747,10 +747,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
@ -1217,7 +1217,7 @@ function getCustomPageInfo($page)
return null;
}
function getCustomPage($page, &$success)
function getCustomPage($page, &$success): string
{
global $db, $twig, $title, $ignore, $logged_access;
@ -1605,6 +1605,14 @@ function getGuildLogoById($id)
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
require_once LIBS . 'validator.php';
require_once SYSTEM . 'compat/base.php';

View File

@ -40,6 +40,7 @@ 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_PASSWORD', ++$i);
define('HOOK_ACCOUNT_CREATE_AFTER_PASSWORDS', ++$i);
define('HOOK_ACCOUNT_CREATE_BEFORE_CHARACTER_NAME', ++$i);
define('HOOK_ACCOUNT_CREATE_AFTER_CHARACTER_NAME', ++$i);

View File

@ -18,6 +18,11 @@ if(!isset($config['installed']) || !$config['installed']) {
throw new RuntimeException('MyAAC has not been installed yet or there was error during installation. Please install again.');
}
if(config('env') === 'dev') {
require SYSTEM . 'exception.php';
}
date_default_timezone_set($config['date_timezone']);
// take care of trailing slash at the end
if($config['server_path'][strlen($config['server_path']) - 1] !== '/')
$config['server_path'] .= '/';
@ -114,7 +119,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);
}

View File

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

View File

@ -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>!';
}

View File

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

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;
// finds ranks of all characters
foreach($this->getPlayersList() as $player)
foreach($this->getPlayersList(false) as $player)
{
$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);
}
}
?>

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);
}
}
?>

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

@ -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);
}
}
?>

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

@ -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;
}
}
?>

View File

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

View File

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

View File

@ -20,7 +20,7 @@ $locale['not_loaded'] = 'Nicht geladen';
$locale['loading_spinner'] = 'Bitte warten, installieren...';
$locale['importing_spinner'] = 'Bitte warte, Daten werden importiert...';
$locale['please_fill_all'] = 'Bitte füllen Sie alle Felder aus!';
$locale['already_installed'] = 'MyAAC wurde bereits installiert. Bitte löschen <b>install/<b/> Verzeichnis. Wenn Sie MyAAC neu installieren möchten, löschen Sie die Datei <strong>config.local.php</strong> aus dem Hauptverzeichnis und aktualisieren Sie die Seite.';
$locale['already_installed'] = 'MyAAC wurde bereits installiert. Bitte löschen <b>install/</b> Verzeichnis. Wenn Sie MyAAC neu installieren möchten, löschen Sie die Datei <strong>config.local.php</strong> aus dem Hauptverzeichnis und aktualisieren Sie die Seite.';
// welcome
$locale['step_welcome'] = 'Willkommen';

View File

@ -12,4 +12,3 @@ $locale['direction']= 'ltr';
$locale['error404'] = 'Diese Seite konnte nicht gefunden werden.';
$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/>
<span style="color: red">Please delete install/ directory.</span><br/><br/>
Post bugs and suggestions at $LINK$, thanks!';
?>

View File

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

View File

@ -118,4 +118,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!';
?>

View File

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

View File

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

View File

@ -10,12 +10,12 @@
defined('MYAAC') or die('Direct access not allowed!');
$logged = false;
$logged_flags = 0;
$account_logged = new OTS_Account();
// stay-logged with sessions
$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())

View File

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

View File

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

View File

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

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 . "news` MODIFY `title` VARCHAR(100) 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);
return true;
}
?>

View File

@ -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;");
?>

View File

@ -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;");
?>

View File

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

View File

@ -28,7 +28,13 @@ 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) {
if(empty($errors)) {
$player->setCustomField("hidden", $new_hideacc);
$player->setCustomField("comment", $new_comment);
$account_logged->logAction('Changed comment for character <b>' . $player->getName() . '</b>.');
@ -38,6 +44,7 @@ if($player_name != null) {
));
$show_form = false;
}
}
} else {
$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));
}
if(isset($player)) {
if(isset($player) && $player->isLoaded()) {
$twig->display('account.change_comment.html.twig', array(
'player' => $player
));

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