Esempio n. 1
0
 /**
  * Authenticate user.
  */
 protected function authenticateUser()
 {
     $sessionId = CWebUser::checkAuthentication(CWebUser::getSessionCookie());
     if (!$sessionId) {
         CWebUser::setDefault();
     }
     // set the authentication token for the API
     API::getWrapper()->auth = $sessionId;
     // enable debug mode in the API
     API::getWrapper()->debug = CWebUser::getDebugMode();
 }
Esempio n. 2
0
 /**
  * Authenticate user.
  */
 protected function authenticateUser()
 {
     if (!CWebUser::checkAuthentication(get_cookie('zbx_sessionid'))) {
         CWebUser::setDefault();
     }
 }
                break;
            }
        }
        if (!$locale_found && CWebUser::$data['lang'] != 'en_GB' && CWebUser::$data['lang'] != 'en_gb') {
            error('Locale for language "' . CWebUser::$data['lang'] . '" is not found on the web server. Tried to set: ' . implode(', ', $locales) . '. Unable to translate Zabbix interface.');
        }
        bindtextdomain('frontend', 'locale');
        bind_textdomain_codeset('frontend', 'UTF-8');
        textdomain('frontend');
    } else {
        error('Your PHP has no gettext support. Zabbix translations are not available.');
    }
    // numeric Locale to default
    setlocale(LC_NUMERIC, array('C', 'POSIX', 'en', 'en_US', 'en_US.UTF-8', 'English_United States.1252', 'en_GB', 'en_GB.UTF-8'));
} else {
    CWebUser::setDefault();
}
// should be after locale initialization
require_once dirname(__FILE__) . '/translateDefines.inc.php';
set_zbx_locales();
// init mb strings if it's available
init_mbstrings();
// ajax - do not need warnings or errors
if ((isset($DENY_GUI) || isset($show_setup) || isset($show_warning)) && PAGE_TYPE_HTML != detect_page_type()) {
    header('Ajax-response: false');
    exit;
}
if (isset($DENY_GUI)) {
    unset($show_warning);
    require_once dirname(__FILE__) . '/../warning.php';
}