From 3b3487be53650bb9b39d9ed8c7afd1c04b943b60 Mon Sep 17 00:00:00 2001 From: Wesley Miaw Date: Sat, 22 Nov 2003 21:16:10 +0000 Subject: Added username/password login to access locked calendars. Moved calendar availability logic (with support for login) to a calendar_functions.php file. RSS feeds support the login feature when determining which calendars to return. Styles updated for the login box. --- rss/index.php | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'rss') diff --git a/rss/index.php b/rss/index.php index 187b3b1..75ef9cb 100644 --- a/rss/index.php +++ b/rss/index.php @@ -2,6 +2,7 @@ define('BASE','../'); include(BASE.'functions/ical_parser.php'); +include(BASE.'functions/calendar_functions.php'); $default_path = 'http://'.$HTTP_SERVER_VARS['SERVER_NAME'].substr($HTTP_SERVER_VARS['PHP_SELF'],0,strpos($HTTP_SERVER_VARS['PHP_SELF'], '/rss/')); if (isset($HTTP_SERVER_VARS['HTTP_REFERER']) && $HTTP_SERVER_VARS['HTTP_REFERER'] != '') { $back_page = $HTTP_SERVER_VARS['HTTP_REFERER']; @@ -57,28 +58,21 @@ include (BASE.'includes/header.inc.php'); ?>
tags - while ($file = readdir($dir_handle)) { - if (preg_match("/^[^.].+\.ics$/", $file)) { - - // $cal_filename is the filename of the calendar without .ics - // $cal is a urlencoded version of $cal_filename - // $cal_displayname is $cal_filename with occurrences of "32" replaced with " " - $cal_filename_tmp = substr($file,0,-4); - $cal_tmp = urlencode($cal_filename_tmp); - $cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp); - if (!in_array($cal_filename_tmp, $blacklisted_cals)) { - echo ''.$cal_displayname_tmp.' '. $calendar_lang.'
'; - echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=day
'; - echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=week
'; - echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=month
'; - $footer_check = $default_path.'/rss/rss.php?cal='.$default_cal.'&rssview='.$default_view; - echo '

'; - } - } + $filelist = availableCalendarNames($username, $password, $ALL_CALENDARS_COMBINED); + foreach ($filelist as $file) { + // $cal_filename is the filename of the calendar without .ics + // $cal is a urlencoded version of $cal_filename + // $cal_displayname is $cal_filename with occurrences of "32" replaced with " " + $cal_filename_tmp = substr($file,0,-4); + $cal_tmp = urlencode($cal_filename_tmp); + $cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp); + echo ''.$cal_displayname_tmp.' '. $calendar_lang.'
'; + echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=day
'; + echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=week
'; + echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=month
'; + $footer_check = $default_path.'/rss/rss.php?cal='.$default_cal.'&rssview='.$default_view; + echo '

'; } ?> -- cgit v1.2.3