From a497e2c7646bd65201184a61a8eab40789c328e8 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sun, 17 Nov 2002 02:32:10 +0000 Subject: 4 of 5 cookies seem to work on my machine. --- functions/init.inc.php | 10 ++++++++++ index.php | 4 ++++ preferences.php | 17 ++++++++--------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/functions/init.inc.php b/functions/init.inc.php index 4e19477..5f2c0a8 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -11,6 +11,16 @@ if (!defined('BASE')) define('BASE', './'); include(BASE.'config.inc.php'); include(BASE.'functions/error.php'); +if ($HTTP_COOKIE_VARS['phpicalendar']) { + $phpicalendar = unserialize(stripslashes($HTTP_COOKIE_VARS['phpicalendar'])); + $language = $phpicalendar['cookie_language']; + $default_cal = $phpicalendar['cookie_calendar']; + $default_view = $phpicalendar['cookie_view']; + $style_sheet = $phpicalendar['cookie_style']; + // Need to fix this below + #$week_start_day = $phpicalendar['cookie_startday']; +} + // language support $language = strtolower($language); diff --git a/index.php b/index.php index eadbebb..1cee6f0 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,10 @@ "$cookie_language", "cookie_calendar" => "$cookie_calendar", "cookie_view" => "$cookie_view", "cookie_startday" => "$cookie_startday", "cookie_style" => "$cookie_style"); $the_cookie = serialize($the_cookie); - setcookie("phpicalendar","$the_cookie",0,"/","$cookie_uri",0); + setcookie("phpicalendar","$the_cookie",time()+(60*60*24*7*12*10) ,"/","$cookie_uri",0); unset ($cookie_language, $cookie_calendar, $cookie_view, $cookie_style,$cookie_startday); } -if ($phpicalendar) { - #$phpicalendar = $_COOKIE['phpicalendar']; - $phpicalendar = unserialize($phpicalendar); +if ($HTTP_COOKIE_VARS['phpicalendar']) { + $phpicalendar = unserialize(stripslashes($HTTP_COOKIE_VARS['phpicalendar'])); $cookie_language = $phpicalendar['cookie_language']; $cookie_calendar = $phpicalendar['cookie_calendar']; $cookie_view = $phpicalendar['cookie_view']; $cookie_style = $phpicalendar['cookie_style']; $cookie_startday = $phpicalendar['cookie_startday']; - echo "Cookie read"; } -echo "$cookie_uri"; -print_r($HTTP_COOKIE_VARS); +#echo "$cookie_uri"; +#print_r(unserialize($HTTP_COOKIE_VARS['phpicalendar'])); +#print_r($phpicalendar); include(BASE.'functions/ical_parser.php'); ?> + if ($action == 'setcookie') { ?> Your preferences have been set. -- cgit v1.2.3