aboutsummaryrefslogtreecommitdiffstats
path: root/functions/init/cpaths.php
blob: bcf2c113e6dfcd5ad634bad6d944ab0abb2590ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
# adjust paths in case they are incorrect
if ($phpiCal_config->default_path == '') {
	$phpiCal_config->setProperty('default_path', BASE);
}

#cpath modifies the calendar path based on the url or cookie values.  This allows you to run multiple calendar subsets from a single phpicalendar installation. Operations on cpath are largely hidden from the end user.
if ($phpiCal_config->calendar_path == '') {
	$phpiCal_config->setProperty('calendar_path', BASE.'calendars');
}
$calendar_path = $phpiCal_config->calendar_path;
$cpath = ''; #initialize cpath to prevent later undef warnings.
if(isset($_REQUEST['cpath'])&& $_REQUEST['cpath'] !=''){
	$cpath 	= str_replace('..','',$_REQUEST['cpath']);				
	$calendar_path 	.= "/$cpath";				
#	$tmp_dir 	.= "/$cpath";				
}elseif(isset($phpiCal_config->default_cpath_check) && $phpiCal_config->default_cpath_check !='' ){
	$cpath 	= str_replace('..','',$default_cpath_check);				
	$calendar_path 	.= "/$cpath";				
#	$tmp_dir 	.= "/$cpath";
}
#these need cpath to be set
#set up specific template folder for a particular cpath
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"]);
}

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