Subversion-Projekte lars-tiefland.ci

Revision

Revision 68 | Revision 2107 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 68 Revision 2049
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 - 2016, British Columbia Institute of Technology
9
 * Copyright (c) 2014 - 2017, 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 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
32
 * @copyright	Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
33
 * @license	http://opensource.org/licenses/MIT	MIT License
33
 * @license	http://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
 */
Zeile 206... Zeile 206...
206
	public function write($session_id, $session_data)
206
	public function write($session_id, $session_data)
207
	{
207
	{
208
		// Prevent previous QB calls from messing with our queries
208
		// Prevent previous QB calls from messing with our queries
209
		$this->_db->reset_query();
209
		$this->_db->reset_query();
Zeile -... Zeile 210...
-
 
210
 
-
 
211
		if ($this->_lock === FALSE)
-
 
212
		{
-
 
213
			return $this->_fail();
210
 
214
		}
211
		// Was the ID regenerated?
215
		// Was the ID regenerated?
212
		if ($session_id !== $this->_session_id)
216
		elseif ($session_id !== $this->_session_id)
213
		{
217
		{
214
			if ( ! $this->_release_lock() OR ! $this->_get_lock($session_id))
218
			if ( ! $this->_release_lock() OR ! $this->_get_lock($session_id))
215
			{
219
			{
216
				return $this->_fail();
220
				return $this->_fail();
Zeile 217... Zeile 221...
217
			}
221
			}
218
 
222
 
219
			$this->_row_exists = FALSE;
223
			$this->_row_exists = FALSE;
220
			$this->_session_id = $session_id;
-
 
221
		}
-
 
222
		elseif ($this->_lock === FALSE)
-
 
223
		{
-
 
Zeile 224... Zeile 224...
224
			return $this->_fail();
224
			$this->_session_id = $session_id;
225
		}
225
		}
226
 
226
 
227
		if ($this->_row_exists === FALSE)
227
		if ($this->_row_exists === FALSE)
Zeile 352... Zeile 352...
352
	 */
352
	 */
353
	protected function _get_lock($session_id)
353
	protected function _get_lock($session_id)
354
	{
354
	{
355
		if ($this->_platform === 'mysql')
355
		if ($this->_platform === 'mysql')
356
		{
356
		{
357
			$arg = $session_id.($this->_config['match_ip'] ? '_'.$_SERVER['REMOTE_ADDR'] : '');
357
			$arg = md5($session_id.($this->_config['match_ip'] ? '_'.$_SERVER['REMOTE_ADDR'] : ''));
358
			if ($this->_db->query("SELECT GET_LOCK('".$arg."', 300) AS ci_session_lock")->row()->ci_session_lock)
358
			if ($this->_db->query("SELECT GET_LOCK('".$arg."', 300) AS ci_session_lock")->row()->ci_session_lock)
359
			{
359
			{
360
				$this->_lock = $arg;
360
				$this->_lock = $arg;
361
				return TRUE;
361
				return TRUE;
362
			}
362
			}
Zeile 415... Zeile 415...
415
			return FALSE;
415
			return FALSE;
416
		}
416
		}
Zeile 417... Zeile 417...
417
 
417
 
418
		return parent::_release_lock();
418
		return parent::_release_lock();
419
	}
-
 
420
}
419
	}
-
 
420
}