[kronolith] month view and no cookies

mays@optonline.net mays@optonline.net
Thu, 6 Dec 2001 17:58:26 -0500


In the CVS head version of kronolith, the next and previous buttons do not work
properly in the month view without cookies.

A query representing the desired month is appended to the result of
Horde::selfURL().  The problem is that without cookies, selfURL() appends the
session variable to the url returned.  The query that is appended assumes that
it is first.  The consequence is that two '?'s are present in the final result
used by Horde::link().  This causes the session variable to not be found, and
the user is presented with a new login screen.

The behavior is correct with the daily and weekly views.

Appended is a patch to get around this.  The patch also uses the available
$prevstamp and $nextstamp.

Mark

--- kronolith/templates/month/head.inc.orig	Fri Aug 31 16:25:51 2001
+++ kronolith/templates/month/head.inc	Thu Dec  6 17:41:40 2001
@@ -1,8 +1,8 @@
 <table border="0" cellpadding="1" cellspacing="0" width="100%">
 <tr><th class="header">
-<?= Horde::link(Horde::selfURL() . '?month=' . date('n', $prevstamp) . '&year=' . date('Y', $prevstamp), _("Last month"), 'menu') . Horde::img('prev.gif', 'border="0" alt="&lt;"') ?></a>
+<?= Horde::link(Horde::url($HTTP_SERVER_VARS['PHP_SELF'] . '?timestamp=' . $prevstamp), _("Last month"), 'menu') . Horde::img('prev.gif', 'border="0" alt="&lt;"') ?></a>
 <?= $title ?>
-<?= Horde::link(Horde::selfURL() . '?month=' . date('n', $nextstamp) . '&year=' . date('Y', $nextstamp), _("Next Month"), 'menu') . Horde::img('next.gif', 'border="0" alt="&gt;"') ?></a>
+<?= Horde::link(Horde::url($HTTP_SERVER_VARS['PHP_SELF'] . '?timestamp=' . $nextstamp), _("Next Month"), 'menu') . Horde::img('next.gif', 'border="0" alt="&gt;"') ?></a>
 </th></tr>
 
 <tr><td class="control"><table border="0" cellpadding="2" cellspacing="1" width="100%">


>From jan@horde.org Date: Fri,  7 Dec 2001 10:00:54 +0100
Return-Path: <jan@horde.org>
Mailing-List: contact kronolith-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list kronolith@lists.horde.org
Received: (qmail 44697 invoked from network); 7 Dec 2001 09:07:49 -0000
Received: from mailout00.sul.t-online.com (HELO mailout00.sul.t-online.de) (194.25.134.16)
  by clark.horde.org with SMTP; 7 Dec 2001 09:07:49 -0000
Received: from fwd07.sul.t-online.de 
	by mailout00.sul.t-online.de with smtp 
	id 16CGyu-00008O-0H; Fri, 07 Dec 2001 10:07:44 +0100
Received: from linux.wg.de (320034214675-0001@[217.225.43.97]) by fmrl07.sul.t-online.com
	with esmtp id 16CGyt-1QNZZoC; Fri, 7 Dec 2001 10:07:43 +0100
Received: from localhost (localhost [127.0.0.1])
	by linux.wg.de (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id fB790tk08531
	for <kronolith@lists.horde.org>; Fri, 7 Dec 2001 10:00:55 +0100
Received: from 192.168.60.1 ( [192.168.60.1])
	as user jan@linux by linux.wg.de with HTTP;
	Fri,  7 Dec 2001 10:00:54 +0100
Message-ID: <1007715654.3c10854682d7a@linux.wg.de>
Date: Fri,  7 Dec 2001 10:00:54 +0100
From: Jan Schneider <jan@horde.org>
To: kronolith@lists.horde.org
References: <200112062258.fB6MwQj02565@optonline.net>
In-Reply-To: <200112062258.fB6MwQj02565@optonline.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 4.0-cvs
X-Sender: 320034214675-0001@t-dialin.net
Subject: Re: [kronolith] month view and no cookies

Zitat von mays@optonline.net:

> In the CVS head version of kronolith, the next and previous buttons do
> not work
> properly in the month view without cookies.
> 
> A query representing the desired month is appended to the result of
> Horde::selfURL().  The problem is that without cookies, selfURL() appends
> the
> session variable to the url returned.  The query that is appended assumes
> that
> it is first.  The consequence is that two '?'s are present in the final
> result
> used by Horde::link().  This causes the session variable to not be found,
> and
> the user is presented with a new login screen.
> 
> The behavior is correct with the daily and weekly views.
> 
> Appended is a patch to get around this.  The patch also uses the
> available
> $prevstamp and $nextstamp.
> 
> Mark
> 
> --- kronolith/templates/month/head.inc.orig	Fri Aug 31 16:25:51 2001
> +++ kronolith/templates/month/head.inc	Thu Dec  6 17:41:40 2001
> @@ -1,8 +1,8 @@
>  <table border="0" cellpadding="1" cellspacing="0" width="100%">
>  <tr><th class="header">
> -<?= Horde::link(Horde::selfURL() . '?month=' . date('n', $prevstamp) .
> '&year=' . date('Y', $prevstamp), _("Last month"), 'menu') .
> Horde::img('prev.gif', 'border="0" alt="&lt;"') ?></a>
> +<?= Horde::link(Horde::url($HTTP_SERVER_VARS['PHP_SELF'] . '?timestamp='
> . $prevstamp), _("Last month"), 'menu') . Horde::img('prev.gif',
> 'border="0" alt="&lt;"') ?></a>
>  <?= $title ?>
> -<?= Horde::link(Horde::selfURL() . '?month=' . date('n', $nextstamp) .
> '&year=' . date('Y', $nextstamp), _("Next Month"), 'menu') .
> Horde::img('next.gif', 'border="0" alt="&gt;"') ?></a>
> +<?= Horde::link(Horde::url($HTTP_SERVER_VARS['PHP_SELF'] . '?timestamp='
> . $nextstamp), _("Next Month"), 'menu') . Horde::img('next.gif',
> 'border="0" alt="&gt;"') ?></a>
>  </th></tr>
>  
>  <tr><td class="control"><table border="0" cellpadding="2"
> cellspacing="1" width="100%">

Fixed in cvs, thanks.

Jan.

::::::::::::::::::::::::::::::::::::::::
AMMMa AG - discover your knowledge
:::::::::::::::::::::::::::
Detmolder Str. 25-33 :: D-33604 Bielefeld
fon +49.521.96878-0 :: fax  +49.521.96878-20
http://www.ammma.de
::::::::::::::::::::::::::::::::::::::::::::::