Mambo PHP Cross Reference Web Portal Systems

Source: /administrator/logout.php - 64 lines - 1836 bytes - Text - Print

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @author Mambo Foundation Inc see README.php
   5  * @copyright Mambo Foundation Inc.
   6  * See COPYRIGHT.php for copyright notices and details.
   7  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
   8  * LICENSE.php
   9  * Mambo is free software; you can redistribute it and/or
  10  * modify it under the terms of the GNU General Public License
  11  * as published by the Free Software Foundation; version 2 of the
  12  * License.
  13  */ 
  14  
  15  /** ensure this file is being included by a parent file */
  16  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  17  
  18  $currentDate = date("Y-m-d\TH:i:s");
  19  
  20  if (isset($_SESSION['session_user_id']) && $_SESSION['session_user_id']!="") {
  21      $database->setQuery( "UPDATE #__users SET lastvisitDate='$currentDate' WHERE id='" . $_SESSION['session_user_id'] . "'");
  22  
  23      if (!$database->query()) {
  24          echo $database->stderr();
  25      }
  26  }
  27  
  28  if (isset($_SESSION['session_id']) && $_SESSION['session_id']!="") {
  29      $database->setQuery( "DELETE FROM #__session WHERE session_id='" . $_SESSION['session_id'] . "'");
  30  
  31      if (!$database->query()) {
  32          echo $database->stderr();
  33      }
  34  }
  35  
  36  $name = "";
  37  $fullname = "";
  38  $id = "";
  39  $session_id = "";
  40  
  41  session_unregister( "session_id" );
  42  session_unregister( "session_user_id" );
  43  session_unregister( "session_username" );
  44  session_unregister( "session_usertype" );
  45  session_unregister( "session_logintime" );
  46  
  47  if (session_is_registered( "session_id" )) {
  48      session_destroy();
  49  }
  50  if (session_is_registered( "session_user_id" )) {
  51      session_destroy();
  52  }
  53  if (session_is_registered( "session_username" )) {
  54      session_destroy();
  55  }
  56  if (session_is_registered( "session_usertype" )) {
  57      session_destroy();
  58  }
  59  if (session_is_registered( "session_logintime" )) {
  60      session_destroy();
  61  }
  62  $configuration =& mamboCore::getMamboCore();
  63  $configuration->redirect( "../index.php" );
  64  ?>

title

Description

title

Description

title

Description

title

title

Body