Exemplo n.º 1
0
// Try to catch some operations (login, logout, etc.)
$locale_loaded = false;
WoW::CatchOperations($locale_loaded);
// locale from page controller
$wow_locale_cms = isset($_COOKIE['wow_locale']) ? $_COOKIE['wow_locale'] : WoWConfig::$DefaultLocale;
if (!isset($_COOKIE['wow_locale'])) {
    setcookie('wow_locale', $wow_locale_cms, strtotime('NEXT YEAR'), '/');
    $_COOKIE['wow_locale'] = $wow_locale_cms;
}
$pController = new PageController();
if ($pController->GetLocale() != null && $pController->GetLocale() != $_COOKIE['wow_locale']) {
    //$_SESSION['wow_locale'] = $pController->GetLocale();
    WoW_Locale::SetLocale($pController->GetLocale(), WoW_Locale::GetLocaleIDForLocale($pController->GetLocale()), true);
} else {
    WoW_Locale::SetLocale($_COOKIE['wow_locale'], WoW_Locale::GetLocaleIDForLocale($_COOKIE['wow_locale']));
}
// Initialize account (if user already logged in we need to re-build his info from session data)
WoW_Account::Initialize();
if (isset($_COOKIE['wow_session']) && !WoW_Account::IsLoggedIn()) {
    WoW_Account::loadFromCookieSession();
}
// Initialize auction handler
WoW_Auction::InitAuction();
// TODO: this initialization should be moved in some other place.
// Display wow revision (if required; do not remove).
if (isset($_GET['_DISPLAYVERSION_'])) {
    die('WOW_REVISION: ' . WOW_REVISION);
}
// RunOnce
define('__RUNONCE__', true);
include INCLUDES_DIR . 'RunOnce.php';