From: Jan Schneider Date: Wed, 2 Dec 2009 17:59:55 +0000 (+0100) Subject: No longer used. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=850967ac78f07d002178c93c810a4672a51dc392;p=horde.git No longer used. --- diff --git a/nag/ics.php b/nag/ics.php deleted file mode 100644 index 64b64dae3..000000000 --- a/nag/ics.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ - -$nag_session_control = 'none'; -require_once dirname(__FILE__) . '/lib/base.php'; - -// We want to always generate UTF-8 iCalendar data. -Horde_Nls::setCharset('UTF-8'); - -// Determine which tasklist to export. -$tasklist = Horde_Util::getFormData('t'); -if (empty($tasklist) && $pathInfo = Horde_Util::getPathInfo()) { - $tasklist = basename($pathInfo); -} - -$share = $nag_shares->getShare($tasklist); -if (is_a($share, 'PEAR_Error')) { - header('HTTP/1.0 400 Bad Request'); - echo '400 Bad Request'; - exit; -} - -// First try guest permissions. -if (!$share->hasPermission('', Horde_Perms::READ)) { - // Authenticate. - $auth = Horde_Auth::singleton($conf['auth']['driver']); - if (!isset($_SERVER['PHP_AUTH_USER']) || - !$auth->authenticate($_SERVER['PHP_AUTH_USER'], - array('password' => isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null)) || - !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) { - header('WWW-Authenticate: Basic realm="Nag iCalendar Interface"'); - header('HTTP/1.0 401 Unauthorized'); - echo '401 Unauthorized'; - exit; - } -} - -$cache = Horde_Cache::singleton($conf['cache']['driver'], Horde::getDriverConfig('cache', $conf['cache']['driver'])); -$key = 'nag.ics.' . $tasklist; - -$ics = $cache->get($key, 360); -if (!$ics) { - $iCal = new Horde_iCalendar(); - $iCal->setAttribute('X-WR-CALNAME', $share->get('name')); - - $storage = Nag_Driver::singleton($tasklist); - $result = $storage->retrieve(); - if (is_a($result, 'PEAR_Error')) { - Horde::fatal($result, __FILE__, __LINE__); - } - - $identity = Horde_Prefs_Identity::singleton('none', $share->get('owner')); - $storage->tasks->reset(); - while ($task = $storage->tasks->each() ) { - $iCal->addComponent($task->toiCalendar($iCal)); - } - - $ics = $iCal->exportvCalendar(); - $cache->set($key, $ics); -} - -$browser->downloadHeaders($tasklist . '.ics', - 'text/calendar; charset=' . Horde_Nls::getCharset(), - true, - strlen($ics)); -echo $ics;