From: Michael J. Rubinsky Date: Tue, 9 Mar 2010 16:39:53 +0000 (-0500) Subject: Fix unsubscribing from remote calendars X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=521dcf5cddeaf0f193930483cf70b392d4830637;p=horde.git Fix unsubscribing from remote calendars --- 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).