Changeset 1077

Show
Ignore:
Timestamp:
09/06/08 15:55:06 (4 months ago)
Author:
laurentj
Message:

little source improvements into jSession

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/manifests/jelix-no-opt.mn

    r1074 r1077  
    2121* jSelector.class.php 
    2222* jUrl.class.php 
    23  jSession.class.php 
     23* jSession.class.php 
    2424 
    2525cd lib/jelix/core/selector 
  • trunk/lib/jelix/core/defaultconfig.ini.php

    r1076 r1077  
    234234; You can change the session name by setting the following parameter (only accepts alpha-numeric chars) : 
    235235; name = "mySessionName" 
     236 
     237name= 
     238 
    236239; 
    237240; Use alternative storage engines for sessions 
    238 
    239 ; usage : 
     241; empty value means the default storage engine of PHP 
     242storage= 
     243 
     244; some additionnal options can be set, depending of the type of storage engine 
    240245; 
    241246; storage = "files" 
  • trunk/lib/jelix/core/jCoordinator.class.php

    r1076 r1077  
    137137        jSession::start(); 
    138138 
    139         $this->moduleName = $this->request->getParam('module'); 
    140         $this->actionName = $this->request->getParam('action'); 
     139        $this->moduleName = $request->getParam('module'); 
     140        $this->actionName = $request->getParam('action'); 
    141141 
    142142        if(empty($this->moduleName)){ 
     
    151151        } 
    152152 
    153         // verification du module 
     153        // module check 
    154154        if($gJConfig->checkTrustedModules && !in_array($this->moduleName,$gJConfig->_trustedModules)){ 
    155155            throw new jException('jelix~errors.module.untrusted',$this->moduleName); 
  • trunk/lib/jelix/core/jSession.class.php

    r1009 r1077  
    44* @subpackage core 
    55* @author     Julien Issler 
    6 * @contributor 
    7 * @copyright  2007-2008 Julien Issler 
     6* @contributor Laurent Jouanneau 
     7* @copyright  2007-2008 Julien Issler, 2008 Laurent Jouanneau 
    88* @link       http://www.jelix.org 
    99* @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    2727    public static function start(){ 
    2828 
     29        $params = & $GLOBALS['gJConfig']->sessions; 
     30 
    2931        // do not start the session if the request is made from the command line or if sessions are disabled in configuration 
    30         if($GLOBALS['gJCoord']->request instanceof jCmdLineRequest || !$GLOBALS['gJConfig']->sessions['start']){ 
     32        if($GLOBALS['gJCoord']->request instanceof jCmdLineRequest || !$params['start']){ 
    3133            return false; 
    3234        } 
    33  
    34         $params = $GLOBALS['gJConfig']->sessions; 
    3535 
    3636        //make sure that the session cookie is only for the current application 
     
    3838            session_set_cookie_params ( 0 , $GLOBALS['gJConfig']->urlengine['basePath']); 
    3939 
    40         if(isset($params['storage'])){ 
     40        if($params['storage'] != ''){ 
    4141 
    4242            /* on debian/ubuntu (maybe others), garbage collector launch probability is set to 0 
     
    7171        } 
    7272 
    73         if(isset($params['name'])){ 
     73        if($params['name'] !=''){ 
     74#ifnot ENABLE_OPTIMIZED_SOURCE 
    7475            if(!preg_match('#^[a-zA-Z0-9]+$#',$params['name'])){ 
    7576                // regexp check because session name can only be alpha numeric according to the php documentation 
    7677                throw new jException('jelix~errors.jsession.name.invalid'); 
    7778            } 
     79#endif 
    7880            session_name($params['name']); 
    7981        } 
Download in other formats: Unified Diff Zip Archive