(11-11-2015, 05:56 PM)TGates Wrote: I found a small code that you add to the template. Installed it on my server and works perfect. Will have to look into incorporating it into the core.
OPEN:
/etc/sentora/etc/styles/Sentora_Default/master.ztml
FIND: (near the bottom)
Code:<!-- Modulelist for Typeahead --> <script> var moduleJsonData = <# ui_tpl_modulelistjson #>; Sentora.modules.typeAhead(moduleJsonData); </script>
AFTER ADD:
SAVE/UPLOADCode:<!-- auto-logout JS --> <script type="text/javascript"> $(document).ready(function(){ setInterval(function(){ $.get("<# ui_tpl_assetfolderpath #>check.php", function(data){ if(data==0) window.location.href="?logout"; }); },1*60*1000); }); </script>
CREATE FILE:
/etc/sentora/etc/styles/Sentora_Default/check.php
INSERT INTO 'check.php':
SAVE/UPLOADPHP Code:<?php
$timeOut = "120"; // (120 seconds = 2 minutes)
if(isset($_SESSION['timeout']) ) {
$session_life = time() - $_SESSION['timeout'];
if($session_life > $timeOut) echo "0";
else echo "1";
}
$_SESSION['timeout'] = time();
?>
That was quick and awesome... It really worked very well as expected..
Thanks a lot TGates :-)
It will be great if you could pls include the same in the next patch which will be very much useful.


