Source for file t_sessionscope.class.php

Documentation is available at t_sessionscope.class.php

  1. <?php   /*
  2.    *@=@=@=@ START LICENSE @=@=@=@*
  3.    Copyright or © or Copr. Stéphane TRICHET and Nicolas SOTRON
  4.    
  5.    stephane.t@simpliciweb.net and nicolas.s@simpliciweb.net
  6.    
  7.    This software is a computer program whose purpose is to make a
  8.    web hosting platform
  9.    
  10.    This software is governed by the CeCILL  license under French law and
  11.    abiding by the rules of distribution of free software.  You can  use, 
  12.    modify and/ or redistribute the software under the terms of the CeCILL
  13.    license as circulated by CEA, CNRS and INRIA at the following URL
  14.    "http://www.cecill.info". 
  15.    
  16.    As a counterpart to the access to the source code and  rights to copy,
  17.    modify and redistribute granted by the license, users are provided only
  18.    with a limited warranty  and the software's author,  the holder of the
  19.    economic rights,  and the successive licensors  have only  limited
  20.    liability. 
  21.    
  22.    In this respect, the user's attention is drawn to the risks associated
  23.    with loading,  using,  modifying and/or developing or reproducing the
  24.    software by the user in light of its specific status of free software,
  25.    that may mean  that it is complicated to manipulate,  and  that  also
  26.    therefore means  that it is reserved for developers  and  experienced
  27.    professionals having in-depth computer knowledge. Users are therefore
  28.    encouraged to load and test the software's suitability as regards their
  29.    requirements in conditions enabling the security of their systems and/or 
  30.    data to be ensured and,  more generally, to use and operate it in the 
  31.    same conditions as regards security. 
  32.    
  33.    The fact that you are presently reading this means that you have had
  34.    knowledge of the CeCILL license and that you accept its terms.
  35.    *@=@=@=@ END   LICENSE @=@=@=@*
  36.  
  37. */?><?php  
  38. /**
  39.  * TSessionScope Class
  40.  * 
  41.  * 
  42.  * @author SimpliciWeb
  43.  * @version $Id: t_sessionscope.class.php 606 2007-07-19 10:14:30Z stephanet $
  44.  * @package BackOffice
  45.  * @subpackage FrameWork
  46.  */    
  47. /**
  48.  * Include xt_sessionscope
  49.  */
  50. require_once("internal_components/common/scope/xt_sessionscope.class.php");
  51.  
  52. /**
  53.  * This class provide session management for PLICI.
  54.  * 
  55.  * It make a couple with a session information send by navigator and a BD context.
  56.  *
  57.  * @author SimpliciWeb
  58.  * @version $Id: t_sessionscope.class.php 606 2007-07-19 10:14:30Z stephanet $
  59.  * @package BackOffice
  60.  * @subpackage FrameWork
  61.  */
  62. class TSessionScope extends xTSessionScope {
  63.  
  64.  
  65.     /**
  66.      * Constructor, init the requests and objects
  67.      *
  68.      * @return TSessionScope 
  69.      */
  70.     function  TSessionScope({
  71.         global $g_object_loader;
  72.         $object_site_information =$g_object_loader->getSiteInformation();
  73.         parent::xTSessionScope($object_site_information->getSessionBoIdName());
  74.         
  75.             
  76.         
  77.     }
  78.  
  79.  
  80.  
  81.  
  82.  
  83.     /**
  84.      * Get a session var
  85.      *
  86.      * @param string $p_name 
  87.      * @return mixed "" if nothing is finded
  88.      */
  89.     function get($p_name{
  90.         if ($this->m_is_existing_session{
  91.             //echo("get".$p_name."<br />");
  92.             if (isset($_SESSION[$p_name]&& ($_SESSION[$p_name!= '')) {
  93.                 return  $_SESSION[$p_name];
  94.             }
  95.         }
  96.  
  97.  
  98.         return "";
  99.     }
  100.     /**
  101.      * Test if session var name doesn't exist
  102.      *
  103.      * @param string $p_name 
  104.      * @return bool TRUE = Not exist, FALSE = exist
  105.      */
  106.     function isNotExisting($p_name{
  107.  
  108.         //echo("not existing".$p_name."<br />");
  109.         //echo("for :".$p_name);
  110.         //print_r($_SESSION);
  111.         if ($this->m_is_existing_session{
  112.             if (isset($_SESSION[$p_name]))
  113.             if ($_SESSION[$p_name!= '')
  114.             return false;
  115.         }
  116.         return true;
  117.     }
  118.     /**
  119.      * Set a session var
  120.      *
  121.      * @param string $p_name 
  122.      * @param mixed $p_value 
  123.      */
  124.     function set($p_name$p_value{
  125.  
  126.         //echo("set".$p_name."<br />");
  127.         //$this->xForceToLoad();
  128.         if ($this->m_is_existing_session{
  129.             $_SESSION[$p_name$p_value;
  130.         }
  131.     }
  132.     /**
  133.      * Destroy a session var
  134.      *
  135.      * @param string $p_name 
  136.      */
  137.     function destroy($p_name{
  138.         //echo("destroy".$p_name."<br />");
  139.         if ($this->m_is_existing_session{
  140.             $this->xUnset($p_name);
  141.         }
  142.     }
  143.  
  144.  
  145. }
  146.  
  147.  
  148.  
  149. ?>

Documentation generated on Tue, 25 Mar 2008 15:37:19 +0100 by phpDocumentor 1.3.2