From 4826e6706fa69d5557456013abad338f3235a9c5 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 26 Jan 2011 12:39:58 -0500 Subject: [PATCH] remove old lowercase filename versions - artifact from case insensitive filesystem --- kronolith/lib/Storage/kolab.php | 74 ----------------------------- kronolith/lib/Storage/sql.php | 101 ---------------------------------------- 2 files changed, 175 deletions(-) delete mode 100644 kronolith/lib/Storage/kolab.php delete mode 100644 kronolith/lib/Storage/sql.php diff --git a/kronolith/lib/Storage/kolab.php b/kronolith/lib/Storage/kolab.php deleted file mode 100644 index bba2be442..000000000 --- a/kronolith/lib/Storage/kolab.php +++ /dev/null @@ -1,74 +0,0 @@ - - * @package Kronolith - */ -class Kronolith_Storage_Kolab extends Kronolith_Storage -{ - protected $_params = array(); - - function __construct($user, $params = array()) - { - $this->_user = $user; - $this->_params = $params; - } - - /** - * @throws Kronolith_Exception - */ - public function search($email, $private_only = false) - { - global $conf; - - if (class_exists('Horde_Kolab_Session')) { - $session = Horde_Kolab_Session::singleton(); - $server = $session->freebusy_server; - } else { - $server = sprintf('%s://%s:%d/freebusy/', - $conf['storage']['freebusy']['protocol'], - Kolab::getServer('imap'), - $conf['storage']['freebusy']['port']); - } - - $fb_url = sprintf('%s/%s.xfb', $server, $email); - - $options['method'] = 'GET'; - $options['timeout'] = 5; - $options['allowRedirects'] = true; - - if (!empty($GLOBALS['conf']['http']['proxy']['proxy_host'])) { - $options = array_merge($options, $GLOBALS['conf']['http']['proxy']); - } - - $http = new HTTP_Request($fb_url, $options); - $http->setBasicAuth($GLOBALS['registry']->getAuth(), $GLOBALS['registry']->getAuthCredential('password')); - @$http->sendRequest(); - if ($http->getResponseCode() != 200) { - throw new Horde_Exception_NotFound(); - } - $vfb_text = $http->getResponseBody(); - - $iCal = new Horde_Icalendar; - $iCal->parsevCalendar($vfb_text); - - $vfb = $iCal->findComponent('VFREEBUSY'); - if ($vfb === false) { - throw new Horde_Exception_NotFound(); - } - - return $vfb; - } - - public function store($email, $vfb, $public = false) - { - // We don't care about storing FB info at the moment; we rather let - // Kolab's freebusy.php script auto-generate it for us. - } - -} diff --git a/kronolith/lib/Storage/sql.php b/kronolith/lib/Storage/sql.php deleted file mode 100644 index 48e4340d7..000000000 --- a/kronolith/lib/Storage/sql.php +++ /dev/null @@ -1,101 +0,0 @@ - - * @author Michael J Rubinsky - * @package Kronolith - */ -class Kronolith_Storage_Sql extends Kronolith_Storage -{ - /** - * Handle for the current database connection, used for reading. - * - * @var Horde_Db_Adapter - */ - protected $_db; - - /** - * Hash containing connection parameters. - * - * @var array - */ - protected $_params = array(); - - /** - * Constructs a new Kronolith_Storage SQL instance. - * - * @param array $params A hash containing connection parameters. - */ - public function __construct($user, $params = array()) - { - $this->_user = $user; - if (empty($params['db'])) { - throw new InvalidArgumentException(_("Missing required db parameter")); - } - - $this->_db = $params['db']; - $this->_params = $params; - $this->_params['table'] = isset($params['table']) ? $params['table'] : 'kronolith_storage'; - } - - /** - * Search for a user's free/busy information. - * - * @param string $email The email address to lookup - * @param boolean $private_only (optional) Only return free/busy - * information owned by this used. - * - * @return Horde_Icalendar_Vfreebusy - * @throws Kronolith_Exception - */ - public function search($email, $private_only = false) - { - /* Build the SQL query. */ - $query = sprintf('SELECT vfb_serialized FROM %s WHERE vfb_email = ? AND (vfb_owner = ?', - $this->_params['table']); - $values = array($email, $this->_user); - - if ($private_only) { - $query .= ')'; - } else { - $query .= " OR vfb_owner = '')"; - } - - /* Execute the query. */ - try { - $result = $this->_db->selectValue($query, $values); - if (empty($result)) { - throw new Horde_Exception_NotFound(); - } - return Horde_Serialize::unserialize($result, Horde_Serialize::BASIC); - } catch (Horde_Db_Exception $e) { - throw new Kronolith_Exception($e); - } - } - - /** - * Store the freebusy information for a given email address. - * - * @param string $email The email address to store fb info for. - * @param Horde_Icalendar_Vfreebusy $vfb TODO - * @param boolean $private_only (optional) TODO - * - * @throws Kronolith_Exception - */ - public function store($email, $vfb, $public = false) - { - /* Build the SQL query. */ - $query = sprintf('INSERT INTO %s (vfb_owner, vfb_email, vfb_serialized) VALUES (?, ?, ?)', - $this->_params['table']); - $values = array($public ? '' : $this->_user, $email, Horde_Serialize::serialize($vfb, Horde_Serialize::BASIC)); - - /* Execute the query. */ - try { - $result = $this->_db->insert($query, $values); - } catch (Horde_Db_Exception $e) { - throw new Kronolith_Exception($e); - } - } - -} -- 2.11.0