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


PHP Authorization::logout方法代码示例

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


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

示例1: Start

 static function Start($auth = [])
 {
     $called_class = get_called_class();
     if (count($auth)) {
         $where = [];
         foreach ($auth as $k => $v) {
             $where[] = "`" . es($k) . "` = '" . es($v) . "'";
         }
         $res = q("\n\t\t\t\tSELECT `access`" . (count($called_class::$datas) ? ',`' . implode('`,`', $called_class::$datas) . '`' : '') . "\n\t\t\t\tFROM `fw_users`\n\t\t\t\tWHERE " . implode(" AND ", $where) . "\n\t\t\t");
         if (!$res->num_rows) {
             Authorization::logout();
             redirect('/');
         }
         $row = $res->fetch_assoc();
         if ($row['access'] != 1) {
             Authorization::logout();
             $_SESSION['error'] = 'no-access';
             redirect('/');
         }
         foreach ($called_class::$datas as $k => $v) {
             $called_class::${$v} = $row[$v];
             // unset($row[$v]); -- Раскомментировать после обновления функционала на сайте
         }
         if (count($row)) {
             self::$data = $row;
         }
     } elseif (isset($_COOKIE['autologinid'], $_COOKIE['autologinhash'])) {
         $auth = new Authorization();
         if (!$auth->authByHash($_COOKIE['autologinid'], $_COOKIE['autologinhash'])) {
             Authorization::logout();
             redirect('/');
         }
     }
     if (!empty(self::$data['id']) && !empty(self::$autoupdate)) {
         q("\n\t\t\t\tUPDATE `fw_users` SET\n\t\t\t\t`browser` = '" . (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '') . "',\n\t\t\t\t`ip` = '" . es($_SERVER['REMOTE_ADDR']) . "'\n\t\t\t\tWHERE `id` = " . (int) self::$data['id'] . "\n\t\t\t");
     }
 }
开发者ID:schoolphp,项目名称:library,代码行数:37,代码来源:User.php

示例2: logout

 /**
  * logout es para finalizar sesion.
  */
 public function logout()
 {
     $auth = new Authorization();
     $auth->logout();
 }
开发者ID:salvaroad,项目名称:examen,代码行数:8,代码来源:usuariosController.php

示例3: logout

 public function logout()
 {
     /**
      * function to logout of the session
      * @return void
      */
     $auth = new Authorization();
     $auth->logout();
 }
开发者ID:karhega,项目名称:framework,代码行数:9,代码来源:usuariosController.php

示例4: Authorization

<?php

require_once 'classes/authorization.class.php';
$logout = new Authorization();
$logout->logout();
echo '<meta http-equiv=refresh content="0; URL=index.php">';
开发者ID:GeoPvN,项目名称:epro,代码行数:6,代码来源:logout.php

示例5: Authorization

<?php

require_once CODE_ROOT . '/classes/authorization.php';
$authorization = new Authorization();
if (empty($request_uri[2])) {
    $request_uri[2] = '';
}
switch ($request_uri[2]) {
    case 'logout':
        $authorization->logout();
        header('Location: /authorization/login');
        die;
        break;
    default:
        $authorization->result['views'] = array('main' => 'login.php');
        break;
}
$result = $authorization->result;
开发者ID:Rapp-colince,项目名称:surgeon-report-81,代码行数:18,代码来源:authorization.php


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