• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP user_logout函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: twitter_process

function twitter_process($url, $post_data = false)
{
    if ($post_data === true) {
        $post_data = array();
    }
    if (user_type() == 'oauth' && (strpos($url, '/twitter.com') !== false || strpos($url, 'api.twitter.com') !== false)) {
        user_oauth_sign($url, $post_data);
    } elseif (strpos($url, 'api.twitter.com') !== false && is_array($post_data)) {
        // Passing $post_data as an array to twitter.com (non-oauth) causes an error :(
        $s = array();
        foreach ($post_data as $name => $value) {
            $s[] = $name . '=' . urlencode($value);
        }
        $post_data = implode('&', $s);
    }
    $api_start = microtime(1);
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    if ($post_data !== false && !$_GET['page']) {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    }
    if (user_type() != 'oauth' && user_is_authenticated()) {
        curl_setopt($ch, CURLOPT_USERPWD, user_current_username() . ':' . $GLOBALS['user']['password']);
    }
    //from  http://github.com/abraham/twitteroauth/blob/master/twitteroauth/twitteroauth.php
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);
    $response = curl_exec($ch);
    $response_info = curl_getinfo($ch);
    $erno = curl_errno($ch);
    $er = curl_error($ch);
    curl_close($ch);
    global $api_time;
    $api_time += microtime(1) - $api_start;
    switch (intval($response_info['http_code'])) {
        case 200:
        case 201:
            $json = json_decode($response);
            if ($json) {
                return $json;
            }
            return $response;
        case 401:
            user_logout();
            theme('error', "<p>Error: Login credentials incorrect.</p><p>{$response_info['http_code']}: {$result}</p><hr><p>{$url}</p>");
        case 0:
            $result = $erno . ":" . $er . "<br />";
            /*
            			 foreach ($response_info as $key => $value)
            			 {
            $result .= "Key: $key; Value: $value<br />";
            }
            */
            theme('error', '<h2>Twitter timed out</h2><p>Dabr gave up on waiting for Twitter to respond. They\'re probably overloaded right now, try again in a minute. <br />' . $result . ' </p>');
        default:
            $result = json_decode($response);
            $result = $result->error ? $result->error : $response;
            if (strlen($result) > 500) {
                $result = 'Something broke on Twitter\'s end.';
                /*
                				 $result .= $erno . ":" . $er . "<br />" ;
                				 foreach ($response_info as $key => $value)
                				 {
                $result .= "Key: $key; Value: $value<br />";
                }
                */
            }
            theme('error', "<h2>An error occured while calling the Twitter API</h2><p>{$response_info['http_code']}: {$result}</p><hr><p>{$url}</p>");
    }
}
开发者ID:hnprashanth,项目名称:dabr-installer,代码行数:74,代码来源:twitter.php


示例17: logout

 /**
  * @inheritDoc
  */
 public function logout()
 {
     module_load_include('inc', 'user', 'user.pages');
     user_logout();
 }
开发者ID:scardinius,项目名称:civicrm-core,代码行数:8,代码来源:Backdrop.php


示例18: list

// Grab the action (login or logout).
$action = '';
if (isset($_GET['action'])) {
    $action = $_GET['action'];
} else {
    if (isset($_POST['action'])) {
        $action = $_POST['action'];
    }
}
// Login and/or logout.
list($username, $password, $invalid_login) = user_login();
if ($action != 'login') {
    $invalid_login = false;
}
if ($action == 'logout' || $invalid_login) {
    list($username, $password) = user_logout();
}
if (ini_get('max_execution_time') < 60) {
    @ini_set('max_execution_time', '60');
}
// Pull the calendars off the GET line if provided. The $cal_filename
// is always an array, because this makes it easier to deal with below.
$cal_filenames = array();
if (isset($_GET['cal']) && $_GET['cal'] != '') {
    // If the cal value is not an array, split it into an array on
    // commas.
    if (!is_array($_GET['cal'])) {
        $_GET['cal'] = explode(',', $_GET['cal']);
    }
    // Grab the calendar filenames off the cal value array.
    $cal_filenames = $_GET['cal'];
开发者ID:bilsan,项目名称:schedule-generator,代码行数:31,代码来源:init.inc.php


示例19: load_page

/**
 * Used to load the requested page from POST or GET
 * @global type $input
 */
function load_page()
{
    global $input;
    $action = $input['action'];
    $redraw = false;
    //
    // Actions
    //
    // Controller goes here
    switch ($action) {
        // The user clicked on an album, we display its content to them
        // Display the help page
        case 'view_help':
            view_help();
            break;
        case 'view_settings':
            view_settings();
            break;
            // In case we want to log out
        // In case we want to log out
        case 'logout':
            user_logout();
            break;
            // The only case when we could possibly arrive here with a session created
            // and a "login" action is when the user refreshed the page. In that case,
            // we redraw the page with the last information saved in the session variables.
        // The only case when we could possibly arrive here with a session created
        // and a "login" action is when the user refreshed the page. In that case,
        // we redraw the page with the last information saved in the session variables.
        case 'login':
            redraw_page();
            break;
        case 'anonymous_login':
            anonymous_login();
            break;
        case 'admin_mode_update':
            admin_mode_update();
            break;
        case 'view_album_assets':
            view_album_assets();
            break;
        case 'view_asset_details':
            view_asset_details();
            break;
        case 'view_asset_bookmark':
            view_asset_bookmark();
            break;
        case 'search_bookmark':
            bookmarks_search();
            break;
        case 'sort_asset_bookmark':
            bookmarks_sort();
            break;
        case 'add_asset_bookmark':
            bookmark_add();
            break;
        case 'add_asset_thread':
            thread_add();
            break;
        case 'add_thread_comment':
            comment_add();
            break;
        case 'add_thread_comment_answer':
            comment_add_reply();
            break;
        case 'update_thread_comment':
            comment_edit();
            break;
        case 'update_asset_thread':
            thread_edit();
            break;
        case 'thread_details_view':
            thread_details_update();
            break;
        case 'delete_asset_thread':
            thread_delete();
            break;
        case 'delete_thread_comment':
            comment_delete();
            break;
        case 'edit_settings':
            preferences_update();
            break;
        case 'edit_asset_meta':
            asset_edit_meta();
            break;
        case 'vote':
            vote_add();
            break;
        case 'approve':
            comment_edit_approval();
            break;
        case 'threads_list_view':
            threads_list_update();
            break;
        case 'copy_bookmark':
//.........这里部分代码省略.........
开发者ID:jingyexu,项目名称:ezcast,代码行数:101,代码来源:web_index.php


示例20: logout

 /**
  * 退出处理
  */
 public function logout()
 {
     session_start();
     user_logout();
 }
开发者ID:badxchen,项目名称:KODExplorer,代码行数:8,代码来源:user.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP user_md5函数代码示例发布时间:2022-05-23
下一篇:
PHP user_login_string函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap