本文整理汇总了PHP中Security::logout方法的典型用法代码示例。如果您正苦于以下问题:PHP Security::logout方法的具体用法?PHP Security::logout怎么用?PHP Security::logout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Security
的用法示例。
在下文中一共展示了Security::logout方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logout
/**
* Logout current user
* Since the logout doesn't throw an error, we don't throw one either
*/
public function logout($message = array())
{
if ($member = Member::currentUser()) {
$security = new Security();
$security->logout(false);
}
return true;
}
示例2: logout
public function logout($redirect = true)
{
if (Session::get('Masquerade.Old.loggedInAs')) {
$oldSession = Session::get('Masquerade.Old');
Session::clear_all();
foreach ($oldSession as $name => $val) {
Session::set($name, $val);
}
if ($redirect && !$this->getResponse()->isFinished()) {
$this->redirectBack();
}
} else {
parent::logout($redirect);
}
}
示例3:
<?php
if (Security::logout()) {
echo "LOGOUT_SUCCESS";
} else {
echo "LOGOUT_FAILED";
}
示例4: logout
/**
* Log out form handler method
*
* This method is called when the user clicks on "logout" on the form
* created when the parameter <i>$checkCurrentUser</i> of the
* {@link __construct constructor} was set to TRUE and the user was
* currently logged in.
*/
public function logout()
{
$s = new Security();
$s->logout();
}
示例5: menuItems
<?php
session_start();
require_once "includes/Core.php";
require_once "includes/Database.php";
require_once "includes/Security.php";
$core = new Core();
$db = new Database();
$db->opendb();
$security = new Security($core, $db);
$user = $security->checksession();
if (!$user) {
$core->loadPage("login.php");
}
if (isset($_GET['logout'])) {
$security->logout();
}
function menuItems($items)
{
$menu = ["home" => ["text" => "Tickets", "link" => "?"], "newTicket" => ["text" => "Nieuwe ticket", "link" => "?newTicket"]];
for ($i = 0; $i < count($items); $i++) {
echo '<li class=""><md-button class="menu_item" href="' . $menu[$items[$i]]['link'] . '">' . $menu[$items[$i]]['text'] . '</md-button></li>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
示例6: logout
public function logout()
{
Security::logout(true);
}
示例7: LogoutAction
protected function LogoutAction()
{
Security::logout();
}
示例8: onBeforeWrite
/**
* Set VerificationString if not set
* If not verified log out user and display message.
*/
function onBeforeWrite()
{
parent::onBeforeWrite();
if (!$this->owner->VerificationString) {
$this->owner->VerificationString = MD5(rand());
}
if (!$this->owner->Verified) {
if (!$this->owner->VerificationEmailSent) {
if (!self::$hasOnBeforeWrite) {
self::$hasOnBeforeWrite = true;
$this->owner->sendemail($this->owner, false);
}
}
if (Member::currentUserID() && $this->owner->Email == Member::currentUser()->Email) {
Security::logout(false);
if (!is_null(Controller::redirectedTo())) {
$messageSet = array('default' => _t('EmailVerifiedMember.EMAILVERIFY', 'Please verify your email address by clicking on the link in the email before logging in.'));
}
Session::set("Security.Message.type", 'bad');
Security::permissionFailure(Controller::curr(), $messageSet);
} else {
return;
}
} else {
return;
}
}
示例9: logout
function logout()
{
Security::logout(false);
if (Member::currentUser()) {
$this->redirect("user-dashboard/");
} else {
$this->redirect("home/");
}
}
示例10: runCommand
public function runCommand($command, $usertype, $username, $directory)
{
$command = $this->cleanCommand($command);
if ($command[0] != '') {
$filesDirectory = new FilesDirectory();
$security = new Security();
switch ($command[0]) {
case 'authenticate':
$security->authenticate($username, $directory);
break;
case 'exit':
$security->logout();
break;
case 'ls':
$filesDirectory->ls($usertype, $username, str_replace('..', '', $directory));
break;
case 'mkdir':
if ($command[1] != '') {
$filesDirectory->mkdir($usertype, $username, str_replace('..', '', $directory), $command[1]);
} else {
echo 'directory empty.';
}
break;
case 'chkdir':
if ($command[1] != '') {
$filesDirectory->chkdir($username, str_replace('..', '', $directory), str_replace('..', '', $command[1]));
} else {
echo 'directory empty.';
}
break;
case 'chkfile':
if ($command[1] != '') {
$filesDirectory->chkfile($username, str_replace('..', '', $directory), str_replace('..', '', $command[1]));
} else {
echo 'file not found.';
}
break;
case 'rm':
if ($command[1] != '') {
$filesDirectory->rm($usertype, $username, str_replace('..', '', $directory), str_replace('..', '', $command[1]));
} else {
echo 'file not found.';
}
break;
case 'rmdir':
if ($command[1] != '') {
if (strtoupper($command[2]) == '-R') {
$filesDirectory->rmdir($usertype, $username, str_replace('..', '', $directory), str_replace('..', '', $command[1]), true);
} else {
$filesDirectory->rmdir($usertype, $username, str_replace('..', '', $directory), str_replace('..', '', $command[1]));
}
} else {
echo 'directory empty.';
}
break;
case 'cp':
if ($command[1] != '') {
$opt = strtoupper($command[3]);
if ($opt == '-IR' || $opt == '-RI') {
echo $filesDirectory->cp($usertype, $username, $command[1], $command[2], true, true);
} else {
if ($opt == '-I') {
echo $filesDirectory->cp($usertype, $username, $command[1], $command[2], true);
} else {
if ($opt == '-R') {
echo $filesDirectory->cp($usertype, $username, $command[1], $command[2], false, true);
} else {
echo $filesDirectory->cp($usertype, $username, $command[1], $command[2]);
}
}
}
} else {
echo 'directory empty.';
}
break;
case 'mv':
if ($command[1] != '') {
$opt = strtoupper($command[3]);
if ($opt == '-IR' || $opt == '-RI') {
echo $filesDirectory->mv($usertype, $username, $command[1], $command[2], true, true);
} else {
if ($opt == '-I') {
echo $filesDirectory->mv($usertype, $username, $command[1], $command[2], true);
} else {
if ($opt == '-R') {
echo $filesDirectory->mv($usertype, $username, $command[1], $command[2], false, true);
} else {
echo $filesDirectory->mv($usertype, $username, $command[1], $command[2]);
}
}
}
} else {
echo 'directory empty.';
}
break;
default:
echo 'command not found.';
}
}
}
示例11: require
* Copyright (c) 2005, 2011 Nalaka Jayasena <nalaka.jayasena@gmail.com>
*
* Pusthaka is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pusthaka is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Pusthaka. If not, see <http://www.gnu.org/licenses/>.
*/
$allow = "ALL";
include('../inc/init.php');
require('../classes/Security.php');
$sec = new Security;
if(isset($_REQUEST['btnLogin'])){
$sUsername = addslashes($_REQUEST["Username"]);
$sPassword = $_REQUEST["Password"];
$sec->login($sUsername, $sPassword);
} else { // Called directly, so logout!
$sec->logout();
}
?>
示例12: logout
/**
* ACTION /logout
* Logout the user and redirect to the basket.
*/
public static function logout()
{
$security = new Security();
$security->logout(false);
return $this->redirect($this->link());
}
示例13: logOut
/**
* This function is replacing the default SilverStripe Logout Form. This form is used to logout the customer and direct
* the user to the startpage
*
* @return null
*
* @author Oliver Scheer <oscheer@pixeltricks.de>
* @since 11.11.2010
*/
public function logOut()
{
Security::logout(false);
$frontPage = SilvercartPage_Controller::PageByIdentifierCode();
$this->redirect($frontPage->RelativeLink());
}
示例14: logout
/**
* Log the current member out and redirect to home page.
*/
public function logout()
{
Security::logout(false);
Director::redirect("home/");
}