Updated install and fixed bugs
Added session messages display Fixed field and validator loading. Updated form validation Updated root config management Muted error reporting in file evaluation Added menu updates Fixed galaxy data access error Fixed config bug Added HTTP request method checks Added Form manager Fixed core bugs Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
parent
c38e53706e
commit
9636b4bb00
69 changed files with 2434 additions and 789 deletions
|
|
@ -28,10 +28,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
defined('BCNUMBERS') || define('BCNUMBERS', true);
|
||||
defined('DEPRECATION') || define('DEPRECATION', true);
|
||||
defined('DEBUG') || define('DEBUG', true);
|
||||
|
||||
if (!defined('DEBUG') && ($env = getenv('DEBUG')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) {
|
||||
define('DEBUG', true);
|
||||
} else if (!defined('DEBUG') && isset($_SERVER['DEBUG']) && in_array(strtolower($_SERVER['DEBUG']), array('1', 'on', 'true'))) {
|
||||
|
|
@ -62,7 +58,7 @@ defined('APPLICATION_PATH') || define('APPLICATION_PATH', dirname(__FILE__) . DI
|
|||
|
||||
defined('PHPEXT') || define('PHPEXT', 'php');
|
||||
|
||||
defined('VERSION') || define('VERSION', '2011.1');
|
||||
defined('VERSION') || define('VERSION', '1.5.0-beta2');
|
||||
|
||||
set_include_path(implode(PATH_SEPARATOR, array(
|
||||
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'libraries',
|
||||
|
|
@ -80,7 +76,8 @@ Wootook_Core_Time::init();
|
|||
Wootook_Core_ErrorProfiler::register();
|
||||
Wootook_Core_Model_Config_Events::registerEvents();
|
||||
|
||||
if (0 === filesize(ROOT_PATH . 'config.php')) {
|
||||
if (!defined('IN_INSTALL') && 0 === filesize(ROOT_PATH . 'config.php')) {
|
||||
header('HTTP/1.1 307 Temporary Redirect');
|
||||
header('Location: install/');
|
||||
die();
|
||||
}
|
||||
|
|
@ -100,43 +97,46 @@ include(ROOT_PATH . 'language/' . DEFAULT_LANG . '/lang_info.cfg');
|
|||
include(ROOT_PATH . 'includes/vars.' . PHPEXT);
|
||||
include(ROOT_PATH . 'includes/strings.' . PHPEXT);
|
||||
|
||||
$gameConfig = Wootook_Core_Model_Config::getSingleton();
|
||||
if (isset($gameConfig['cookie_name']) && !empty($gameConfig['cookie_name'])) {
|
||||
Wootook_Empire_Model_User::setCookieName($gameConfig['cookie_name']);
|
||||
}
|
||||
$user = Wootook_Empire_Model_User::getSingleton();
|
||||
if (!defined('IN_INSTALL')) {
|
||||
|
||||
if (!defined('DISABLE_IDENTITY_CHECK')) {
|
||||
if (($user === null || !$user->getId())) {
|
||||
header('Location: login.php');
|
||||
exit(0);
|
||||
$gameConfig = Wootook_Core_Model_Config::getSingleton();
|
||||
if (isset($gameConfig['cookie_name']) && !empty($gameConfig['cookie_name'])) {
|
||||
Wootook_Empire_Model_User::setCookieName($gameConfig['cookie_name']);
|
||||
}
|
||||
$user = Wootook_Empire_Model_User::getSingleton();
|
||||
|
||||
if (!defined('DISABLE_IDENTITY_CHECK')) {
|
||||
if (($user === null || !$user->getId())) {
|
||||
header('Location: login.php');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($gameConfig->isEnabled() && $user !== null && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))) {
|
||||
message(stripslashes($gameConfig->getData('close_reason')), $gameConfig->getData('game_name'));
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
if ($gameConfig->isEnabled() && $user !== null && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))) {
|
||||
message(stripslashes($gameConfig->getData('close_reason')), $gameConfig->getData('game_name'));
|
||||
exit(0);
|
||||
includeLang('system');
|
||||
includeLang('tech');
|
||||
|
||||
if (($user !== null && $user->getId())) {
|
||||
if (isset($_GET['cp']) && !empty($_GET['cp'])) {
|
||||
$user->updateCurrentPlanet((int) $_GET['cp']);
|
||||
}
|
||||
|
||||
$planet = $user->getCurrentPlanet();
|
||||
|
||||
foreach ($user->getPlanetCollection() as $userPlanet) {
|
||||
FlyingFleetHandler($userPlanet); // TODO: implement logic into a refactored model
|
||||
}
|
||||
|
||||
/*
|
||||
* Update planet resources and constructions
|
||||
*/
|
||||
Wootook::dispatchEvent('planet.update', array(
|
||||
'planet' => $planet
|
||||
));
|
||||
$planet->save();
|
||||
}
|
||||
}
|
||||
|
||||
includeLang('system');
|
||||
includeLang('tech');
|
||||
|
||||
if (($user !== null && $user->getId())) {
|
||||
if (isset($_GET['cp']) && !empty($_GET['cp'])) {
|
||||
$user->updateCurrentPlanet((int) $_GET['cp']);
|
||||
}
|
||||
|
||||
$planet = $user->getCurrentPlanet();
|
||||
|
||||
foreach ($user->getPlanetCollection() as $userPlanet) {
|
||||
FlyingFleetHandler($userPlanet); // TODO: implement logic into a refactored model
|
||||
}
|
||||
|
||||
/*
|
||||
* Update planet resources and constructions
|
||||
*/
|
||||
Wootook::dispatchEvent('planet.update', array(
|
||||
'planet' => $planet
|
||||
));
|
||||
$planet->save();
|
||||
}
|
||||
Loading…
Reference in a new issue