Package: gosa
Version: 2.4-1
Severity: wishlist
Tags: patch
Often, users will have disabled cookies for the site in question at some
point, or have disabled cookies completely. Therefor Gosa should check,
if cookies are enabled and issue a warning at the login-screen, if they
aren't. Otherwise, the user will just get the login-screen again after
logging in, without information, what went wrong.
Because checking for cookies by doing page-reloads doesn't sound like a
clean solution, the attached patch uses JavaScript to do just what was
described above. Of course, it can still fail, if JavaScript is
disabled, but at least, it will help some users.
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14.3
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages gosa depends on:
ii apache 1.3.34-2 versatile, high-performance HTTP
s
ii exim [mail-transport-ag 3.36-18 An MTA (Mail Transport Agent)
ii fping 2.4b2-to-ipv6-13 sends ICMP ECHO_REQUEST packets
to
ii imagemagick 6:6.2.4.5-0.7 Image manipulation programs
ii libcrypt-smbhash-perl 0.12-1 generate LM/NT hash of a password
ii php4 4:4.4.2-1 server-side, HTML-embedded
scripti
ii php4-cgi 4:4.4.2-1 server-side, HTML-embedded
scripti
ii php4-gd 4:4.4.2-1 GD module for php4
ii php4-imap 4:5.1.2-1 IMAP module for php4
ii php4-ldap 4:4.4.2-1 LDAP module for php4
ii php4-mhash 4:4.4.2-1 MHASH module for php4
ii php4-mysql 4:4.4.2-1 MySQL module for php4
ii php4-recode 4:4.4.2-1 Character recoding module for
php4
ii smarty 2.6.11-1 Template engine for PHP
ii wwwconfig-common 0.0.44 Debian web auto configuration
gosa recommends no packages.
-- no debconf information
diff -ur gosa.orig/html/index.php gosa/html/index.php
--- gosa.orig/html/index.php 2005-12-05 10:24:43.000000000 +0100
+++ gosa/html/index.php 2006-03-13 19:53:37.000000000 +0100
@@ -229,6 +229,9 @@
$smarty->assign ("ssl", "");
}
+/* Translation of cookie-warning. Whether to display it, is determined by JavaScript */
+$smarty->assign ("cookies", "<b>"._("Warning").":</b> "._("Your Browser has cookies disabled. Please enable cookies and reload this page once, before you log in."));
+
/* Generate server list */
$servers= array();
if (isset($_POST['server'])){
diff -ur gosa.orig/ihtml/themes/default/login.tpl gosa/ihtml/themes/default/login.tpl
--- gosa.orig/ihtml/themes/default/login.tpl 2005-12-05 10:24:43.000000000 +0100
+++ gosa/ihtml/themes/default/login.tpl 2006-03-13 19:44:20.000000000 +0100
@@ -18,6 +18,19 @@
<!-- Display SSL warning message on demand -->
<p class='gosaLoginWarning'> {$ssl} </p>
+ <!-- check, if cookies are enabled -->
+ <p class='gosaLoginWarning'>
+ <script language="JavaScript" type="text/javascript">
+ <!--
+ document.cookie = "gosatest=empty;path=/";
+ if (document.cookie.indexOf( "gosatest=") > -1 )
+ document.cookie = "gosatest=empty;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT";
+ else
+ document.write("{$cookies}");
+ -->
+ </script>
+ </p>
+
<!-- Formular data, containing a table to center fields -->
<form action='index.php' method='post' name='mainform' onSubmit='js_check(this);return true;'>
<table summary="" style='vertical-align:middle; text-align:left;' cellspacing='7' align='center'>