aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-28 10:50:57 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-28 10:50:57 +0000
commitd6405b94fff1853f6654ecb85eea79721827b6ca (patch)
tree94eed54194dc8ff3aa2512d66816a0f7e60fc5bb /functions
parentbbfbcfca381146e0ca2a161616513cf2e66f3337 (diff)
downloadphpicalendar-d6405b94fff1853f6654ecb85eea79721827b6ca.tar.gz
phpicalendar-d6405b94fff1853f6654ecb85eea79721827b6ca.tar.bz2
phpicalendar-d6405b94fff1853f6654ecb85eea79721827b6ca.zip
kill admin.php; misc other changes; bump rc num
Diffstat (limited to 'functions')
-rw-r--r--functions/admin_functions.php8
-rw-r--r--functions/calendar_functions.php22
-rw-r--r--functions/ical_parser.php3
-rw-r--r--functions/init.inc.php4
-rw-r--r--functions/init/cpaths.php4
-rw-r--r--functions/init/date_range.php1
-rw-r--r--functions/parse/parse_tzs.php2
-rw-r--r--functions/parse/recur_functions.php2
-rw-r--r--functions/template.php4
9 files changed, 25 insertions, 25 deletions
diff --git a/functions/admin_functions.php b/functions/admin_functions.php
index f396a28..d62c077 100644
--- a/functions/admin_functions.php
+++ b/functions/admin_functions.php
@@ -47,10 +47,10 @@ function login ($username, $password) {
// arg1: string password
// returns boolean was login successful
function login_ftp ($username, $password) {
- global $ftp_server, $ftp_port;
+ global $phpiCal_config;
// set up basic connection
- $conn_id = @ftp_connect($ftp_server, $ftp_port);
+ $conn_id = @ftp_connect($phpiCal_config->ftp_server, $phpiCal_config->ftp_port);
if (!$conn_id) exit(error('Cannot connect to FTP server', $filename));
// login with username and password
$login_result = @ftp_login($conn_id, $username, $password);
@@ -88,6 +88,7 @@ function delete_cal ($filename) {
global $_SESSION;
global $phpiCal_config;
global $calendar_path;
+ echo $filename;
if ($phpiCal_config->auth_method == 'ftp') {
$filename = get_ftp_calendar_path() . "/" . $filename;
@@ -115,12 +116,11 @@ function delete_cal ($filename) {
return TRUE;
} else {
#$filename = $calendar_path . "/" . $filename;
-
$delete = unlink($filename);
clearstatcache();
if (@file_exists($filename)) {
$filesys = eregi_replace("/","\\", $filename);
- $delete = system("del $filesys");
+ $delete = system("rm -f $filesys");
clearstatcache();
if (@file_exists($filename)) {
$delete = chmod ($filename, 0775);
diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php
index 09279da..48bc9ba 100644
--- a/functions/calendar_functions.php
+++ b/functions/calendar_functions.php
@@ -41,19 +41,17 @@ function availableCalendars($username, $password, $cal_filename, $admin = false)
// This array keeps track of paths we need to search.
$search_paths = array($phpiCal_config->calendar_path);
-
// Add web calendars.
if ($cal_filename_local[0] == $phpiCal_config->ALL_CALENDARS_COMBINED || $admin) {
if (!isset($http_user) && !$admin) {
foreach ($list_webcals as $file) {
// Make sure the URL ends with .ics.
- if (!preg_match("/.ics$/i", $file)) continue;
+ if (!is_string($file)) continue;
// Add this calendar.
array_push($calendars, $file);
}
}
- }
-
+ }
// Set some booleans that will dictate our search.
$find_all = ($cal_filename_local[0] == $phpiCal_config->ALL_CALENDARS_COMBINED || $admin);
@@ -74,10 +72,10 @@ function availableCalendars($username, $password, $cal_filename, $admin = false)
// used to identify the calendar filename.
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)));
+ $dir_handle = opendir($search_path)
+ or die(error("cal fn 78:".sprintf($lang['l_error_path'], $search_path), implode(',', $cal_filename)));
if ($dir_handle === false)
- die(error(sprintf($lang['l_error_path'], $search_path), implode(',', $cal_filename)));
+ die(error(" cal fn 80:".sprintf($lang['l_error_path'], $search_path), implode(',', $cal_filename)));
// Add each file in the directory that does not begin with a dot.
while (false !== ($file = readdir($dir_handle))) {
@@ -110,7 +108,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false)
if (in_array($cal_name, $blacklisted_cals)) continue;
// If HTTP authenticated, make sure this calendar is available
// to the user.
- if (isset($http_user) && !in_array($cal_name, $apache_map[$http_user])) continue;
+ if (isset($http_user) && isset($apache_map[$http_user]) && !in_array($cal_name, $apache_map[$http_user])) continue;
// Make sure this calendar is not locked.
if (!$admin && in_array($cal_name, $locked_cals) && !in_array($cal_name, $unlocked_cals)) continue;
@@ -157,10 +155,10 @@ function availableCalendarNames($username, $password, $cal_filename, $admin = fa
//
// $cal_path = The path to the calendar file.
function getCalendarName($cal_path) {
- global $support_ical;
+ global $phpiCal_config;
// If iCal is supported, check the directory for an Info.plist.
- if ($support_ical == 'yes') {
+ if ($phpiCal_config->support_ical == 'yes') {
// Look for the Info.plist file.
$plist_filename = dirname($cal_path)."/Info.plist";
if (is_file($plist_filename)) {
@@ -186,7 +184,7 @@ function getCalendarName($cal_path) {
//
// $cals = The calendars (entire path, e.g. from availableCalendars).
function display_ical_list($cals, $pick=FALSE) {
- global $cal, $current_view, $getdate, $calendar_lang, $all_cal_comb_lang, $cal_filelist, $cal_displaynames, $phpiCal_config;
+ global $cal, $current_view, $getdate, $lang, $calendar_lang, $all_cal_comb_lang, $cal_filelist, $cal_displaynames, $phpiCal_config;
// Print each calendar option.
$return = '';
foreach ($cals as $cal_tmp) {
@@ -216,7 +214,7 @@ function display_ical_list($cals, $pick=FALSE) {
if ($prop_pos !== false) $property = substr($property,0,$prop_pos);
$property = strtoupper($property);
if ($property == "X-WR-CALNAME"){
- $cal_displayname_tmp = $data;
+ $cal_displayname_tmp = stripslashes($data);
break;
}
}
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index a70522c..cafcd0a 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -128,6 +128,7 @@ foreach ($cal_filelist as $cal_key=>$filename) {
$line = trim(stripslashes($line));
switch ($line) {
+ case 'BEGIN:VFREEBUSY':
case 'BEGIN:VEVENT':
// each of these vars were being set to an empty string
unset (
@@ -165,7 +166,7 @@ foreach ($cal_filelist as $cal_key=>$filename) {
$organizer = array();
break;
-
+ case 'END:VFREEBUSY':
case 'END:VEVENT':
include BASE."functions/parse/end_vevent.php";
break;
diff --git a/functions/init.inc.php b/functions/init.inc.php
index 3c1c469..955d45a 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -75,14 +75,14 @@ foreach ($cal_filenames as $cal_filename) {
substr($cal_filename, 0, 9) == 'webcal://')
{
#jump sends cal url without .ics extension. Add it if needed.
- if (substr($cal_filename, -4) != ".ics") $cal_filename .= ".ics";
+ # if (substr($cal_filename, -4) != ".ics") $cal_filename .= ".ics";
$web_cals[] = $cal_filename;
}
// Otherwise it is a local calendar.
else {
// Check blacklisted.
- if (in_array($cal_filename, $phpiCal_config->blacklisted_cals) && $cal_filename !='') {
+ if (in_array($cal_filename, $blacklisted_cals) && $cal_filename !='') {
exit(error($lang['l_error_restrictedcal'], $cal_filename));
}
$local_cals[] = urldecode(str_replace(".ics", '', basename($cal_filename)));
diff --git a/functions/init/cpaths.php b/functions/init/cpaths.php
index 773f3cb..e728654 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($more_webcals) && is_array($more_webcals[$cpath])){
- $list_webcals = array_merge($list_webcals, $more_webcals["$cpath"]);
+if (isset($more_webcals[$cpath]) && is_array($more_webcals[$cpath])){
+ foreach ($more_webcals[$cpath] as $wcal)$list_webcals[] = $wcal;
}
$phpiCal_config->setProperty('calendar_path',$calendar_path); \ No newline at end of file
diff --git a/functions/init/date_range.php b/functions/init/date_range.php
index d9f7b54..81e9190 100644
--- a/functions/init/date_range.php
+++ b/functions/init/date_range.php
@@ -33,6 +33,7 @@ switch ($current_view){
$mArray_begin = mktime (0,0,0,$start_month,1,($start_year));
$mArray_end = mktime (0,0,0,$end_month,31,($end_year));
break;
+ case 'admin':
case 'error':
case 'preferences':
$mArray_begin = time();
diff --git a/functions/parse/parse_tzs.php b/functions/parse/parse_tzs.php
index 8b02cb5..7f2dfce 100644
--- a/functions/parse/parse_tzs.php
+++ b/functions/parse/parse_tzs.php
@@ -1,6 +1,6 @@
<?php
$ifile = @fopen($filename, "r");
-if ($ifile == FALSE) exit(error($lang['l_error_cantopen'], $filename));
+if ($ifile == FALSE) exit(error($lang['l_error_cantopen']." parse_tz", $filename));
$nextline = fgets($ifile);
if (trim($nextline) != 'BEGIN:VCALENDAR') exit(error($lang['l_error_invalidcal'], $filename));
diff --git a/functions/parse/recur_functions.php b/functions/parse/recur_functions.php
index 7a4af96..0526e1d 100644
--- a/functions/parse/recur_functions.php
+++ b/functions/parse/recur_functions.php
@@ -251,4 +251,4 @@ function dump_times($times){
#var_dump($times);
foreach($times as $time) echo "\ndate:".date("Y-m-d H:i:s",$time);
echo "</pre>";
-} \ No newline at end of file
+}
diff --git a/functions/template.php b/functions/template.php
index 46f5163..5535f69 100644
--- a/functions/template.php
+++ b/functions/template.php
@@ -16,7 +16,7 @@ class Page {
function draw_admin() {
global $phpiCal_config, $getdate, $cal, $master_array, $is_loged_in;
-
+ $delete_table = '';
if ($is_loged_in == TRUE) {
// Print Calendar Checkboxes
$COLUMNS_TO_PRINT = 3;
@@ -1062,7 +1062,7 @@ class Page {
$file = str_replace("templates/$phpiCal_config->template","templates/default",$file);
}
if (!is_file($file)){
- exit(error($lang['l_error_path'], $file));
+ exit(error($lang['l_error_path']." template 1065", $file));
}
ob_start();
include($file);

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