aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-28 02:31:59 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-28 02:31:59 +0000
commitcb5276baef1831d87d67770a0d76fb2300af5045 (patch)
treefb8dddcbe8c31ed84084c823b76af0d7d82aa791 /functions
parent48218216d38f52305a7a51939a9d55210af4baa9 (diff)
downloadphpicalendar-cb5276baef1831d87d67770a0d76fb2300af5045.tar.gz
phpicalendar-cb5276baef1831d87d67770a0d76fb2300af5045.tar.bz2
phpicalendar-cb5276baef1831d87d67770a0d76fb2300af5045.zip
fix for webcals
Diffstat (limited to 'functions')
-rw-r--r--functions/calendar_functions.php16
-rw-r--r--functions/init.inc.php24
-rw-r--r--functions/init/cpaths.php4
3 files changed, 19 insertions, 25 deletions
diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php
index b814cb1..b02ebec 100644
--- a/functions/calendar_functions.php
+++ b/functions/calendar_functions.php
@@ -14,14 +14,14 @@
// returned.
function availableCalendars($username, $password, $cal_filename, $admin = false) {
// Import globals.
- global $allow_webcals, $allow_login, $calendar_path, $recursive_path, $support_ical, $locked_map, $apache_map, $lang, $_SERVER, $phpiCal_config;
+ global $list_webcals, $blacklisted_cals, $locked_cals, $locked_map, $apache_map, $lang, $_SERVER, $phpiCal_config;
// Create the list of available calendars.
$calendars = array();
// Grab any HTTP authentication.
unset($http_user);
- if ((isset($_SERVER['PHP_AUTH_USER'])) && ($allow_login == 'yes')) {
+ if ((isset($_SERVER['PHP_AUTH_USER'])) && ($phpiCal_config->allow_login == 'yes')) {
$http_user = $_SERVER['PHP_AUTH_USER'];
}
@@ -46,7 +46,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false)
// Add web calendars.
if ($cal_filename_local[0] == $phpiCal_config->ALL_CALENDARS_COMBINED || $admin) {
if (!isset($http_user) && !$admin) {
- foreach ($phpiCal_config->list_webcals as $file) {
+ foreach ($list_webcals as $file) {
// Make sure the URL ends with .ics.
if (!preg_match("/.ics$/i", $file)) continue;
@@ -74,7 +74,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false)
// subdirectory, or we are supporting the iCal repository format.
// The latter is necessary because the calendar name cannot be
// used to identify the calendar filename.
- if ($find_all || $recursive_path == 'yes' || $support_ical == 'yes') {
+ if ($find_all || $phpiCal_config->recursive_path == 'yes' || $phpiCal_config->support_ical == 'yes') {
// Open the directory.
$dir_handle = @opendir($search_path)
or die(error(sprintf($lang['l_error_path'], $search_path), implode(',', $cal_filename)));
@@ -114,18 +114,18 @@ function availableCalendars($username, $password, $cal_filename, $admin = false)
// Make sure this is not a blacklisted calendar.
$cal_name = getCalendarName($file);
- if (in_array($cal_name, $phpiCal_config->blacklisted_cals)) continue;
+ if (in_array($cal_name, $blacklisted_cals)) continue;
// If HTTP authenticated, make sure this calendar is available
// to the user.
if (isset($http_user)) {
- if (!in_array($cal_name, $phpiCal_config->apache_map[$http_user])) continue;
+ if (!in_array($cal_name, $apache_map[$http_user])) continue;
}
// Make sure this calendar is not locked.
if (!$admin &&
- in_array($cal_name, $phpiCal_config->locked_cals) &&
- !in_array($cal_name, $phpiCal_config->unlocked_cals))
+ in_array($cal_name, $locked_cals) &&
+ !in_array($cal_name, $unlocked_cals))
{
continue;
}
diff --git a/functions/init.inc.php b/functions/init.inc.php
index f629f76..3c1c469 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -112,7 +112,7 @@ foreach ($web_cals as $web_cal) {
// We can only include this web calendar if we allow all web calendars
// (as defined by $allow_webcals) or if the web calendar shows up in the
// list of web calendars defined in config.inc.php.
- if ($allow_webcals != 'yes' &&
+ if ($phpiCal_config->allow_webcals != 'yes' &&
!in_array($cal_webcalPrefix, $list_webcals) &&
!in_array($cal_httpPrefix, $list_webcals) &&
!in_array($cal_httpsPrefix, $list_webcals))
@@ -187,19 +187,13 @@ function getmicrotime() {
$uid_list = array();
#uncomment for diagnostics
-#echo "after init.inc.ics<pre>";
-#echo "cals";
-#print_r($cals);echo"\n\n";
-#echo "cal_filenames";
-#print_r($cal_filenames);echo"\n\n";
-#echo "web_cals";
-#print_r($web_cals);echo"\n\n";
-#echo "local_cals";
-#print_r($local_cals);echo"\n\n";
-#echo "cal_filelist";
-#print_r($cal_filelist);
-#echo "cal_displaynames";
-#print_r($cal_displaynames);
+#echo "after init.inc.ics<pre>";
+#echo "cals";print_r($cals);echo"\n\n";
+#echo "cal_filenames";print_r($cal_filenames);echo"\n\n";
+#echo "web_cals";print_r($web_cals);echo"\n\n";
+#echo "local_cals";print_r($local_cals);echo"\n\n";
+#echo "cal_filelist";print_r($cal_filelist);
+#echo "cal_displaynames";print_r($cal_displaynames);
#echo "</pre><hr>";
-?>
+?> \ No newline at end of file
diff --git a/functions/init/cpaths.php b/functions/init/cpaths.php
index c1ab50b..773f3cb 100644
--- a/functions/init/cpaths.php
+++ b/functions/init/cpaths.php
@@ -26,7 +26,7 @@ if (isset($user_template["$cpath"])){
$template = $user_template["$cpath"];
}
#set up specific webcals for a particular cpath
-if (isset($phpiCal_config->more_webcals) && is_array($phpiCal_config->more_webcals[$cpath])){
- $list_webcals = array_merge($phpiCal_config->list_webcals, $phpiCal_config->more_webcals["$cpath"]);
+if (isset($more_webcals) && is_array($more_webcals[$cpath])){
+ $list_webcals = array_merge($list_webcals, $more_webcals["$cpath"]);
}
$phpiCal_config->setProperty('calendar_path',$calendar_path); \ No newline at end of file

© 2014-2024 Faster IT GmbH | imprint | privacy policy