static function configureForUser($user = false) { $lang = Internationalization::getCurrentLanguage($user); $info = Internationalization::getLanguageInfo(strtolower($lang)); if (!$info) { // Not a supported language return; } // Define locale for C-libraries putenv('LC_ALL=' . $info['code']); self::setLocale(LC_ALL, $info['code']); }
<?php $title = $cfg && is_object($cfg) && $cfg->getTitle() ? $cfg->getTitle() : 'osTicket :: ' . __('Support Ticket System'); $signin_url = ROOT_PATH . "login.php" . ($thisclient ? "?e=" . urlencode($thisclient->getEmail()) : ""); $signout_url = ROOT_PATH . "logout.php?auth=" . $ost->getLinkToken(); header("Content-Type: text/html; charset=UTF-8"); ?> <!DOCTYPE html> <html <?php if (($lang = Internationalization::getCurrentLanguage()) && ($info = Internationalization::getLanguageInfo($lang)) && @$info['direction'] == 'rtl') { echo 'dir="rtl" class="rtl"'; } ?> > <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title><?php echo Format::htmlchars($title); ?> </title> <meta name="description" content="customer support platform"> <meta name="keywords" content="osTicket, Customer support system, support ticket system"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <link rel="stylesheet" href="<?php echo ROOT_PATH; ?> css/osticket.css?19292ad" media="screen"/> <link rel="stylesheet" href="<?php echo ASSETS_PATH; ?>
if (!in_array(strtolower(basename($_SERVER['SCRIPT_NAME'])), array('logo.php', 'file.php')) && !(is_object($ost) && $ost->isSystemOnline())) { include ROOT_DIR . 'offline.php'; exit; } /* include what is needed on client stuff */ require_once INCLUDE_DIR . 'class.client.php'; require_once INCLUDE_DIR . 'class.ticket.php'; require_once INCLUDE_DIR . 'class.dept.php'; //clear some vars $errors = array(); $msg = ''; $nav = null; //Make sure the user is valid..before doing anything else. $thisclient = UserAuthenticationBackend::getUser(); if (isset($_GET['lang']) && $_GET['lang']) { if (Internationalization::getLanguageInfo($_GET['lang'])) { $_SESSION['client:lang'] = $_GET['lang']; } } // Bootstrap gettext translations as early as possible, but after attempting // to sign on the agent TextDomain::configureForUser($thisclient); //is the user logged in? if ($thisclient && $thisclient->getId() && $thisclient->isValid()) { $thisclient->refreshSession(); } else { $thisclient = null; } /******* CSRF Protectin *************/ // Enforce CSRF protection for POSTS if ($_POST && !$ost->checkCSRFToken()) {
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html <?php if (($lang = Internationalization::getCurrentLanguage()) && ($info = Internationalization::getLanguageInfo($lang)) && (@$info['direction'] == 'rtl')) echo 'dir="rtl" class="rtl"'; ?>> <head> <title><?php echo $wizard['title']; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/wizard.css?c18eac4"> <link type="text/css" rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/flags.css?c18eac4"> <script type="text/javascript" src="../js/jquery-1.8.3.min.js?c18eac4"></script> <script type="text/javascript" src="js/tips.js?c18eac4"></script> <script type="text/javascript" src="js/setup.js?c18eac4"></script> </head> <body> <div id="wizard"> <div id="header"> <img id="logo" src="./images/<?php echo $wizard['logo']?$wizard['logo']:'logo.png'; ?>" width="280" height="72" alt="osTicket"> <div class="info"><?php echo $wizard['tagline']; ?></div> <br/> <ul class="links"> <li> <?php foreach($wizard['menu'] as $k=>$v) echo sprintf('<a target="_blank" href="%s">%s</a> — ',$v,$k); ?> <a target="_blank" href="http://osticket.com/contact-us"><?php echo __('Contact Us');?></a> </li>