From 521dcf5cddeaf0f193930483cf70b392d4830637 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Tue, 9 Mar 2010 11:39:53 -0500 Subject: [PATCH] Fix unsubscribing from remote calendars --- kronolith/calendars/remote_unsubscribe.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kronolith/calendars/remote_unsubscribe.php b/kronolith/calendars/remote_unsubscribe.php index 1e486796e..1beab91e7 100644 --- a/kronolith/calendars/remote_unsubscribe.php +++ b/kronolith/calendars/remote_unsubscribe.php @@ -21,6 +21,20 @@ if (!Horde_Auth::getAuth() || $prefs->isLocked('remote_cals')) { } $vars = Horde_Variables::getDefaultVariables(); +$remote_calendar = null; + +$remote_calendars = unserialize($GLOBALS['prefs']->getValue('remote_cals')); +foreach ($remote_calendars as $key => $calendar) { + if ($calendar['url'] == $vars->get('url')) { + $remote_calendar = $calendar; + break; + } +} +if (is_null($remote_calendar)) { + $notification->push(_("The remote calendar was not found."), 'horde.error'); + header('Location: ' . Horde::applicationUrl('calendars/', true)); + exit; +} $form = new Kronolith_UnsubscribeRemoteCalendarForm($vars, $remote_calendar); // Execute if the form is valid (must pass with POST variables only). -- 2.11.0