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


PHP Security::logout方法代码示例

本文整理汇总了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;
 }
开发者ID:silverstripe-supervillains,项目名称:silverstripe-origami,代码行数:12,代码来源:UserOrigamiApi.php

示例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);
     }
 }
开发者ID:dhensby,项目名称:silverstripe-masquerade,代码行数:15,代码来源:MasqueradeSecurityController.php

示例3:

<?php

if (Security::logout()) {
    echo "LOGOUT_SUCCESS";
} else {
    echo "LOGOUT_FAILED";
}
开发者ID:carlosrodriguesf,项目名称:adeushomonios,代码行数:7,代码来源:logout.php

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

示例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">
开发者ID:marijnkoel,项目名称:StendenProject2,代码行数:31,代码来源:index.php

示例6: logout

 public function logout()
 {
     Security::logout(true);
 }
开发者ID:rbowen,项目名称:openstack-org,代码行数:4,代码来源:Page.php

示例7: LogoutAction

 protected function LogoutAction()
 {
     Security::logout();
 }
开发者ID:bosoy83,项目名称:keywords-analyzer,代码行数:4,代码来源:FrontController.php

示例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;
     }
 }
开发者ID:helpfulrobot,项目名称:exadium-emailverifiedmember,代码行数:31,代码来源:EmailVerifiedMember.php

示例9: logout

 function logout()
 {
     Security::logout(false);
     if (Member::currentUser()) {
         $this->redirect("user-dashboard/");
     } else {
         $this->redirect("home/");
     }
 }
开发者ID:hemant-chakka,项目名称:awss,代码行数:9,代码来源:Page.php

示例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.';
         }
     }
 }
开发者ID:jokopurnomoa,项目名称:OSJ-X,代码行数:100,代码来源:Controller.php

示例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();
	}
?>
开发者ID:nalaka,项目名称:pusthaka1,代码行数:31,代码来源:_login.php

示例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());
 }
开发者ID:micschk,项目名称:torindul-silverstripe-shop,代码行数:10,代码来源:Store_Controller.php

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

示例14: logout

 /**
  * Log the current member out and redirect to home page.
  */
 public function logout()
 {
     Security::logout(false);
     Director::redirect("home/");
 }
开发者ID:helpfulrobot,项目名称:swipestripe-swipestripe,代码行数:8,代码来源:AccountPage.php


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