From 2f80cc0fecd6a2f495a6cc843c36c7d5e0dc8565 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Sun, 8 Apr 2007 18:15:41 +0000 Subject: Remove old and insecure versions of publish --- calendars/publish.ical.php | 147 --------------------------------- calendars/publish.mozilla.php | 183 ------------------------------------------ 2 files changed, 330 deletions(-) delete mode 100644 calendars/publish.ical.php delete mode 100644 calendars/publish.mozilla.php (limited to 'calendars') diff --git a/calendars/publish.ical.php b/calendars/publish.ical.php deleted file mode 100644 index 249a757..0000000 --- a/calendars/publish.ical.php +++ /dev/null @@ -1,147 +0,0 @@ - $v){ - if(strstr($v,'X-WR-CALNAME:')){ - $arr = explode(':',$v); - $calendar_name = trim($arr[1]); - break; - } - } - - $calendar_name = isset($calendar_name) ? $calendar_name : 'default'; - - // write to file - if($fp = fopen($calendar_path.$calendar_name.'.ics','w+')){ - fputs($fp, $data, strlen($data) ); - @fclose($fp); - }else{ - logmsg( 'couldnt open file '.$calendar_path.$calendar_name.'.ics' ); - } - } - } -} - -// for logging -function logmsg($str){ - if(defined('PHPICALENDAR_LOG_PUBLISHING') && PHPICALENDAR_LOG_PUBLISHING == 1) - { - if($fp = fopen('publish_log.txt','a+')) - { - $str .= "\n"; - fputs($fp, $str, strlen($str) ); - fclose($fp); - } - } -} -?> diff --git a/calendars/publish.mozilla.php b/calendars/publish.mozilla.php deleted file mode 100644 index 7d4e9ed..0000000 --- a/calendars/publish.mozilla.php +++ /dev/null @@ -1,183 +0,0 @@ - $v) { - if(strstr($v,'X-WR-CALNAME:')) { - $arr = explode(':',$v); - $calendar_name = trim($arr[1]); - break; - } - } - - $calendar_name = isset($calendar_name) ? $calendar_name : 'default'; - - if (isset($_SERVER['PATH_INFO'])) { - preg_match("/\/([ A-Za-z0-9.]*).ics/i",$_SERVER['PATH_INFO'],$matches); - $calendar_name = $matches[1]; - } - - // write to file - if($fp = fopen($calendar_path.$calendar_name.'.ics','w+')) { - - fputs($fp, $data, strlen($data) ); - @fclose($fp); - } - else { - logmsg( 'couldnt open file '.$calendar_path.$calendar_name.'.ics' ); - } - } - } - if ($_SERVER['REQUEST_METHOD'] == 'GET') { - if (isset($_SERVER['PATH_INFO'])) { - preg_match("/\/([ A-Za-z0-9._]*).ics/i",$_SERVER['PATH_INFO'],$matches); - $icsfile = $matches[1]; - // get calendar data - if (file_exists($calendar_path . $icsfile . '.ics') && - is_readable($calendar_path . $icsfile . '.ics') && - is_file($calendar_path . $icsfile . '.ics') - ) { - echo file_get_contents($calendar_path . $icsfile . '.ics'); - } else { - - } - } - } - } -} -// for logging -function logmsg($str){ - if(defined('PHPICALENDAR_LOG_PUBLISHING') && - PHPICALENDAR_LOG_PUBLISHING == 1) { - if($fp = fopen('publish_log.txt','a+')) { - $str .= "\n"; - fputs($fp, $str, strlen($str) ); - fclose($fp); - } - } -} -?> \ No newline at end of file -- cgit v1.2.3