diff options
author | Wesley Miaw <josuah@users.sourceforge.net> | 2003-11-22 21:16:10 +0000 |
---|---|---|
committer | Wesley Miaw <josuah@users.sourceforge.net> | 2003-11-22 21:16:10 +0000 |
commit | 3b3487be53650bb9b39d9ed8c7afd1c04b943b60 (patch) | |
tree | c0ab013a59cebcbdbc024a99b8050b54b4d4fce8 /rss/index.php | |
parent | 3fa43afd25ab763d3540fc5ddaa4c164b2af33c1 (diff) | |
download | phpicalendar-3b3487be53650bb9b39d9ed8c7afd1c04b943b60.tar.gz phpicalendar-3b3487be53650bb9b39d9ed8c7afd1c04b943b60.tar.bz2 phpicalendar-3b3487be53650bb9b39d9ed8c7afd1c04b943b60.zip |
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.
Diffstat (limited to 'rss/index.php')
-rw-r--r-- | rss/index.php | 36 |
1 files changed, 15 insertions, 21 deletions
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'); ?> <br> <?php - // open file - $dir_handle = @opendir($calendar_path) or die(error(sprintf($error_path_lang, $calendar_path), $cal_filename)); - // build the <option> 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 '<font class="V12" color="blue"><b>'.$cal_displayname_tmp.' '. $calendar_lang.'</b></font><br>'; - echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=day<br>'; - echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=week<br>'; - echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=month<br>'; - $footer_check = $default_path.'/rss/rss.php?cal='.$default_cal.'&rssview='.$default_view; - echo '<br><br>'; - } - } + $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 '<font class="V12" color="blue"><b>'.$cal_displayname_tmp.' '. $calendar_lang.'</b></font><br>'; + echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=day<br>'; + echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=week<br>'; + echo $default_path.'/rss/rss.php?cal='.$cal_tmp.'&rssview=month<br>'; + $footer_check = $default_path.'/rss/rss.php?cal='.$default_cal.'&rssview='.$default_view; + echo '<br><br>'; } ?> </td> |