Code

Added message for timed out sessions
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 8 Dec 2005 12:29:35 +0000 (12:29 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 8 Dec 2005 12:29:35 +0000 (12:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2256 594d385d-05f5-0310-b6e9-bd551577e9d8

html/index.php
html/logout.php
ihtml/themes/default/logout.tpl [new file with mode: 0644]

index 623d050bc29fa6287d3e47c759bc0f850f77d32e..fcfe3445bbe75a9809a6779621bc9b9dd07d3af1 100644 (file)
@@ -122,7 +122,7 @@ if ($config->data['MAIN']['FORCESSL'] == 'true' && $ssl != ''){
 }
 
 /* Got a formular answer, validate and try to log in */
-if ($_SERVER["REQUEST_METHOD"] == "POST"){
+if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){
 
   /* Reset error messages */
   $message= "";
index a5c8fd200cd9e5c5c93b295f39085067a93d35d0..aae94bc87896b9e950725fc1f0ba0b31ae494671 100644 (file)
@@ -24,9 +24,36 @@ require_once ("../include/php_setup.inc");
 require_once ("functions.inc");
 session_start ();
 
+/* Language setup */
+if ($config->data['MAIN']['LANG'] == ""){
+  $lang= get_browser_language();
+} else {
+  $lang= $config->data['MAIN']['LANG'];
+}
+$lang.=".UTF-8";
+putenv("LANGUAGE=");
+putenv("LANG=$lang");
+setlocale(LC_ALL, $lang);
+$GLOBALS['t_language']= $lang;
+$GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/';
+
+/* Set the text domain as 'messages' */
+$domain = 'messages';
+bindtextdomain($domain, "$BASE_DIR/locale");
+textdomain($domain);
+
 /* Do logout-logging and destroy session */
 if (!isset($_SESSION["ui"])){
-  header ("Location: index.php");
+    
+  /* Set template compile directory */
+  $smarty= new smarty();
+  if (isset ($config->data['MAIN']['COMPILE'])){
+    $smarty->compile_dir= $config->data['MAIN']['COMPILE'];
+  } else {
+    $smarty->compile_dir= '/var/spool/gosa/';
+  }
+  $smarty->display (get_template_path('headers.tpl'));
+  $smarty->display (get_template_path('logout.tpl'));
   exit;
 }
 $ui= $_SESSION["ui"];
@@ -43,3 +70,4 @@ header ("Location: index.php");
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>
+</html>
diff --git a/ihtml/themes/default/logout.tpl b/ihtml/themes/default/logout.tpl
new file mode 100644 (file)
index 0000000..8bd0880
--- /dev/null
@@ -0,0 +1,14 @@
+<body style="background-color: white;background-image:none;">
+
+<form action='index.php' method='post' name='mainform' onSubmit='js_check(this);return true;'>
+<div style="margin-left:10%; margin-right:10%; margin-top:5%; border:2px solid red;padding-left:10px;padding-right:10px;padding-top:5px;padding-bottom:20px;">
+ <h1>{t}Your GOsa session has expired!{/t}</h1>
+ <p>
+ {t}The last interaction with the GOsa web interface has been some time ago in the past. For security reasons, the session has been closed. To continue with administrative tasks, please sign in again.{/t}
+ </p>
+ <br>
+ <center><input type="submit" name="dummy" value="{t}Sign in again{/t}"></center>
+</div>
+</form>
+
+</body>