Changeset 17 for trunk/patSession

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/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.'.'