Changeset 17 for trunk

Show
Ignore:
Timestamp:
09/09/04 15:14:59 (4 years ago)
Author:
gerd
Message:

- changed error-codes
- added examples

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/autopackage.php

    r16 r17  
    1010 * 
    1111 * @author              Stephan Schmidt <schst@php-tools.net> 
     12 * @author              gERD Schaufelberger <gerd@php-tools.net> 
    1213 * @package             patSession 
    1314 * @subpackage  Tools 
    1415 */ 
    1516 
    16 $baseVersion = '1.0.1'; 
     17$baseVersion = '1.0.2'; 
    1718 
    1819/** 
     
    3637 */ 
    3738$notes = <<<EOT 
    38 Still in development, no public release yet. 
     39first public release 
    3940EOT; 
    4041 
  • trunk/docs/readme.txt

    r16 r17  
    11/** 
    2  * patSeasson 
     2 * patSession 
    33 * 
    44 * $Id$ 
     
    1313 */ 
    1414 
    15 Download at http://www.php-tools.net 
     15Download at http://snaps.php-tools.net 
     16Homepage at http://www.php-tools.net 
    1617 
    1718This program and all associated files are released under the GNU Lesser Public License, 
  • trunk/examples/example_secure_fix.php

    r10 r17  
    2626                                                        'security'              => 'fix_browser,fix_ip,fix_referer', 
    2727                                                        'allow-referer' => '*.php-tools.net,*.php-tools.de', 
    28                                                         'empty-referer' => 'deny
     28                                                        'empty-referer' => 'allow
    2929                                                ); 
    3030         
     
    5252        The session is bounded to the client's ip address. <br> <br> 
    5353        <b>fix_referer</b>: <br> 
    54         All session values will be cleared if the referer is empty or a a foreign host.<br>  
     54        All session values will be cleared if the referer is empty or an unknown host.<br>  
    5555        The fix-referer-feature can be combined two other options: 'empty-referer' (deny, allow)  
    5656        and 'allow-referer'. 
  • trunk/examples/index_sections.php

    r11 r17  
    6161                                        'descr' =>      'Expire idle sessions' 
    6262                                ), 
    63                                 'fix' => array( 
    64                                         'title' =>      'Fixiation', 
    65                                         'descr' =>      'Fixiation features of patSession helps you to avoid session-hijacking.', 
     63                                'fixbrowser' => array( 
     64                                        'title' =>      'Fix browser', 
     65                                        'descr' =>      'patSession allows to fix a session to a browser. Therefore all session data will be destroyed if the users tries to continue the session wit a different browser', 
     66                                ), 
     67                                'fixip' => array( 
     68                                        'title' =>      'Fix IP address', 
     69                                        'descr' =>      'This feature avoids to continue any session from a different IP address then it was started.', 
     70                                ), 
     71                                'fixreferer' => array( 
     72                                        'title' =>      'Fix referer', 
     73                                        'descr' =>      'Fixiation of the referer forces to stay on the same referer.', 
    6674                                ), 
    6775                                'fork' => array( 
  • trunk/patSession.php

    r12 r17  
    55 * $Id$ 
    66 * 
    7  * @version     1.0.0 
     7 * @version     1.0.2 
    88 * @package patSession 
    99 *  
  • trunk/patSession/Storage.php

    r16 r17  
    55 * $Id$ 
    66 * 
    7  * @version     1.0.0 
     7 * @version     1.0.2 
    88 * @package patSession 
    99 *  
     
    5454        * @var  string $_emptyReferer 'deny' is default 
    5555        */ 
    56         var     $_emptyReferer  =       null
     56        var     $_emptyReferer  =       'allow'
    5757         
    5858   /** 
     
    160160   /** 
    161161        * create a new session and copy variables from the old one 
     162        *  
     163        * Actually cloning sessions is neccessary to implement some  
     164        * security features. Usually the application wants to clone  
     165        * the session during a user-login process.  
    162166        * 
    163167        * @abstract 
     
    217221                        if( $this->_emptyReferer !== 'allow' ) 
    218222                        { 
    219                               $this->_state   =       'empty_referer'; 
    220                               return false; 
     223                             $this->_state   =       'empty_referer'; 
     224                             return false; 
    221225                        }  
    222226                } 
     
    352356                 
    353357                // allow empty referer 
    354                 if( isset( $options['empty-referer'] ) && $options['empty-referer'] === 'allow' ) 
    355                 { 
    356                         $this->_emptyReferer    =       'allow'; 
     358                if( isset( $options['empty-referer'] ) && $options['empty-referer'] !== 'allow' ) 
     359                { 
     360                        $this->_emptyReferer    =       'deny'; 
    357361                } 
    358362                 
  • trunk/patSession/Storage/Native.php

    r16 r17  
    88 * $Id$ 
    99 * 
    10  * @version     1.0.0 
     10 * @version     1.0.2 
    1111 * @package patSession 
    1212 *  
     
    102102                if( $this->_state === 'destroyed' ) 
    103103                { 
    104                         patErrorManager::raiseNotice( 'patSession_' . PATSESSION_ERROR_NOT_ACTIVE, 
     104                        patErrorManager::raiseNotice( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 
    105105                                                'Session is not active - nothing to clear', 
    106106                                                'The session was destroyed before.' 
     
    124124                if( $this->_state !== 'active' ) 
    125125                { 
    126                         return patErrorManager::raiseError( 'patSession_' . PATSESSION_ERROR_NOT_ACTIVE, 
     126                        return patErrorManager::raiseError( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 
    127127                                                'Cannot set value because session not active.', 
    128128                                                'Either the session was destroyed, has expired or locked by security' 
     
    145145                if( $this->_state !== 'active' ) 
    146146                { 
    147                                 return patErrorManager::raiseWarning( 'patSession_' . PATSESSION_ERROR_NOT_ACTIVE, 
     147                                return patErrorManager::raiseWarning( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 
    148148                                                'Cannot recieve value because session not active.', 
    149149                                                'Either the session was destroyed, has expired or locked because of security reasons.' 
     
    170170                if( $this->_state !== 'active' ) 
    171171                { 
    172                         patErrorManager::raiseNotice( 'patSession_' . PATSESSION_ERROR_NOT_ACTIVE, 
     172                        patErrorManager::raiseNotice( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 
    173173                                                'Session is not active - nothing to clear', 
    174174                                                'Either the session was destroyed, has expired or locked because of security reasons.' 
     
    197197                if( $this->_state === 'destroyed' ) 
    198198                { 
    199                         patErrorManager::raiseNotice( 'patSession_' . PATSESSION_ERROR_NOT_ACTIVE, 
     199                        patErrorManager::raiseNotice( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 
    200200                                                'Session is not active.', 
    201201                                                'The session was destroyed before.' 
     
    225225                        if( !$this->_checkSecurity( true ) ) 
    226226                        { 
    227                                 return patErrorManager::raiseNotice( 'patSession_' . PATSESSION_ERROR_NOT_ACTIVE, 
     227                                return patErrorManager::raiseNotice( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 
    228228                                                'Session is not active.', 
    229229                                                'Either the session was destroyed, has expired or locked because of security reasons: '. $this->_state.'.'