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


PHP Authentication::logUserOut方法代码示例

本文整理汇总了PHP中Authentication::logUserOut方法的典型用法代码示例。如果您正苦于以下问题:PHP Authentication::logUserOut方法的具体用法?PHP Authentication::logUserOut怎么用?PHP Authentication::logUserOut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Authentication的用法示例。


在下文中一共展示了Authentication::logUserOut方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: switch

     break;
     // Authentication
 // Authentication
 case "auth":
     if (isset($_GET['action'])) {
         switch ($_GET['action']) {
             case "login":
                 if (isset($_POST['username']) && isset($_POST['password'])) {
                     Authentication::logUserIn($_POST['username'], $_POST['password']);
                 } else {
                     header(ROOT . "user.php?mode=auth&action=login");
                 }
                 Authentication::blockPageToVisitors();
                 break;
             case "logout":
                 Authentication::logUserOut();
                 break;
         }
     }
     break;
 case "suspended":
     if (isset($_SESSION['user_id_suspended'])) {
         $sql = "SELECT * FROM `users` WHERE user_id = '" . $_SESSION['user_id_suspended'] . "'";
         $result = openRailwayCore::dbQuery($sql);
         $user = mysql_fetch_assoc($result);
         if ($user['suspended'] == 1) {
             openRailwayCore::pageHeader("Account suspended");
             $template = new Template();
             $template->set_custom_template(FROOT . "theme/" . STYLE, 'default');
             $template->set_filenames(array('body' => 'suspended.html'));
             $template->display('body');
开发者ID:ralphchadkirk,项目名称:openRailway,代码行数:31,代码来源:user.php

示例2: Template

<?php

Authentication::accessLevelController(8, '>');
// Deal with logout form
if (isset($_GET['action']) && $_GET['action'] == "force" && isset($_POST['uid'])) {
    Authentication::logUserOut($_POST['uid'], openRailwayCore::createInteractionIdentifier(), 1);
}
$sql = "SELECT * FROM `sessions`";
$result = openRailwayCore::dbQuery($sql);
$main = new Template();
$main->set_custom_template("includes/", 'default');
$main->assign_var('ROOT', ROOT);
while ($sessions = mysql_fetch_assoc($result)) {
    $ipGeoLoc = array();
    $ipGeoLoc = Authentication::checkIPLocation($sessions['user_ip']);
    if ($ipGeoLoc['town'] == '') {
        $geoLoc = null;
    } else {
        $geoLoc = $ipGeoLoc['town'] . ", " . $ipGeoLoc['state'] . ", " . $ipGeoLoc['country'];
    }
    $main->assign_block_vars('usr_sess', array('SESSID' => $sessions['session_id'], 'LOGIN' => date("d-M-Y H:i:s", $sessions['log_in_time']), 'LASTACTIVE' => date("d-M-Y H:i:s", $sessions['last_active_time']), 'UID' => $sessions['user_id'], 'SID' => $sessions['staff_id'], 'IP' => $sessions['user_ip'], 'GEOLOC' => $geoLoc, 'UA' => $sessions['user_agent'], 'SAL' => $sessions['session_access_level']));
}
$main->set_filenames(array('main' => "usr_sess.html"));
$main->display('main');
开发者ID:ralphchadkirk,项目名称:openRailway,代码行数:24,代码来源:usr_sess.php

示例3: suspendUser

 /**
  * Suspends a user account
  * @param integer $uid The user account to suspend
  */
 public static function suspendUser($uid, $interaction = null, $system = null)
 {
     if (!isset($interaction)) {
         $interaction = openRailwayCore::createInteractionIdentifier();
     }
     $sql = "UPDATE `users` SET `suspended` = '1' WHERE user_id = '" . $uid . "'";
     $result = openRailwayCore::dbQuery($sql);
     if ($system == 1) {
         $eventString = "User (UID: " . $uid . ") suspended by openRailway system";
         Authentication::logUserOut($uid, $interaction, 1);
     } else {
         $eventString = "User (UID: " . $uid . ") suspended by user (UID: " . $_SESSION['user_id'] . ")";
         Authentication::logUserOut($uid, $interaction, 0);
     }
     openRailwayCore::logEvent(time(), $interaction, $_SESSION['user_id'], 5, 1, $eventString);
 }
开发者ID:ralphchadkirk,项目名称:openRailway,代码行数:20,代码来源:auth.class.php


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