0
|
1 <?php
|
|
2
|
|
3 /**
|
|
4 +-----------------------------------------------------------------------+
|
|
5 | This file is part of the Roundcube Webmail client |
|
|
6 | Copyright (C) 2005-2014, The Roundcube Dev Team |
|
|
7 | Copyright (C) 2011, Kolab Systems AG |
|
|
8 | |
|
|
9 | Licensed under the GNU General Public License version 3 or |
|
|
10 | any later version with exceptions for skins & plugins. |
|
|
11 | See the README file for a full license statement. |
|
|
12 | |
|
|
13 | PURPOSE: |
|
|
14 | Provide database supported session management |
|
|
15 +-----------------------------------------------------------------------+
|
|
16 | Author: Thomas Bruederli <roundcube@gmail.com> |
|
|
17 | Author: Aleksander Machniak <alec@alec.pl> |
|
|
18 | Author: Cor Bosman <cor@roundcu.be> |
|
|
19 +-----------------------------------------------------------------------+
|
|
20 */
|
|
21
|
|
22 /**
|
|
23 * Class to provide native php session storage
|
|
24 *
|
|
25 * @package Framework
|
|
26 * @subpackage Core
|
|
27 * @author Thomas Bruederli <roundcube@gmail.com>
|
|
28 * @author Aleksander Machniak <alec@alec.pl>
|
|
29 * @author Cor Bosman <cor@roundcu.be>
|
|
30 */
|
|
31 class rcube_session_php extends rcube_session {
|
|
32
|
|
33 /**
|
|
34 * native php sessions don't need a save handler
|
|
35 * we do need to define abstract function implementations but they are not used.
|
|
36 */
|
|
37
|
|
38 public function open($save_path, $session_name) {}
|
|
39 public function close() {}
|
|
40 public function destroy($key) {}
|
|
41 public function read($key) {}
|
|
42 public function write($key, $vars) {}
|
|
43 public function update($key, $newvars, $oldvars) {}
|
|
44
|
|
45 /**
|
|
46 * @param Object $config
|
|
47 */
|
|
48 public function __construct($config)
|
|
49 {
|
|
50 parent::__construct($config);
|
|
51 }
|
|
52
|
|
53 /**
|
|
54 * Wrapper for session_write_close()
|
|
55 */
|
|
56 public function write_close()
|
|
57 {
|
|
58 $_SESSION['__IP'] = $this->ip;
|
|
59 $_SESSION['__MTIME'] = time();
|
|
60
|
|
61 parent::write_close();
|
|
62 }
|
|
63
|
|
64 /**
|
|
65 * Wrapper for session_start()
|
|
66 */
|
|
67 public function start()
|
|
68 {
|
|
69 parent::start();
|
|
70
|
|
71 $this->key = session_id();
|
|
72 $this->ip = $_SESSION['__IP'];
|
|
73 $this->changed = $_SESSION['__MTIME'];
|
|
74
|
|
75 }
|
|
76 }
|