-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Lars,
Many thanks for this report. I'll check that!

    - Peter


- --On February 7, 2008 11:00:06 +0100 [EMAIL PROTECTED] wrote:

| Hi,
| I had a problem with nfsen 1.3 with apache2, php 5.2 on OpenSuSE 10.2. When I 
opened the "Details" page the first time it was
| showing the graphs. On the first form submit or reload of the page there 
occured some problems:
|
| Second load: Message "ERROR: No value for 'statvisible'!" but some graph data 
visible
| Third load: Message "ERROR: No value for 'statvisible'!" but some graph data 
visible
| Tab Change and back: Message "ERROR: No value for 'statvisible'!", no graph 
data visible
|
| I recognized the problem was caused by the cookie "statvisible" which is set 
in the Javascript code on the first load of the
| page. On the second load of the page the cookie value is read and written to 
the superglobal $_POST. It seems there is a
| problem reading this Cookie values in PHP.
|
| When I do print_r($_COOKIE); in details.php it displays:
|
| Array
| (
|     [statvisible] =>
|     [PHPSESSID] => rvvii7426aic8ith6sebu9st607dnucl
| )
|
| Like explained above the cookie value is read from $_COOKIE['statvisible'] 
and written to $_POST['statvisible']. If the value
| of $_COOKIE['statvisible'] is empty the empty value is written to 
$_POST['statvisible']. The default value of "statsvisible"
| in the array $detail_opts will be overwritten by the empty value in $_POST 
array. This causes the error messages I got at the
| second load of the page.
|
| This is a quick backtrace through the sources, don't know if it's correct at 
every point.
|
| I guess this is not the final sollution for that problem but I patched the 
details.php as attached, now the page works for me
| as expected.
|
| --- details.php.orig    2008-02-05 15:21:43.000000000 +0100
| +++ details.php 2008-02-05 15:22:24.000000000 +0100
| @@ -305,11 +305,11 @@
|                 $_POST['proto'] = $_GET['proto'];
|         }
|
| -       if ( isset($_COOKIE['statpref']) ) {
| +       if ( isset($_COOKIE['statpref']) && $_COOKIE['statpref'] != '' ) {
|                 $_POST['statpref'] = $_COOKIE['statpref'];
|         }
|
| -       if ( isset($_COOKIE['statvisible']) ) {
| +       if ( isset($_COOKIE['statvisible']) && $_COOKIE['statvisible'] != '' 
) {
|                 $_POST['statvisible'] = $_COOKIE['statvisible'];
|         }
|
| OK, i see the "Statistics timeslot" table is displayed on every load of the 
page, even if i set it to invisible - but that's
| not a problem for me.
|
| I just tested the javascript/php cookie handling on another webserver with 
php 5.1.x instead of 5.2 -> it worked! So now the
| question: Do you konw any changes there from php 5.1 to 5.2? It would be nice 
if you could aply the patch I posted above to
| nfsen to get the detail page work on php 5.2. Furthermore someone should have 
a look for a real fix in php 5.2.
|
| Thanks!
| Lars
|
| -------------------------------------------------------------------------
| This SF.net email is sponsored by: Microsoft
| Defy all challenges. Microsoft(R) Visual Studio 2008.
| http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
| _______________________________________________
| Nfsen-discuss mailing list
| [email protected]
| https://lists.sourceforge.net/lists/listinfo/nfsen-discuss



- --
_______ SWITCH - The Swiss Education and Research Network ______
Peter Haag,  Security Engineer,  Member of SWITCH CERT
PGP fingerprint: D9 31 D5 83 03 95 68 BA  FB 84 CA 94 AB FC 5D D7
SWITCH, Werdstrasse 2, P.O. Box,  CH-8021   Zurich, Switzerland
E-mail: [EMAIL PROTECTED] Web: http://www.switch.ch/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iQCVAwUBR6x58P5AbZRALNr/AQJb0wP+KUfFEgQ0dZHuVpUi7tx6/3UZ9uPnObyu
Z0T8rKs8He0IOl/jdebG1yQ+5tBX0YgRh7bQRtHcq2abi9bHqrFX4DkJsXKNq7y3
gSZ/HrwZ6IBtC7JxU8I7Raiv5Hf5m1+58vPw31IZwRTaimqYlGSDNKLIYyKgR2w0
Vtu2NCvykbI=
=T+lU
-----END PGP SIGNATURE-----


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nfsen-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nfsen-discuss

Reply via email to