当前位置: 首页>>代码示例>>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;未经允许,请勿转载。