/usr/share/php/Horde/Prefs/Storage/Imsp.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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | <?php
/**
* Preference storage implementation for an IMSP server.
*
* Copyright 2004-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 Rubinsky <mrubinsk@horde.org>
* @category Horde
* @package Prefs
*/
class Horde_Prefs_Storage_Imsp extends Horde_Prefs_Storage_Base
{
/**
* Handle for the IMSP server connection.
*
* @var Horde_Imsp_Options
*/
protected $_imsp;
public function __construct($user, array $params = array())
{
if (empty($params['imsp'])) {
throw new InvalidArguementException('Missing required imsp parameter.');
}
$this->_imsp = $params['imsp'];
parent::__construct($user, $params);
}
/**
*/
public function get($scope_ob)
{
try {
$prefs = $this->_imsp->get($scope_ob->scope . '.*');
} catch (Horde_Imsp_Exception $e) {
throw new Horde_Prefs_Exception($e);
}
foreach ($prefs as $name => $val) {
$name = str_replace($scope_ob->scope . '.', '', $name);
if ($val != '-') {
$scope_ob->set($name, $val);
}
}
return $scope_ob;
}
/**
*/
public function store($scope_ob)
{
/* Driver has no support for storing locked status. */
foreach ($scope_ob->getDirty() as $name) {
$value = $scope_ob->get($name);
try {
$this->_imsp->set($scope_ob->scope . '.' . $name, $value ? $value : '-');
} catch (Horde_Imsp_Exception $e) {
throw new Horde_Prefs_Exception($e);
}
}
}
/**
*/
public function remove($scope = null, $pref = null)
{
// TODO
}
/* Helper functions. */
}
|