本文整理汇总了PHP中user::logout方法的典型用法代码示例。如果您正苦于以下问题:PHP user::logout方法的具体用法?PHP user::logout怎么用?PHP user::logout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user
的用法示例。
在下文中一共展示了user::logout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$user = user::active();
user::logout();
log::info("user", t("User %name logged out", array("name" => $user->name)), html::anchor("user/{$user->id}", $user->name));
if ($this->input->get("continue")) {
url::redirect($this->input->get("continue"));
}
}
示例2: action_logout
public function action_logout()
{
if (user::logout()) {
notes::info('You have been logged out. See ya!');
user::redirect('');
} else {
notes::error('An error occured and you could not be logged in.');
user::redirect('');
}
}
示例3: logoutAction
public function logoutAction()
{
user::logout(false);
if (system::isAjax()) {
system::json(array('error' => 0));
} else {
if (!empty($_POST['back_url'])) {
system::redirect($_POST['back_url'], true);
} else {
system::redirect('/');
}
}
}
示例4: index
public function index()
{
access::verify_csrf();
$user = user::active();
user::logout();
log::info("user", t("User %name logged out", array("name" => p::clean($user->name))), html::anchor("user/{$user->id}", p::clean($user->name)));
if ($this->input->get("continue")) {
$item = url::get_item_from_uri($this->input->get("continue"));
if (access::can("view", $item)) {
url::redirect($this->input->get("continue"));
} else {
url::redirect("");
}
}
}
示例5: index
public function index()
{
//access::verify_csrf();
$user = user::active();
user::logout();
log::info("user", t("User %name logged out", array("name" => p::clean($user->name))), html::anchor("user/{$user->id}", p::clean($user->name)));
if ($continue_url = $this->input->get("continue")) {
$item = url::get_item_from_uri($continue_url);
if (access::can("view", $item)) {
// Don't use url::redirect() because it'll call url::site() and munge the continue url.
header("Location: {$continue_url}");
} else {
url::redirect("albums/1");
}
}
}
示例6: login
function login($login, $password)
{
user::logout();
if (!($record = user::_get_identity_record($login, $password))) {
return false;
}
user::_set_session_attribute('is_logged_in', true);
user::_set_session_attribute('id', $record['id']);
user::_set_session_attribute('node_id', $record['node_id']);
user::_set_session_attribute('login', $login);
user::_set_session_attribute('email', $record['email']);
user::_set_session_attribute('name', $record['name']);
user::_set_session_attribute('lastname', $record['lastname']);
user::_set_session_attribute('password', $record['password']);
user::_set_session_groups();
return true;
}
示例7: loginAuth
public static function loginAuth($from)
{
//check token remember me
//check session
$db = new database(DBTYPE, DBHOST, DBNAME, DBUSER, DBPASS);
if (cookie::exists(TOKEN_NAME)) {
$token = cookie::get(TOKEN_NAME);
$checkExist = user::checkExist("users_session", "token = '{$token}'");
if ($checkExist) {
$sessionData = $db->select("users_session", "*", "token = '{$token}'", "fetch");
$agent_id = $sessionData['agent_id'];
user::login($agent_id);
$userData = $db->select("user_accounts", "*", "agent_id = '{$agent_id}'", "fetch");
if ($from == 'login') {
self::accountCheck($userData);
redirect::to("dashboard");
} else {
self::accountCheck($userData);
}
} else {
user::logout();
}
} elseif (session::exist(AGENT_LOGIN_SESSION) && session::exist(AGENT_SESSION_NAME)) {
$agent_id = session::get(AGENT_SESSION_NAME);
$check_agentExist = user::checkExist("user_accounts", "agent_id = '{$agent_id}'");
$userData = $db->select("user_accounts", "*", "agent_id = '{$agent_id}'", "fetch");
if (!$check_agentExist) {
user::logout();
}
user::login($agent_id);
if ($from == 'login') {
self::accountCheck($userData);
redirect::to("dashboard");
} else {
self::accountCheck($userData);
}
} else {
if ($from != 'login') {
user::logout();
}
}
}
示例8: ___onTarget
function ___onTarget()
{
if ($_REQUEST['action'] == 'register') {
$GLOBALS['core']->event('register');
//validation
if (empty($_REQUEST['username'])) {
$GLOBALS['err']->add("Name can't be blank.", array('username', 'register'));
}
if (user::exists($_REQUEST['username'])) {
$GLOBALS['err']->add("Name already exists. choose another.", array('username', 'register'));
}
if (empty($_REQUEST['password1'])) {
$GLOBALS['err']->add("Password can't be blank.", array('password1', 'register'));
} elseif ($_REQUEST['password1'] != $_REQUEST['password2']) {
$GLOBALS['err']->add("Passwords don't match.", array('password2', 'register'));
} elseif ($_REQUEST['password1'] == $_REQUEST['password2'] && $GLOBALS['err']->none()) {
//logout first, just in case
if (user::whoAmI() == 'temp') {
user::logout();
}
if (user::register($_REQUEST['username'], $_REQUEST['password1'])) {
session_regenerate_id();
//sort of prevent session-hijacking
$_REQUEST['password'] = $_REQUEST['password1'];
$_REQUEST['action'] = 'login';
$GLOBALS['state'] = 'successful registration';
$GLOBALS['core']->event('registrationSuccess');
} else {
$GLOBALS['err']->add("Unable to register for some reason. Please let us know about it.", 'registration');
$GLOBALS['core']->event('registrationFailure');
}
}
}
if ($_REQUEST['action'] == 'login') {
$GLOBALS['core']->event('login');
if (empty($_REQUEST['username'])) {
$GLOBALS['err']->add("You left out the name.", array('username', 'login'));
}
if (empty($_REQUEST['password'])) {
$GLOBALS['err']->add("You left out the password.", array('password', 'login'));
}
if (!empty($_REQUEST['username']) && !empty($_REQUEST['password'])) {
if (!user::login($_REQUEST['username'], $_REQUEST['password'])) {
$GLOBALS['err']->add("Wrong.", 'login');
} else {
$loginSuccess = true;
session_regenerate_id();
//prevent session hijacking.
}
}
$GLOBALS['core']->event($loginSuccess ? 'loginSuccess' : 'loginFailure');
}
if ($_REQUEST['action'] == 'logout') {
$GLOBALS['core']->event('logout');
session_regenerate_id(true);
//kill old session.
user::logout();
header("Location: /");
exit;
}
if (!user::loggedIn()) {
//login as temp user
//user::loginTemp();
}
}
示例9: logout
public function logout()
{
user::logout();
}
示例10: onLogoutBtn
function onLogoutBtn($info)
{
$u = new user("");
$u->logout();
$this->balance = 0;
$this->_bookframe("frmMain");
}
示例11: login
<?php
//Для класса User из предыдущего занятия создать методы login(), logout(), которые просто выводят на экран соответствующее сообщение. Создать экземпляр класса, вызвать созданные методы.
class user
{
public $login;
public $password;
public $email;
public $rating = 0;
public function login()
{
echo "Login is " . $this->login . "<br>";
}
public function logout($something)
{
echo "Something about logout - " . $something;
}
}
$Max = new user();
$Max->login = "MMaaxx";
$Max->login();
$Max->logout("blablabla");
示例12: _clean_up
function _clean_up()
{
parent::_clean_up();
purge_cache();
user::logout();
}
示例13: API_logout
public function API_logout()
{
user::logout();
iPHP::code(1, 0, $this->forward, 'json');
}
示例14: tearDown
function tearDown()
{
$this->_clean_up();
debug_mock::tally();
user::logout();
}
示例15: uniqid
ob_start();
//get unique id
$up_id = uniqid();
?>
<?php
include_once 'config.inc.php';
session_start();
include_once 'classes/Users.class.php';
$usr = new user();
$usr->check_login();
$usr->check_if_logged();
if (isset($_GET['l'])) {
unset($_GET['l']);
$usr->logout();
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="styles/style_admin.css" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<!-- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> -->
<title>kerwa.pl</title>
</head>
<body>