/usr/share/php/Horde/Prefs/Cache/Session.php is in php-horde-prefs 2.5.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | <?php
/**
* Session cache implementation for the preferences system.
*
* Copyright 2010-2013 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Prefs
*/
class Horde_Prefs_Cache_Session extends Horde_Prefs_Cache_Base
{
/**
* Session key.
*
* @var string
*/
protected $_key;
/**
*/
public function __construct($user, array $params = array())
{
parent::__construct($user, $params);
$this->_key = 'horde_prefs_cache_' . $this->_params['user'];
}
/**
*/
public function get($scope)
{
return isset($_SESSION[$this->_key][$scope])
? $_SESSION[$this->_key][$scope]
: false;
}
/**
*/
public function store($scope_ob)
{
$_SESSION[$this->_key][$scope_ob->getScope()] = $scope_ob;
}
/**
*/
public function remove($scope = null)
{
if (is_null($scope)) {
unset($_SESSION[$this->_key]);
} else {
unset($_SESSION[$this->_key][$scope]);
}
}
}
|