$result = API::User()->updateProfile($user);
        }
        add_audit_ext(AUDIT_ACTION_LOGIN, AUDIT_RESOURCE_USER, CWebUser::$data['userid'], '', null, null, null);
        $request = get_request('request');
        $url = zbx_empty($request) ? CWebUser::$data['url'] : $request;
        if (zbx_empty($url) || $url == $page['file']) {
            $url = 'dashboard.php';
        }
        redirect($url);
        exit;
    } else {
        CWebUser::checkAuthentication(null);
    }
} else {
    // login the user from the session, if the session id is empty - login as a guest
    CWebUser::checkAuthentication(get_cookie('zbx_sessionid'));
}
// the user is not logged in, display the login form
if (!CWebUser::$data['alias'] || CWebUser::$data['alias'] == ZBX_GUEST_USER) {
    switch ($config['authentication_type']) {
        case ZBX_AUTH_HTTP:
            echo _('User name does not match with DB');
            break;
        case ZBX_AUTH_LDAP:
        case ZBX_AUTH_INTERNAL:
            if (isset($_REQUEST['enter'])) {
                $_REQUEST['autologin'] = get_request('autologin', 0);
            }
            if ($messages = clear_messages()) {
                $messages = array_pop($messages);
                $_REQUEST['message'] = $messages['message'];
Exemple #2
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();
 }
Exemple #3
0
 /**
  * Authenticate user.
  */
 protected function authenticateUser()
 {
     if (!CWebUser::checkAuthentication(get_cookie('zbx_sessionid'))) {
         CWebUser::setDefault();
     }
 }
Exemple #4
0
        if (CWebUser::$data['autologin'] != $autoLogin) {
            API::User()->updateProfile($user);
        }
        $request = getRequest('request');
        $url = zbx_empty($request) ? CWebUser::$data['url'] : $request;
        if (zbx_empty($url) || $url == $page['file']) {
            $url = 'dashboard.php';
        }
        redirect($url);
        exit;
    } else {
        CWebUser::checkAuthentication(null);
    }
} else {
    // login the user from the session, if the session id is empty - login as a guest
    CWebUser::checkAuthentication(CWebUser::getSessionCookie());
}
// the user is not logged in, display the login form
if (!CWebUser::$data['alias'] || CWebUser::$data['alias'] == ZBX_GUEST_USER) {
    switch ($config['authentication_type']) {
        case ZBX_AUTH_HTTP:
            echo _('User name does not match with DB');
            break;
        case ZBX_AUTH_LDAP:
        case ZBX_AUTH_INTERNAL:
            if (isset($_REQUEST['enter'])) {
                $_REQUEST['autologin'] = getRequest('autologin', 0);
            }
            if ($messages = clear_messages()) {
                $messages = array_pop($messages);
                $_REQUEST['message'] = $messages['message'];