From 6b786f6023ec8ff6e8ece7b352d0fa95b7946e02 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Sun, 27 Nov 2005 07:56:31 +0000 Subject: patches to fix several files to work better with cookies. Changes in preferences.php, preferencees.tpl, init.inc.php --- functions/init.inc.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'functions/init.inc.php') diff --git a/functions/init.inc.php b/functions/init.inc.php index d7d0dc4..60a6633 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -15,23 +15,31 @@ $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; if (!defined('BASE')) define('BASE', './'); include_once(BASE.'config.inc.php'); include_once(BASE.'error.php'); -if($_REQUEST['cpath']){ - $cpath = $_REQUEST['cpath']; - $calendar_path .= "/$cpath"; - $tmp_dir .= "/$cpath"; -} -include_once(BASE.'functions/calendar_functions.php'); -include_once(BASE.'functions/userauth_functions.php'); if (isset($_COOKIE['phpicalendar'])) { $phpicalendar = unserialize(stripslashes($_COOKIE['phpicalendar'])); if (isset($phpicalendar['cookie_language'])) $language = $phpicalendar['cookie_language']; if (isset($phpicalendar['cookie_calendar'])) $default_cal_check = $phpicalendar['cookie_calendar']; + if (isset($phpicalendar['cookie_cpath'])) $default_cpath_check = $phpicalendar['cookie_cpath']; if (isset($phpicalendar['cookie_view'])) $default_view = $phpicalendar['cookie_view']; - if (isset($phpicalendar['cookie_style'])) $style_sheet = $phpicalendar['cookie_style']; + if (isset($phpicalendar['cookie_style'])) $template = $phpicalendar['cookie_style']; if (isset($phpicalendar['cookie_startday'])) $week_start_day = $phpicalendar['cookie_startday']; if (isset($phpicalendar['cookie_time'])) $day_start = $phpicalendar['cookie_time']; } +if($_REQUEST['cpath']){ + $cpath = $_REQUEST['cpath']; + $calendar_path .= "/$cpath"; + $tmp_dir .= "/$cpath"; +}elseif(isset($default_cpath_check)){ + $cpath = $default_cpath_check; + $calendar_path .= "/$cpath"; + $tmp_dir .= "/$cpath"; +} + +#these need cpath to be set +include_once(BASE.'functions/calendar_functions.php'); +include_once(BASE.'functions/userauth_functions.php'); + // Set the cookie URI. if ($cookie_uri == '') { -- cgit v1.2.3