diff options
author | Jim Hu <jimhu@users.sourceforge.net> | 2005-02-13 17:40:08 +0000 |
---|---|---|
committer | Jim Hu <jimhu@users.sourceforge.net> | 2005-02-13 17:40:08 +0000 |
commit | 64ea7f7fad6aa0370d909f9b3b3ca193c49d6fca (patch) | |
tree | d0006a8e048a42ad91dfa3e598319399ca5065dc /functions | |
parent | 9cd3ac359419bdb52f7b19774e2cedaaadec73df (diff) | |
download | phpicalendar-64ea7f7fad6aa0370d909f9b3b3ca193c49d6fca.tar.gz phpicalendar-64ea7f7fad6aa0370d909f9b3b3ca193c49d6fca.tar.bz2 phpicalendar-64ea7f7fad6aa0370d909f9b3b3ca193c49d6fca.zip |
Modifications init.inc.php to enable multiple calendar paths chosen via REQUEST.
Diffstat (limited to 'functions')
-rw-r--r-- | functions/init.inc.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/functions/init.inc.php b/functions/init.inc.php index 6f21282..5b3aa08 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -69,6 +69,12 @@ if (ini_get('max_execution_time') < 60) { @ini_set('max_execution_time', '60'); } +if($_REQUEST['cpath']){ + $cpath = $_REQUEST['cpath']; + $calendar_path .= "/$cpath"; + $tmp_dir .= "/$cpath"; +} + if ($calendar_path == '') { $calendar_path = BASE.'calendars'; } @@ -129,15 +135,15 @@ if ($is_webcal == TRUE) { // Sets the download and subscribe paths from the config if present. if (isset($filename)) { if (($download_uri == '') && (preg_match('/(^\/|\.\.\/)/', $filename) == 0)) { - $subscribe_path = 'webcal://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/'.$filename; + $subscribe_path = 'webcal://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/'."$cpath/".$filename; $download_filename = $filename; } elseif ($download_uri != '') { $newurl = eregi_replace("^(http://)", "", $download_uri); - $subscribe_path = 'webcal://'.$newurl.'/'.$cal_filename.'.ics'; - $download_filename = $download_uri.'/'.$cal_filename.'.ics'; + $subscribe_path = 'webcal://'.$newurl.'/'."$cpath/".$cal_filename.'.ics'; + $download_filename = $download_uri.'/'."$cpath/".$cal_filename.'.ics'; } else { - $subscribe_path = ''; - $download_filename = ''; + $subscribe_path = "$cpath/"; + $download_filename = "$cpath/"; } } } |