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


PHP user_logout函数代码示例

本文整理汇总了PHP中user_logout函数的典型用法代码示例。如果您正苦于以下问题:PHP user_logout函数的具体用法?PHP user_logout怎么用?PHP user_logout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     init_painel();
     user_logout();
     $this->load->model('auditoria_model', 'auditoria');
 }
开发者ID:glhrmfrts2,项目名称:Loja_Beit,代码行数:7,代码来源:auditoria.php

示例2: onKernelRequestMaintenance

 /**
  * Determine whether the page is configured to be offline.
  *
  * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
  *   The event to process.
  */
 public function onKernelRequestMaintenance(GetResponseEvent $event)
 {
     $request = $event->getRequest();
     $route_match = RouteMatch::createFromRequest($request);
     $path = $request->attributes->get('_system_path');
     if ($this->maintenanceMode->applies($route_match)) {
         // If the site is offline, log out unprivileged users.
         if ($this->account->isAuthenticated() && !$this->maintenanceMode->exempt($this->account)) {
             user_logout();
             // Redirect to homepage.
             $event->setResponse(new RedirectResponse($this->url('<front>', [], ['absolute' => TRUE])));
             return;
         }
         if ($this->account->isAnonymous() && $path == 'user') {
             // Forward anonymous user to login page.
             $event->setResponse(new RedirectResponse($this->url('user.login', [], ['absolute' => TRUE])));
             return;
         }
     }
     if ($this->account->isAuthenticated()) {
         if ($path == 'user/login') {
             // If user is logged in, redirect to 'user' instead of giving 403.
             $event->setResponse(new RedirectResponse($this->url('user.page', [], ['absolute' => TRUE])));
             return;
         }
         if ($path == 'user/register') {
             // Authenticated user should be redirected to user edit page.
             $event->setResponse(new RedirectResponse($this->url('entity.user.edit_form', ['user' => $this->account->id()], ['absolute' => TRUE])));
             return;
         }
     }
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:38,代码来源:MaintenanceModeSubscriber.php

示例3: onKernelRequestMaintenance

 /**
  * Determine whether the page is configured to be offline.
  *
  * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
  *   The event to process.
  */
 public function onKernelRequestMaintenance(GetResponseEvent $event)
 {
     $request = $event->getRequest();
     $route_match = RouteMatch::createFromRequest($request);
     $path = $request->attributes->get('_system_path');
     if ($this->maintenanceMode->applies($route_match)) {
         // If the site is offline, log out unprivileged users.
         if ($this->account->isAuthenticated() && !$this->maintenanceMode->exempt($this->account)) {
             user_logout();
             // Redirect to homepage.
             $event->setResponse(new RedirectResponse($this->url('<front>', [], ['absolute' => TRUE])));
             return;
         }
     }
     if ($this->account->isAuthenticated()) {
         if ($path == 'user/login') {
             // If the user is already logged in, redirect to their profile page.
             $event->setResponse($this->redirect('entity.user.canonical', ['user' => $this->account->id()]));
             return;
         }
         if ($path == 'user/register') {
             // If the user is already registered, redirect to their edit page.
             $event->setResponse(new RedirectResponse($this->url('entity.user.edit_form', ['user' => $this->account->id()], ['absolute' => TRUE])));
             return;
         }
     }
 }
开发者ID:anyforsoft,项目名称:csua_d8,代码行数:33,代码来源:MaintenanceModeSubscriber.php

示例4: logout_page

function logout_page()
{
    user_logout();
    header("Location: " . BASE_URL);
    /* Redirect browser */
    exit;
}
开发者ID:icheyne,项目名称:Dabr,代码行数:7,代码来源:index.php

示例5: cosign_cosignlogout

 public function cosign_cosignlogout()
 {
     $logout = CosignSharedFunctions::cosign_logout_url();
     user_logout();
     $response = new TrustedRedirectResponse($logout);
     //this had to be done of user was logged into cosign/drupal for several minutes after logging out
     //for ref - Cookie($name, $value, $minutes, $path, $domain, $secure, $httpOnly)
     //set value to nonsense and domain to blank so it becomes a host cookie.
     $response->headers->setCookie(new Cookie('cosign-' . $_SERVER['HTTP_HOST'], 'jibberish', 0, '/', '', -1, 0));
     return $response;
 }
开发者ID:bertrama,项目名称:cosign-drupal8,代码行数:11,代码来源:CosignController.php

示例6: ActionHandler

 function ActionHandler()
 {
     global $action;
     if ($action == 'login') {
         header('Location: ' . config_get('document-root') . '/login');
     }
     if ($action == 'logout') {
         user_logout();
         redirect();
     }
 }
开发者ID:Nazg-Gul,项目名称:gate,代码行数:11,代码来源:main.php

示例7: inicio

 public function inicio()
 {
     if (user_logout(FALSE)) {
         set_tema('titulo', 'HOME');
         set_tema('conteudo', '<div class="lager-12 columns"><p>Escolha um menu para iniciar</p></div>');
         load_template();
     } else {
         set_msg('errologin', 'Acesso restrito, faça login antes de prosseguir', 'error');
         redirect('usuarios/login');
     }
 }
开发者ID:glhrmfrts2,项目名称:Loja_Beit,代码行数:11,代码来源:painel.php

示例8: config_log_request

function config_log_request()
{
    if (!user_is_authenticated()) {
        return;
    }
    $allowed_users = file('invite.php');
    if (!in_array(strtolower(user_current_username()) . "\n", $allowed_users)) {
        user_logout();
        die("对不起,您不是受邀用户,无法登录。");
    }
}
开发者ID:noviachen,项目名称:netputweets,代码行数:11,代码来源:invitec.php

示例9: onKernelRequestMaintenance

 /**
  * Logout users if site is in maintenance mode.
  *
  * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
  *   The event to process.
  */
 public function onKernelRequestMaintenance(GetResponseEvent $event)
 {
     $request = $event->getRequest();
     $route_match = RouteMatch::createFromRequest($request);
     if ($this->maintenanceMode->applies($route_match)) {
         // If the site is offline, log out unprivileged users.
         if ($this->account->isAuthenticated() && !$this->maintenanceMode->exempt($this->account)) {
             user_logout();
             // Redirect to homepage.
             $event->setResponse($this->redirect($this->url('<front>')));
         }
     }
 }
开发者ID:ravibarnwal,项目名称:laraitassociate.in,代码行数:19,代码来源:MaintenanceModeSubscriber.php

示例10: main

function main()
{
    global $lang, $smarty;
    if (user_loggedin()) {
        if (isset($_GET['do']) && $_GET['do'] == 'logout') {
            user_logout();
            function myredirect()
            {
                login_redirect('index.php');
            }
            add_filter('wp_head', 'myredirect');
            $content = SHARED_TPLS . 'login_success.tpl';
        } elseif (user_loggedin()) {
            function myredirect()
            {
                login_redirect('index.php');
            }
            add_filter('wp_head', 'myredirect');
            $content = SHARED_TPLS . 'login_success.tpl';
        } else {
            utils_redirect();
        }
    } elseif (sess_remove('logout_done')) {
        function myredirect()
        {
            login_redirect('index.php');
        }
        add_filter('wp_head', 'myredirect');
        $content = SHARED_TPLS . 'login_success.tpl';
    } elseif (empty($_POST)) {
        $content = SHARED_TPLS . 'login.tpl';
    } else {
        // validate after a POST
        if (login_validate()) {
            utils_redirect('login.php');
        } else {
            $smarty->assign($_POST);
            $content = SHARED_TPLS . 'login.tpl';
        }
    }
    // Set page title and content
    // first parameter is Title, second is content.
    // Content can be both a shared tpl or raw html content; in this last case
    // you have to set the third optional parameter to true
    $smarty->assign('subject', $lang['login']['head']);
    $smarty->assign('content', $content);
}
开发者ID:mroussel,项目名称:flatpress,代码行数:47,代码来源:login.php

示例11: auth_start

function auth_start()
{
    if (!isset($_SESSION)) {
        set_time_limit(60);
        session_cache_limiter('private');
        session_start();
        set_time_limit(30);
    }
    if (isset($_SESSION['REMOTE_ADDR']) && $_SESSION['REMOTE_ADDR'] != $_SERVER['REMOTE_ADDR']) {
        session_regenerate_id();
        $_SESSION['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];
    }
    if (!isset($_SESSION['REMOTE_ADDR'])) {
        $_SESSION['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];
    }
    if (isset($_SESSION['site_key']) && $_SESSION['site_key'] != SITE_KEY) {
        user_logout();
    }
}
开发者ID:kingwang317,项目名称:it4fun-guam,代码行数:19,代码来源:auth.inc.php

示例12: auditoria

function auditoria($operacao, $observacao, $query = TRUE)
{
    $CI =& get_instance();
    $CI->load->library('session');
    $CI->load->model('auditoria_model', 'auditoria');
    if (user_logout(FALSE)) {
        $user_id = $CI->session->userdata('user_id');
        $user_login = $CI->usuarios->get_by_id($user_id)->row()->login;
    } else {
        $user_login = 'Desconhecido';
    }
    if ($query) {
        $last_query = $CI->db->last_query();
    } else {
        $last_query = '';
    }
    $dados = array('usuario' => $user_login, 'operacao' => $operacao, 'query' => $last_query, 'observacao' => $observacao);
    $CI->auditoria->do_insert($dados, FALSE);
}
开发者ID:glhrmfrts2,项目名称:Loja_Beit,代码行数:19,代码来源:funcoes_helper.php

示例13: logout

 /**
  * Logs the current user out.
  *
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  *   A redirection to home page.
  */
 public function logout()
 {
     user_logout();
     return $this->redirect('<front>');
 }
开发者ID:ravibarnwal,项目名称:laraitassociate.in,代码行数:11,代码来源:UserController.php

示例14: mysql_real_escape_string

                    break;
                }
                if (isset($_POST['username']) && isset($_POST['password'])) {
                    $username = mysql_real_escape_string(trim($_POST['username']));
                    $password = mysql_real_escape_string(trim($_POST['password']));
                    if (empty($username) or empty($password)) {
                        break;
                    }
                    $success = user_login($username, $password);
                }
                break;
            case 'logout':
                if (!user_isloggedin()) {
                    break;
                }
                $success = user_logout();
                break;
            default:
                break;
        }
    }
    if ($success) {
        echo 'success';
    } else {
        echo 'failed';
    }
    exit;
}
?>
<!DOCTYPE html>
<html>
开发者ID:fairuzan,项目名称:grinder,代码行数:31,代码来源:index.php

示例15: synlogout

 function synlogout($get, $post)
 {
     if (!API_SYNLOGOUT) {
         return API_RETURN_FORBIDDEN;
     }
     // drupal user logout
     chdir(DRUPAL_ROOT_PATH);
     require_once './includes/bootstrap.inc';
     drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
     $path = drupal_get_path('module', 'user');
     include_once $path . '/user.pages.inc';
     watchdog(t('user'), t('synlogout:@username /' . $GLOBALS['user']->name . '/' . $GLOBALS['user']->uid, array('@username' => 'SYN-star')));
     user_logout();
     watchdog(t('user'), t('synlogout:@username /' . $GLOBALS['user']->name . '/' . $GLOBALS['user']->uid, array('@username' => 'SYN-end')));
     return API_RETURN_SUCCEED;
 }
开发者ID:404pnf,项目名称:4u2u,代码行数:16,代码来源:uc.php


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