当前位置: 首页>>代码示例>>PHP>>正文


PHP CWebUser::checkAuthentication方法代码示例

本文整理汇总了PHP中CWebUser::checkAuthentication方法的典型用法代码示例。如果您正苦于以下问题:PHP CWebUser::checkAuthentication方法的具体用法?PHP CWebUser::checkAuthentication怎么用?PHP CWebUser::checkAuthentication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CWebUser的用法示例。


在下文中一共展示了CWebUser::checkAuthentication方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_audit_ext

            $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'];
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:index.php

示例2: authenticateUser

 /**
  * 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();
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:14,代码来源:ZBase.php

示例3: authenticateUser

 /**
  * Authenticate user.
  */
 protected function authenticateUser()
 {
     if (!CWebUser::checkAuthentication(get_cookie('zbx_sessionid'))) {
         CWebUser::setDefault();
     }
 }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:9,代码来源:ZBase.php

示例4: getRequest

        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'];
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:index.php


注:本文中的CWebUser::checkAuthentication方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。