當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Users::logout方法代碼示例

本文整理匯總了PHP中Users::logout方法的典型用法代碼示例。如果您正苦於以下問題:PHP Users::logout方法的具體用法?PHP Users::logout怎麽用?PHP Users::logout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Users的用法示例。


在下文中一共展示了Users::logout方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testUserRoles

 public function testUserRoles()
 {
     $app = new Users();
     $app->ds->loadMock('users', APP_ROOT . 'data/users.txt');
     $app->login('linda@mail.com', '1234');
     $this->assertEquals($_SESSION["user_roles"], 2);
     $app->logout();
     $this->assertEquals($_SESSION["user_roles"], null);
 }
開發者ID:giraldomauricio,項目名稱:phpXelerator5,代碼行數:9,代碼來源:usersTest.php

示例2: main

 /**
  * Sandbox main function
  */
 public static function main()
 {
     // Get users table
     Users::$users = new Table('users');
     // Logout
     if (Uri::segment(1) == 'logout') {
         Users::logout();
     }
 }
開發者ID:rowena-altastratus,項目名稱:altastratus,代碼行數:12,代碼來源:users.plugin.php

示例3: __construct

 public function __construct($userId = 0)
 {
     $this->_db = DB::instance();
     if (empty($userId)) {
         if (Session::exists(Config::get('session/loggedId'))) {
             if ($this->setData(Session::get(Config::get('session/loggedId')))) {
                 $this->_loggedIn = true;
             } else {
                 Users::logout();
             }
         }
     } else {
         $this->setData($userId);
     }
 }
開發者ID:Wicloz,項目名稱:UniversityWebsite,代碼行數:15,代碼來源:User.php

示例4: testUserRoles

 public function testUserRoles()
 {
     $app = new Users();
     $data = new data_source_mysqli();
     $data->config = self::$config;
     $data->connect("");
     $app->ds = $data;
     $data->index_field = "user_id";
     $app->login('linda@mail.com', '1234');
     $this->assertEquals($_SESSION["user_roles"], 2);
     $app->logout();
     $this->assertEquals($_SESSION["user_roles"], null);
 }
開發者ID:giraldomauricio,項目名稱:phpXelerator5,代碼行數:13,代碼來源:mysqlTest.php

示例5: testUserDataMethodWithUID

 /**
  * Tests fetching user's data by calling ::userData with UID argument
  * 
  * (currently it's hardcoded to always return admin's data, since there are no other users)
  */
 public function testUserDataMethodWithUID()
 {
     Users::logout();
     $this->assertEquals(self::userData(), Users::userData(0));
     Users::login('radex', 'qwerty');
     $this->assertEquals(self::userData(), Users::userData(1));
 }
開發者ID:radex,項目名稱:Watermelon,代碼行數:12,代碼來源:UsersTest.php

示例6: logout

 public function logout()
 {
     Users::logout();
     return Response::redirect($this->admin_url . '/login');
 }
開發者ID:rubenvincenten,項目名稱:anchor-site,代碼行數:5,代碼來源:users.php

示例7: Users

<?php

session_start();
include_once 'functions.php';
$user = new Users();
$id = $_SESSION['id'];
if (!$user->session()) {
    header('Location: index.php');
}
if ($_GET['q'] == "logout") {
    $user->logout();
    header('Location: index.php');
}
?>
<h1>Welcome to RubyCMS!</h1>
<p>Although RubyCMS is in pre-alpha development will continue till the developer feels like the CMS is fully complete.
So expect a lot of bugs and please report any bugs to the developer. If you want to logout just click the link below.
Thanks for using RubyCMS, come back any time you want!</p>
<a href="?q=logout">Logout</a>
開發者ID:Dayron1234,項目名稱:RubyCMS,代碼行數:19,代碼來源:homepage.php

示例8: signOutAction

 function signOutAction()
 {
     global $site;
     Users::logout();
     $site->redirectTo($site->urlTo('/experiments/norm-user'));
 }
開發者ID:TheWebChimp,項目名稱:hummingbird-labs,代碼行數:6,代碼來源:user.controller.php

示例9: cc_logout

/**
 * Logs the user out and redirects them to the home page.
 */
function cc_logout()
{
    Users::logout();
    cc_redirect("", true);
    exit;
}
開發者ID:alecgorge,項目名稱:TopHat,代碼行數:9,代碼來源:cc-users.php

示例10: logout_action

 function logout_action()
 {
     Users::logout();
     SiteRedirect();
 }
開發者ID:radex,項目名稱:Watermelon,代碼行數:5,代碼來源:users.controller.php

示例11: dirname

<?php

/**
 * Created by PhpStorm.
 * User: renan
 * Date: 07/09/15
 * Time: 19:17
 */
header('Content-Type: text/html; charset=utf8');
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(__DIR__));
include ROOT . DS . 'config/Config.php';
include ROOT . DS . 'src/Users.php';
$users = new Users(new Config());
$users->logout();
開發者ID:renanpantoja,項目名稱:r,代碼行數:15,代碼來源:logout.php

示例12: logout

 public function logout()
 {
     $user = new Users();
     $user->logout();
     header("Location: " . SITE_URL . "/login");
 }
開發者ID:WWAHIDAADNAN,項目名稱:JUSTAS,代碼行數:6,代碼來源:login_model.php

示例13: index

 public function index()
 {
     Users::logout();
     Redirect::to(ROOT_URL . 'admincp');
 }
開發者ID:neworldwebsites,項目名稱:noblessecms,代碼行數:5,代碼來源:controlLogout.php

示例14: Users

<?php

include_once 'class/user.php';
$obj = new Users();
$obj->table = 'users';
$obj->connect();
if (isset($_GET['logout'])) {
    echo $obj->logout();
}
echo $obj->display_logout();
開發者ID:adriangaro,項目名稱:Rotary,代碼行數:10,代碼來源:logout.php

示例15: BasePage

 function BasePage()
 {
     @session_start();
     if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc() || ini_get('magic_quotes_sybase')) {
         foreach ($_GET as $k => $v) {
             $_GET[$k] = is_array($v) ? array_map("stripslashes", $v) : stripslashes($v);
         }
         foreach ($_POST as $k => $v) {
             $_POST[$k] = is_array($v) ? array_map("stripslashes", $v) : stripslashes($v);
         }
         foreach ($_REQUEST as $k => $v) {
             $_REQUEST[$k] = is_array($v) ? array_map("stripslashes", $v) : stripslashes($v);
         }
         foreach ($_COOKIE as $k => $v) {
             $_COOKIE[$k] = is_array($v) ? array_map("stripslashes", $v) : stripslashes($v);
         }
     }
     // set site variable
     $s = new Sites();
     $this->site = $s->get();
     $this->smarty = new Smarty();
     if ($this->site->style != "default") {
         $this->smarty->addTemplateDir(WWW_DIR . 'templates/' . $this->site->style . '/views/frontend', 'style_frontend');
     }
     $this->smarty->addTemplateDir(WWW_DIR . 'templates/default/views/frontend', 'frontend');
     $this->smarty->setCompileDir(SMARTY_DIR . 'templates_c' . DIRECTORY_SEPARATOR);
     $this->smarty->setConfigDir(SMARTY_DIR . 'configs' . DIRECTORY_SEPARATOR);
     $this->smarty->setCacheDir(SMARTY_DIR . 'cache' . DIRECTORY_SEPARATOR);
     $this->smarty->error_reporting = E_ALL - E_NOTICE;
     $this->secure_connection = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443;
     if (file_exists(WWW_DIR . 'templates/' . $this->site->style . '/theme.php')) {
         require_once WWW_DIR . 'templates/' . $this->site->style . '/theme.php';
     }
     $this->smarty->assign('themevars', isset($themevars) ? $themevars : null);
     $servername = null;
     if (defined('EXTERNAL_PROXY_IP') && defined('EXTERNAL_HOST_NAME') && isset($_SERVER["REMOTE_ADDR"]) && $_SERVER["REMOTE_ADDR"] == EXTERNAL_PROXY_IP) {
         $servername = EXTERNAL_HOST_NAME;
     } elseif (isset($_SERVER["SERVER_NAME"])) {
         $servername = $_SERVER["SERVER_NAME"];
     }
     if ($servername != "") {
         $this->serverurl = ($this->secure_connection ? "https://" : "http://") . $servername . ($_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443" ? ":" . $_SERVER["SERVER_PORT"] : "") . WWW_TOP . '/';
         $this->smarty->assign('serverroot', $this->serverurl);
     }
     $this->page = isset($_GET['page']) ? $_GET['page'] : 'content';
     $users = new Users();
     if ($users->isLoggedIn()) {
         $this->userdata = $users->getById($users->currentUserId());
         //
         // user can still be logged in but have been disabled by admin, so if they are, log them off
         //
         if ($this->userdata["role"] == Users::ROLE_DISABLED) {
             $users->logout();
             $this->show403();
         }
         $this->userdata["categoryexclusions"] = $users->getCategoryExclusion($users->currentUserId());
         //update lastlogin every 15 mins
         if (strtotime($this->userdata['now']) - 900 > strtotime($this->userdata['lastlogin'])) {
             $users->updateSiteAccessed($this->userdata['ID']);
         }
         $this->smarty->assign('userdata', $this->userdata);
         $this->smarty->assign('loggedin', "true");
         if (!empty($this->userdata['nzbvortex_api_key']) && !empty($this->userdata['nzbvortex_server_url'])) {
             $this->smarty->assign('weHasVortex', true);
         }
         $sab = new SABnzbd($this);
         if ($sab->integrated !== false && $sab->url != '' && $sab->apikey != '') {
             $this->smarty->assign('sabintegrated', $sab->integrated);
             $this->smarty->assign('sabapikeytype', $sab->apikeytype);
         }
         $nzbget = new NZBGet($this);
         if ($nzbget->integrated !== false && $nzbget->url != '') {
             $this->smarty->assign('nzbgetintegrated', $nzbget->integrated);
         }
         if ($this->userdata["role"] == Users::ROLE_ADMIN) {
             $this->smarty->assign('isadmin', "true");
         }
         if ($this->userdata["hideads"] == "1") {
             $this->site->adheader = "";
             $this->site->adbrowse = "";
             $this->site->addetail = "";
         }
         $this->floodCheck($this->userdata["role"]);
     } else {
         $this->smarty->assign('isadmin', "false");
         $this->smarty->assign('loggedin', "false");
         $this->floodCheck();
     }
     $this->smarty->assign('site', $this->site);
     $this->smarty->assign('page', $this);
 }
開發者ID:scriptzteam,項目名稱:newzNZB-premium-indexer,代碼行數:91,代碼來源:basepage.php


注:本文中的Users::logout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。