- Timestamp:
- 11/11/04 11:01:55 (4 years ago)
- Files:
-
- trunk/patSession.php (modified) (3 diffs)
- trunk/patSession/Storage.php (modified) (4 diffs)
- trunk/patSession/Storage/Cli.php (modified) (1 diff)
- trunk/patSession/Storage/Native.php (modified) (1 diff)
- trunk/patSession/Storage/Null.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/patSession.php
r25 r27 17 17 */ 18 18 define( 'PATSESSION_ERROR_NOT_ACTIVE', 1 ); 19 20 /** 21 * error definition: could not load driver 22 */ 23 define( 'PATSESSION_ERROR_DRIVER_NOT_FOUND', 2 ); 19 24 20 25 /** … … 136 141 { 137 142 // search for files 138 if( $entry === '.' || $entry === '..' || !is_file( $includePath . '/' . $entry ) )143 if( $entry[0] === '.' || !is_file( $includePath . '/' . $entry ) ) 139 144 { 140 145 continue; … … 162 167 163 168 // create error! 164 return patErrorManager::raiseError( 'patSession: factory:1',169 return patErrorManager::raiseError( 'patSession:' . PATSESSION_ERROR_DRIVER_NOT_FOUND, 165 170 'Storage driver not found!', 166 171 'Driver "'. $storage .'" not found - available drivers: "'. implode( '", "', $available ) .'"' trunk/patSession/Storage.php
r26 r27 61 61 * - fix_browser 62 62 * - fix_referer 63 * - use_token 63 64 * 64 65 * @var array $_security list of checks that will be done. 65 66 */ 66 var $_security = array( 'fix_referer', 'fix_ip', 'fix_browser' );67 var $_security = array( 'fix_referer', 'fix_ip', 'fix_browser', 'use_token' ); 67 68 68 69 /** … … 278 279 $this->set( '_patSession_atime', null ); 279 280 $this->set( '_patSession_clientAddr', null ); 281 $this->set( '_patSession_clientForwarded', null ); 280 282 $this->set( '_patSession_clientBrowser', null ); 281 283 } … … 312 314 { 313 315 // referer must match server 314 preg_match( ' °https?://(.*)/°U', $_SERVER['HTTP_REFERER'], $match );316 preg_match( '|https?://(.*)/|U', $_SERVER['HTTP_REFERER'], $match ); 315 317 $ref = $match[1]; 316 318 … … 351 353 return false; 352 354 } 355 356 // some polite proxy server tell, for whom they forward the request for 357 if( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) 358 { 359 $forwarded = $this->get( '_patSession_clientForwarded' ); 360 361 if( $forwarded === null ) 362 { 363 $this->set( '_patSession_clientForwarded', $_SERVER['HTTP_X_FORWARDED_FOR'] ); 364 } 365 else if( $_SERVER['HTTP_X_FORWARDED_FOR'] !== $forwarded ) 366 { 367 $this->_state = 'fix_ip_failed'; 368 return false; 369 } 370 } 353 371 } 354 372 trunk/patSession/Storage/Cli.php
r26 r27 7 7 * $Id$ 8 8 * 9 * @version 1.0. 39 * @version 1.0.5 10 10 * @package patSession 11 11 * @subpackage Storage trunk/patSession/Storage/Native.php
r26 r27 8 8 * $Id$ 9 9 * 10 * @version 1.0. 410 * @version 1.0.5 11 11 * @package patSession 12 12 * @subpackage Storage trunk/patSession/Storage/Null.php
r26 r27 8 8 * $Id$ 9 9 * 10 * @version 1.0. 310 * @version 1.0.5 11 11 * @package patSession 12 12 * @subpackage Storage
