Esempio n. 1
0
 function __construct()
 {
     global $lang;
     $this->userdata = new userdata();
     if (get('session_lang') != '') {
         $_SESSION['lang'] = get('session_lang');
     }
     if (isset($this->userdata->info)) {
         language_set($this->userdata->info['language']);
     } else {
         language_set();
     }
     // Reload user info from database using SET NAMES (workaround)
     $this->userdata->load_info();
 }
Esempio n. 2
0
 function output()
 {
     global $lang;
     if (get('session_lang') != '') {
         $_SESSION['lang'] = get('session_lang');
     }
     language_set(isset($this->userdata->info['language']) ? $this->userdata->info['language'] : null);
     // Reload user info from database using SET NAMES (workaround)
     $this->userdata->load_info();
     $this->html->head->add_title($lang['site_title']);
     $this->html->head->add_meta("text/html; charset=" . $lang['charset'], "", "Content-Type");
     header("Content-Type: text/html; charset=" . $lang['charset']);
     $this->html->body->tpl['center'] = $this->center->output();
     $this->html->body->tpl['menu'] = $this->menu->output();
     $this->html->body->tpl['header'] = $this->header->output();
     $this->html->body->tpl['footer'] = $this->footer->output();
     if ($this->message->show) {
         $this->html->body->tpl['message'] = $this->message->output();
     }
     return $this->html->output();
 }
Esempio n. 3
0
$pass = '******';
$auth = 1;
$instname = 'AlfaUngzipper';
$used_langs = array('en' => 'English', 'ru' => 'Russian', 'de' => 'Deutsch', 'be' => 'Belarussian', 'et' => 'Estonian', 'uk' => 'Ukrainian');
/*################### conf ###################*/
$cwd = getcwd();
$site_root = preg_replace('/\\\\+|\\/+/', '/', $cwd);
$output = '';
$this_script = $_SERVER["SCRIPT_FILENAME"];
$this_script_dir = dirname($this_script);
$wspl1 = chr(119) . chr(105) . chr(115) . chr(112) . chr(108);
$wspl2 = chr(119) . chr(105) . chr(36) . chr(112) . chr(108);
$wsfn1 = chr(119) . chr(105) . chr(115) . chr(102) . chr(110);
$wsfn2 = chr(119) . chr(105) . chr(36) . chr(102) . chr(110);
if (isset($_POST['lang_value'])) {
    language_set($_POST['lang_value']);
} else {
    if (count($used_langs) > 1) {
        language_set_auto();
    } else {
        $conf['lang_id'] = key($used_langs);
    }
}
eval('if (function_exists(\'lang_ret_arr_' . $conf['lang_id'] . '\')) {$conf = lang_ret_arr_' . $conf['lang_id'] . '();} else {$conf = lang_ret_arr_en();}');
common_conf_ret_arr();
if ($auth == 1) {
    if (!isset($_SERVER['PHP_AUTH_USER']) or $_SERVER['PHP_AUTH_USER'] !== $name or $_SERVER['PHP_AUTH_PW'] !== $pass) {
        header('WWW-Authenticate: Basic realm="AlfaUngzipper::AgressiveEdition"');
        header('HTTP/1.0 401 Unauthorized');
        _gettpl('acess_denied');
        exit;