Source for file Logout.class.php

Documentation is available at Logout.class.php

  1. <?php
  2. /**
  3.  * Logout, class to logout any user
  4.  *
  5.  * LICENSE: CREATIVE COMMONS PUBLIC LICENSE  "Namensnennung — Nicht-kommerziell 2.0"
  6.  *
  7.  * @copyright  2009 <SEDesign />
  8.  * @license    http://creativecommons.org/licenses/by-nc/2.0/de/
  9.  * @version    $3.0.6$
  10.  * @link       http://www.sedesign.de/de_produkte_chat-v3.html
  11.  * @since      File available since Alpha 1.0
  12.  */
  13.  
  14. class Logout extends DbConectionMaker
  15. {
  16.     /**
  17.     * Constructor
  18.     *
  19.     * @uses ConnectDB::sqlSet()
  20.     * @uses ConnectDB::close()
  21.     * @return void 
  22.     */
  23.     public function __construct (){
  24.     
  25.         // call parent Constructor from class DbConectionMaker
  26.         parent::__construct();
  27.     
  28.         session_start();
  29.         
  30.         // all documentc requested per AJAX should have this part to turn off the browser and proxy cache for any XHR request
  31.         header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');
  32.         
  33.         // create new LangXml Object
  34.         $langObj = new LangXml();
  35.         $lang=$langObj->getLang()->logout_php[0];
  36.         
  37.         if ($_SESSION['etchat_'.$this->_prefix.'userstatus']!="status_invisible")
  38.             if (isset($_SESSION['etchat_'.$this->_prefix.'username']&& !empty($_SESSION['etchat_'.$this->_prefix.'username']))
  39.                 new SysMessage($this->dbObj"<b>".$_SESSION['etchat_'.$this->_prefix.'username']."</b> ".$lang->exit[0]->tagData,0,0);
  40.             
  41.         $this->dbObj->sqlSet("DELETE FROM {$this->_prefix}etchat_useronline WHERE etchat_onlineuser_fid = ".(int)$_SESSION['etchat_'.$this->_prefix.'user_id']);
  42.         
  43.         if(!isset($_SESSION['etchat_'.$this->_prefix.'logout_url'])){
  44.             @session_unset();
  45.             @session_destroy();
  46.             header("Location: ./");
  47.         }
  48.         else header("Location: ".$_SESSION['etchat_'.$this->_prefix.'logout_url']);
  49.     }

Documentation generated on Tue, 22 Dec 2009 09:42:49 +0100 by phpDocumentor 1.4.1