aboutsummaryrefslogtreecommitdiffstats
path: root/preferences.php
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2002-11-16 06:54:32 +0000
committerChad Little <clittle@users.sourceforge.net>2002-11-16 06:54:32 +0000
commit15d8855649dbea0634ba2980b7e3cbc10291b458 (patch)
tree5ec239422146515450655d79fafeac0169cd135e /preferences.php
parent3d74a314dd1ad90a65b1d50f4213d50e26f39930 (diff)
downloadphpicalendar-15d8855649dbea0634ba2980b7e3cbc10291b458.tar.gz
phpicalendar-15d8855649dbea0634ba2980b7e3cbc10291b458.tar.bz2
phpicalendar-15d8855649dbea0634ba2980b7e3cbc10291b458.zip
cookies
Diffstat (limited to 'preferences.php')
-rw-r--r--preferences.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/preferences.php b/preferences.php
index 86888cc..9c7af57 100644
--- a/preferences.php
+++ b/preferences.php
@@ -1,9 +1,7 @@
<?php
-
+$cookie_uri = 'http://'.$HTTP_SERVER_VARS['SERVER_NAME'].substr($HTTP_SERVER_VARS['PHP_SELF'],0,strpos($HTTP_SERVER_VARS['PHP_SELF'], '/'));
define('BASE','./');
$current_view = "preferences";
-include(BASE.'functions/ical_parser.php');
-$cookie_uri = 'http://'.$HTTP_SERVER_VARS['SERVER_NAME'].substr($HTTP_SERVER_VARS['PHP_SELF'],0,strpos($HTTP_SERVER_VARS['PHP_SELF'], '/'));
$default_view = "$default_view" . ".php";
if ($allow_preferences == 'no') header("Location: $default_view");
$action = $HTTP_GET_VARS['action'];
@@ -14,10 +12,10 @@ if ($action == 'setcookie') {
$cookie_style = $HTTP_POST_VARS['cookie_style'];
$cookie_startday = $HTTP_POST_VARS['cookie_startday'];
$the_cookie = array ("cookie_language" => "$cookie_language", "cookie_calendar" => "$cookie_calendar", "cookie_view" => "$cookie_view", "cookie_startday" => "$cookie_startday", "cookie_style" => "$cookie_style");
- //echo '<pre>'; print_r($the_cookie); echo '</pre>';
$the_cookie = serialize($the_cookie);
setcookie("phpicalendar","$the_cookie",time()+6604800,"/","$cookie_uri",0);
-} else {
+ unset ($cookie_language, $cookie_calendar, $cookie_view, $cookie_style,$cookie_startday);
+} elseif ($HTTP_COOKIE_VARS['phpicalendar']) {
$phpicalendar = $HTTP_COOKIE_VARS['phpicalendar'];
$phpicalendar = explode($phpicalendar);
$cookie_language = $phpicalendar['cookie_language'];
@@ -25,8 +23,10 @@ if ($action == 'setcookie') {
$cookie_view = $phpicalendar['cookie_view'];
$cookie_style = $phpicalendar['cookie_style'];
$cookie_startday = $phpicalendar['cookie_startday'];
+ echo "Cookie read";
}
-echo "$cookie_uri";
+#echo "$cookie_uri";
+include(BASE.'functions/ical_parser.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

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