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


PHP user::logout方法代码示例

本文整理汇总了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"));
     }
 }
开发者ID:xafr,项目名称:gallery3,代码行数:9,代码来源:logout.php

示例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('');
     }
 }
开发者ID:artbypravesh,项目名称:morningpages,代码行数:10,代码来源:User.php

示例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('/');
         }
     }
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:13,代码来源:controller.php

示例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("");
         }
     }
 }
开发者ID:hiwilson,项目名称:gallery3,代码行数:15,代码来源:logout.php

示例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");
         }
     }
 }
开发者ID:jasonhight,项目名称:gallery3,代码行数:16,代码来源:logout.php

示例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;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:17,代码来源:user.class.php

示例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();
         }
     }
 }
开发者ID:kronxblue,项目名称:1stg,代码行数:42,代码来源:session.php

示例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();
     }
 }
开发者ID:slact,项目名称:webylene-php,代码行数:65,代码来源:security.php

示例9: logout

 public function logout()
 {
     user::logout();
 }
开发者ID:reang,项目名称:Dingo-Framework,代码行数:4,代码来源:user.php

示例10: onLogoutBtn

 function onLogoutBtn($info)
 {
     $u = new user("");
     $u->logout();
     $this->balance = 0;
     $this->_bookframe("frmMain");
 }
开发者ID:rezamoussavi,项目名称:MouRe,代码行数:7,代码来源:viewslogin.php

示例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");
开发者ID:tgamanov,项目名称:php-examples,代码行数:22,代码来源:9.class_obj_methods.php

示例12: _clean_up

 function _clean_up()
 {
     parent::_clean_up();
     purge_cache();
     user::logout();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:6,代码来源:test_artlimb.php

示例13: API_logout

 public function API_logout()
 {
     user::logout();
     iPHP::code(1, 0, $this->forward, 'json');
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:5,代码来源:user.app.php

示例14: tearDown

 function tearDown()
 {
     $this->_clean_up();
     debug_mock::tally();
     user::logout();
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:6,代码来源:__site_object_manipulation.test.php

示例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>
开发者ID:paul-herrmann,项目名称:kerwa,代码行数:31,代码来源:admin.php


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