if (DEPLOYMENT_ON_DEMAND == FALSE and isset($config_vars['other']['installer_enabled']) and $config_vars['other']['installer_enabled'] == TRUE) { //Installer is enabled, check to see if any companies have been created, if not redirect to installer automatically, as they skipped it somehow. //Check if Company table exists first, incase the installer hasn't run at all, this avoids a SQL error. $install_obj = new Install(); if ($install_obj->checkTableExists('company') == TRUE) { $clf = TTnew('CompanyListFactory'); $clf->getAll(); if ($clf->getRecordCount() == 0) { Redirect::Page(URLBuilder::getURL(array('external_installer' => 1), 'install/install.php')); } } else { Redirect::Page(URLBuilder::getURL(array('external_installer' => 1), 'install/install.php')); } } break; } $smarty->assign_by_ref('user_name', $user_name); $smarty->assign_by_ref('password', $password); $smarty->assign_by_ref('password_reset', $password_reset); $smarty->assign('language_options', TTi18n::getLanguageArray()); if (isset($config_vars)) { $smarty->assign_by_ref('config_vars', $config_vars); } if ($language == '') { $language = TTi18n::getLanguageFromLocale(); } elseif (strlen($language) >= 4) { $language = TTi18n::getLanguageFromLocale($language); } $smarty->assign('language', $language); $smarty->assign_by_ref('validator', $validator); $smarty->display('Login.tpl');
$db_time_zone_error = TRUE; } /* * Check locale cookie, if it varies from UserPreference Language, * change user preferences to match. This could cause some unexpected behavior * as the change is happening behind the scenes, but if we don't change * the user prefs then they could login for weeks/months as a different * language from their preferences, therefore making the user preference * setting almost useless. Causing issues when printing pay stubs and in each * users language. */ $profiler->startTimer("setLocale()"); Debug::text('Locale Cookie: ' . TTi18n::getLocaleCookie(), __FILE__, __LINE__, __METHOD__, 10); if (TTi18n::getLocaleCookie() != '' and $current_user_prefs->getLanguage() !== TTi18n::getLanguageFromLocale(TTi18n::getLocaleCookie())) { Debug::text('Changing User Preference Language to match cookie...', __FILE__, __LINE__, __METHOD__, 10); $current_user_prefs->setLanguage(TTi18n::getLanguageFromLocale(TTi18n::getLocaleCookie())); if ($current_user_prefs->isValid()) { $current_user_prefs->Save(FALSE); } } else { Debug::text('User Preference Language matches cookie!', __FILE__, __LINE__, __METHOD__, 10); } if (isset($_GET['language']) and $_GET['language'] != '') { TTi18n::setLocale($_GET['language']); //Sets master locale } else { TTi18n::setLanguage($current_user_prefs->getLanguage()); TTi18n::setCountry($current_user->getCountry()); TTi18n::setLocale(); //Sets master locale }
function getPreLoginData($api = NULL) { global $config_vars; return array('primary_company_id' => PRIMARY_COMPANY_ID, 'base_url' => Environment::getBaseURL(), 'api_url' => Environment::getAPIURL($api), 'api_base_url' => Environment::getAPIBaseURL($api), 'api_json_url' => Environment::getAPIURL('json'), 'images_url' => Environment::getImagesURL(), 'powered_by_logo_enabled' => $this->isPoweredByLogoEnabled(), 'product_edition' => $this->getTTProductEdition(FALSE), 'product_edition_name' => $this->getTTProductEdition(TRUE), 'deployment_on_demand' => $this->getDeploymentOnDemand(), 'web_session_expire' => (isset($config_vars['other']['web_session_expire']) and $config_vars['other']['web_session_expire'] != '') ? (bool) $config_vars['other']['web_session_expire'] : FALSE, 'analytics_enabled' => $this->isAnalyticsEnabled(), 'registration_key' => $this->getRegistrationKey(), 'http_host' => $this->getHTTPHost(), 'application_version' => $this->getApplicationVersion(), 'is_logged_in' => $this->isLoggedIn(), 'language_options' => Misc::addSortPrefix(TTi18n::getLanguageArray()), 'language' => TTi18n::getLanguageFromLocale(TTi18n::getLocaleCookie())); }