fix to timeout script
[openemr.git] / interface / main / tabs / timeout_iframe.php
blob6224f236b8799e77963a05532274e86f13aa3048
1 <?php
2 /**
3 * This script runs in a hidden iframe and reloads itself periodically
4 * to support auto logout timeout.
6 * Copyright (C) 2006 Rod Roark <rod@sunsetsystems.com>
7 * Copyright (C) 2016 Brady Miller <brady.g.miller@gmail.com>
9 * LICENSE: This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
20 * @package OpenEMR
21 * @author Rod Roark <rod@sunsetsystems.com>
22 * @author Brady Miller <brady.g.miller@gmail.com>
23 * @link http://www.open-emr.org
26 $fake_register_globals=false;
27 $sanitize_all_escapes=true;
29 // Tell auth.inc that this is the daemon script; this is so that
30 // inactivity timeouts will still work, and to avoid logging an
31 // event every time we run.
32 $GLOBALS['DAEMON_FLAG'] = true;
34 require_once(dirname(__FILE__)) . "/../../globals.php";
36 $daemon_interval = 120; // Interval in seconds between reloads.
39 <html>
40 <body>
41 <script type="text/javascript">
43 function timerint() {
44 top.restoreSession();
45 location.reload();
46 return;
49 setTimeout('timerint()', <?php echo $daemon_interval * 1000; ?>);
51 </script>
52 </body>
53 </html>