Subversion-Projekte lars-tiefland.ci

Revision

Revision 2257 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 2257 Revision 2414
Zeile 4... Zeile 4...
4
 *
4
 *
5
 * An open source application development framework for PHP
5
 * An open source application development framework for PHP
6
 *
6
 *
7
 * This content is released under the MIT License (MIT)
7
 * This content is released under the MIT License (MIT)
8
 *
8
 *
9
 * Copyright (c) 2014 - 2018, British Columbia Institute of Technology
9
 * Copyright (c) 2014 - 2019, British Columbia Institute of Technology
10
 *
10
 *
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
12
 * of this software and associated documentation files (the "Software"), to deal
12
 * of this software and associated documentation files (the "Software"), to deal
13
 * in the Software without restriction, including without limitation the rights
13
 * in the Software without restriction, including without limitation the rights
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Zeile 27... Zeile 27...
27
 * THE SOFTWARE.
27
 * THE SOFTWARE.
28
 *
28
 *
29
 * @package	CodeIgniter
29
 * @package	CodeIgniter
30
 * @author	EllisLab Dev Team
30
 * @author	EllisLab Dev Team
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
32
 * @copyright	Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
32
 * @copyright	Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
33
 * @license	http://opensource.org/licenses/MIT	MIT License
33
 * @license	https://opensource.org/licenses/MIT	MIT License
34
 * @link	https://codeigniter.com
34
 * @link	https://codeigniter.com
35
 * @since	Version 3.0.0
35
 * @since	Version 3.0.0
36
 * @filesource
36
 * @filesource
37
*/
37
*/
38
defined('BASEPATH') OR exit('No direct script access allowed');
38
defined('BASEPATH') OR exit('No direct script access allowed');
Zeile 133... Zeile 133...
133
	{
133
	{
134
		if ( ! is_dir($save_path))
134
		if ( ! is_dir($save_path))
135
		{
135
		{
136
			if ( ! mkdir($save_path, 0700, TRUE))
136
			if ( ! mkdir($save_path, 0700, TRUE))
137
			{
137
			{
138
				throw new Exception("Session: Configured save path '".$this->_config['save_path']."' is not a directory, doesn't exist or cannot be created.");
138
				log_message('error', "Session: Configured save path '".$this->_config['save_path']."' is not a directory, doesn't exist or cannot be created.");
-
 
139
				return $this->_failure;
139
			}
140
			}
140
		}
141
		}
141
		elseif ( ! is_writable($save_path))
142
		elseif ( ! is_writable($save_path))
142
		{
143
		{
143
			throw new Exception("Session: Configured save path '".$this->_config['save_path']."' is not writable by the PHP process.");
144
			log_message('error', "Session: Configured save path '".$this->_config['save_path']."' is not writable by the PHP process.");
-
 
145
			return $this->_failure;
144
		}
146
		}
Zeile 145... Zeile 147...
145
 
147
 
146
		$this->_config['save_path'] = $save_path;
148
		$this->_config['save_path'] = $save_path;
147
		$this->_file_path = $this->_config['save_path'].DIRECTORY_SEPARATOR
149
		$this->_file_path = $this->_config['save_path'].DIRECTORY_SEPARATOR
148
			.$name // we'll use the session cookie name as a prefix to avoid collisions
150
			.$name // we'll use the session cookie name as a prefix to avoid collisions
Zeile -... Zeile 151...
-
 
151
			.($this->_config['match_ip'] ? md5($_SERVER['REMOTE_ADDR']) : '');
-
 
152
 
149
			.($this->_config['match_ip'] ? md5($_SERVER['REMOTE_ADDR']) : '');
153
		$this->php5_validate_id();
150
 
154
 
Zeile 151... Zeile 155...
151
		return $this->_success;
155
		return $this->_success;
Zeile 390... Zeile 394...
390
	}
394
	}
Zeile 391... Zeile 395...
391
 
395
 
Zeile 392... Zeile 396...
392
	// --------------------------------------------------------------------
396
	// --------------------------------------------------------------------
-
 
397
 
-
 
398
	/**
-
 
399
	 * Validate ID
-
 
400
	 *
-
 
401
	 * Checks whether a session ID record exists server-side,
-
 
402
	 * to enforce session.use_strict_mode.
-
 
403
	 *
-
 
404
	 * @param	string	$id
-
 
405
	 * @return	bool
-
 
406
	 */
-
 
407
	public function validateSessionId($id)
-
 
408
	{
-
 
409
		$result = is_file($this->_file_path.$id);
-
 
410
		clearstatcache(TRUE, $this->_file_path.$id);
-
 
411
		return $result;
-
 
412
	}
-
 
413
 
-
 
414
	// --------------------------------------------------------------------
393
 
415
 
394
	/**
416
	/**
395
	 * Byte-safe strlen()
417
	 * Byte-safe strlen()
396
	 *
418
	 *
397
	 * @param	string	$str
419
	 * @param	string	$str