From 194d08f59398118f7ee7ad8699b8403686f4e44c Mon Sep 17 00:00:00 2001 From: slawkens1 Date: Fri, 5 May 2017 04:02:01 +0200 Subject: [PATCH] Fixes * fixed bug with status info utf8 encoding (https://otland.net/threads/myaac-v0-0-1.251454/page-2#post-2440259) * fixed when ip in log_action is NULL (https://otland.net/threads/myaac-v0-0-1.251454/page-2#post-2440357) * added CHANGELOG --- CHANGELOG | 27 ++++++++++++++++++++ README | 41 ------------------------------ install/includes/schema.sql | 6 ++--- system/libs/pot/OTS_ServerInfo.php | 2 +- system/pages/accountmanagement.php | 25 ++++++++++-------- system/pages/admin/changelog.php | 21 ++++++++------- system/pages/admin/version.php | 3 ++- 7 files changed, 58 insertions(+), 67 deletions(-) create mode 100644 CHANGELOG delete mode 100644 README diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 00000000..804facde --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,27 @@ +[0.0.3 - 03.05.2017] + - Full support for OTHire 0.0.3 + - added support for otservers that doesn't use account.name field, instead just account number will be used + - fixed encryption detection on TFS 0.3 + - fixed bug when server_config table doesn't exist + - (install) moved admin account creation to new step + - fixed news comment link + - by default, the installer creates now the Admin player, for admin account + - fixed installation errors + - fixed config.lua loading with some weird comments + +[0.0.2 - 02.05.2017] + - updated forum links to use friendly_urls + - some more info will be shown when cannot connect to database + - show more error infos when creating character + - fixed forum link on newses + - fixed spells loading when there's vocation name instead of id + - fixed bug when you have changed template but it doesn't exist anymore + - fixed vocations with promotion loading + - fixed support for gesior pages and templates + - added function OTS_Acount:getGroupId() + +[0.0.1 - 01.05.2017] + This is first official release of MyAAC. + Features are listed here + + For more information, see the release announcement on OTLand: https://otland.net/threads/myaac-v0-0-1.251454/ \ No newline at end of file diff --git a/README b/README deleted file mode 100644 index 91e0e89c..00000000 --- a/README +++ /dev/null @@ -1,41 +0,0 @@ -MyAAC 0.0.1 - http://www.my-aac.org - -REQUIREMENTS -===================================== - - PHP 5.1.0 or later - - MySQL database - - (optional) mod_rewrite to use friendly_urls - -INSTALLATION AND CONFIGURATION -===================================== - Just decompress and untar the source (which you should have done by now, - if you're reading this), into your webserver's document root. - - MyAAC needs proper permissions to handle files correctly. - If you're using apache2, then your directory needs to have owner set to: www-data, you can do it by using following command: - chown -R www-data.www-data /var/www/* - (or any other path your MyAAC installation is located at..) - --------------------------- - Note: Linux only - If you're under linux use these commands to set proper permissions: - chmod 660 config.local.php - chmod 660 images/guilds - chmod 660 images/houses - chmod 660 images/screenshots --------------------------- - - Visit http://your_domain/install (http://localhost/install) and follow instructions in the browser. - -KNOWN PROBLEMS -===================================== - - none - - -OTHER NOTES -===================================== - If you have a great idea or want contribute to the project - visit our website at http://www.my-aac.org - -LICENSING -===================================== - This program and all associated files are released under the GNU Public - License, see LICENSE for details. diff --git a/install/includes/schema.sql b/install/includes/schema.sql index 68d03cbe..7527b342 100644 --- a/install/includes/schema.sql +++ b/install/includes/schema.sql @@ -1,9 +1,9 @@ CREATE TABLE `myaac_account_actions` ( `account_id` INT(11) NOT NULL, - `ip` INT(11) NOT NULL, - `date` INT(11) NOT NULL, - `action` VARCHAR(255) NOT NULL, + `ip` INT(11) NOT NULL DEFAULT '', + `date` INT(11) NOT NULL DEFAULT 0, + `action` VARCHAR(255) NOT NULL DEFAULT '', KEY (`account_id`) ) ENGINE = MyISAM; diff --git a/system/libs/pot/OTS_ServerInfo.php b/system/libs/pot/OTS_ServerInfo.php index e34ce23c..2fcd6450 100644 --- a/system/libs/pot/OTS_ServerInfo.php +++ b/system/libs/pot/OTS_ServerInfo.php @@ -124,7 +124,7 @@ class OTS_ServerInfo { // loads respond XML $info = new OTS_InfoRespond(); - if(!$info->loadXML( $status->getBuffer())) + if(!$info->loadXML( utf8_encode($status->getBuffer()))) return false; return $info; diff --git a/system/pages/accountmanagement.php b/system/pages/accountmanagement.php index 6806d16d..b35a086b 100644 --- a/system/pages/accountmanagement.php +++ b/system/pages/accountmanagement.php @@ -796,6 +796,8 @@ function checkName() $newchar_vocation = isset($_POST['newcharvocation']) ? $_POST['newcharvocation'] : NULL; $newchar_town = isset($_POST['newchartown']) ? $_POST['newchartown'] : NULL; $newchar_errors = array(); + + $newchar_created = false; if(isset($_POST['savecharacter']) && $_POST['savecharacter'] == 1) { if(empty($newchar_name)) $newchar_errors[] = 'Please enter a name for your character!'; @@ -897,7 +899,7 @@ function checkName() } if(fieldExist('lookaddons', 'players')) - $player->setLookAddons($char_to_copy->getLookAddons()); + $player->setLookAddons($char_to_copy->getLookAddons()); $player->setTownId($newchar_town); $player->setExperience($char_to_copy->getExperience()); @@ -929,6 +931,8 @@ function checkName() } $player->save(); $player->setCustomField("created", time()); + + $newchar_created = true; $account_logged->logAction('Created character ' . $player->getName() . '.'); unset($player); $player = $ots->createObject('Player'); @@ -958,15 +962,16 @@ function checkName() } } } - else - { - if(count($newchar_errors) > 0) { - echo '
'; - echo 'The Following Errors Have Occurred:
'; - foreach($newchar_errors as $newchar_error) - echo '
  • '.$newchar_error . '
  • '; - echo '

    '; - } + + if(count($newchar_errors) > 0) { + echo '
    '; + echo 'The Following Errors Have Occurred:
    '; + foreach($newchar_errors as $newchar_error) + echo '
  • '.$newchar_error . '
  • '; + echo '

    '; + } + + if(!$newchar_created) { echo 'Please choose a name'; if(count($config['character_samples']) > 1) echo ', vocation'; diff --git a/system/pages/admin/changelog.php b/system/pages/admin/changelog.php index 2f1d4533..c6f2b88e 100644 --- a/system/pages/admin/changelog.php +++ b/system/pages/admin/changelog.php @@ -1,6 +1,6 @@ @@ -9,19 +9,18 @@ * @link http://my-aac.org */ defined('MYAAC') or die('Direct access not allowed!'); -$title = 'MyAAC - CHANGELOG'; +$title = 'MyAAC Changelog'; -$data = file_get_contents(SYSTEM . 'docs/CHANGELOG'); +if(!file_exists(BASE . 'CHANGELOG')) { + echo 'File CHANGELOG doesn\'t exist.'; + return; +} -// replace special characters with HTML entities -// replace line breaks with
    -$data = nl2br(htmlspecialchars($data)); - -// replace multiple spaces with single spaces -$data = preg_replace('/\s\s+/', ' ', $data); +$changelog = file_get_contents(BASE . 'CHANGELOG'); +$changelog = nl2br(htmlspecialchars($changelog)); // replace URLs with elements -$data = preg_replace('/\s(\w+:\/\/)(\S+)/', ' \\1\\2', $data); +$changelog = preg_replace('/\s(\w+:\/\/)(\S+)/', ' \\1\\2', $changelog); -echo '
    ' . $data . '
    '; +echo '
    ' . $changelog . '
    '; ?> diff --git a/system/pages/admin/version.php b/system/pages/admin/version.php index 0aee6df2..de15291f 100644 --- a/system/pages/admin/version.php +++ b/system/pages/admin/version.php @@ -18,7 +18,8 @@ $myaac_version = file_get_contents('http://my-aac.org/VERSION'); // compare them if(version_compare($myaac_version, MYAAC_VERSION) <= 0) - echo '

    MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version.

    '; + echo '

    MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version. +
    View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here') . '

    '; else echo '

    You\'re using outdated version.
    Your version: ' . MYAAC_VERSION . '