[Mapbender-commits] r1290 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu May 3 05:53:23 EDT 2007
Author: astrid_emde
Date: 2007-05-03 05:53:23 -0400 (Thu, 03 May 2007)
New Revision: 1290
Modified:
trunk/mapbender/http/javascripts/mod_setTimeout.php
Log:
new elements vars for this modul
Modified: trunk/mapbender/http/javascripts/mod_setTimeout.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_setTimeout.php 2007-05-02 14:06:07 UTC (rev 1289)
+++ trunk/mapbender/http/javascripts/mod_setTimeout.php 2007-05-03 09:53:23 UTC (rev 1290)
@@ -1,67 +1,95 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_setTimeout.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# requires a session-variable 'ttl'
-session_start();
-echo "var mod_timeout_ttl = '".(intval($_SESSION["ttl"])/60)."';";
-?>
-
-mod_timeout_cnt = false;
-
-/*
-* alert: a confirm - window to reload the application when timeout "ttl" is reached
-* logout: request mod_logout after timeout "ttl"
-*/
-mod_timeout_action = "alert";
-
-mb_registerSubFunctions("mod_setTimeout_set()"); // maprequest
-mb_registerInitFunctions("mod_setTimeout_interval()");
-function mod_setTimeout_interval(){
- var aktiv = window.setInterval("mod_setTimeout_check()",60000);
- mod_setTimeout_set();
- mod_setTimeout_check();
-}
-
-function mod_setTimeout_set(){
- mod_timeout_cnt = parseInt(mod_timeout_ttl);
- mod_setTimeout_check();
-}
-
-function mod_setTimeout_check(){
- var str = "<span style='font-family: Arial, Helvetica, sans-serif;font-size:10px;'>";
- str += "Automatische Abmeldung: ";
-
- if(mod_timeout_cnt >= 0){
- str += mod_timeout_cnt;
- }
- else { str += "0"; }
-
- str += " min";
- str += "</span>";
- writeTag("", "timeout", str );
-
- if(mod_timeout_cnt == 0 && mod_timeout_action == 'alert'){
- var go = confirm("Bitte beachten Sie, dass Ihre Session abgelaufen sein kann...\n Mit OK laden Sie die Anwendung neu!");
- if(go == true){
- document.location.href = "../frames/login.php";
- }
- }
- if(mod_timeout_cnt == 0 && mod_timeout_action == 'logout'){ document.location.href = "../php/mod_logout.php";}
- mod_timeout_cnt--;
-}
\ No newline at end of file
+<?php
+# $Id:$
+# http://www.mapbender.org/index.php/mod_setTimeout.php
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+session_start();
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+$e_id_css = 'timeout';
+$gui_id = $_REQUEST["gui_id"];
+include '../include/dyn_js.php';
+
+?>
+
+try{
+ if (timeout_text){}
+}
+catch(e){
+ timeout_text = "Your session isn't valid anymore ...\n Press ok to restart the application!";
+ //timeout_text = "Bitte beachten Sie, dass Ihre Session abgelaufen sein kann...\n Mit OK laden Sie die Anwendung neu!";
+}
+
+try{
+ if (timeout_interval){}
+}
+catch(e){
+ timeout_interval = '15';
+}
+
+/*
+* alert: a confirm - window to reload the application when timeout is reached
+* logout: request mod_logout after timeout
+*/
+try{
+ if (timeout_action){}
+}
+catch(e){
+ timeout_action = 'alert';
+}
+
+
+/*version 2.0.0*/
+mod_timeout_cnt = false;
+
+
+mb_registerSubFunctions("mod_setTimeout_set()"); // maprequest
+mb_registerInitFunctions("mod_setTimeout_interval()");
+
+function mod_setTimeout_interval(){
+ var aktiv = window.setInterval("mod_setTimeout_check()",60000);
+ mod_setTimeout_set();
+ mod_setTimeout_check();
+}
+
+function mod_setTimeout_set(){
+ mod_timeout_cnt = parseInt(timeout_interval);
+ mod_setTimeout_check();
+}
+
+function mod_setTimeout_check(){
+
+ var str = "<span style='font-family: Arial, Helvetica, sans-serif;font-size:10px;'>";
+ str += "Logout in ";
+
+ if(mod_timeout_cnt >= 0){
+ str += mod_timeout_cnt;
+ }
+ else { str += "0"; }
+
+ str += " min";
+ str += "</span>";
+ writeTag("", "timeout", str );
+
+ if(mod_timeout_cnt == 0 && timeout_action == 'alert'){
+ var go = confirm(timeout_text);
+ if(go == true){
+ document.location.href = "./login.php";
+ }
+
+ }
+ if(mod_timeout_cnt == 0 && timeout_action == 'logout'){ document.location.href = "../php/mod_logout.php";}
+ mod_timeout_cnt--;
+}
More information about the Mapbender_commits
mailing list