This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Timeout for Sentora Admin Panel
#5
RE: Timeout for Sentora Admin Panel
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:
Code:
        <!-- 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>
SAVE/UPLOAD

CREATE FILE:
/etc/sentora/etc/styles/Sentora_Default/check.php

INSERT INTO 'check.php':
PHP 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();
?>
SAVE/UPLOAD
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: minufreelance , Ron-e , kmlreverser


Messages In This Thread
RE: Timeout for Sentora Admin Panel - by TGates - 11-11-2015, 03:05 PM
RE: Timeout for Sentora Admin Panel - by TGates - 11-11-2015, 05:56 PM
RE: Timeout for Sentora Admin Panel - by TGates - 11-15-2018, 11:16 AM
RE: Timeout for Sentora Admin Panel - by TGates - 11-22-2018, 12:48 AM
RE: Timeout for Sentora Admin Panel - by TGates - 11-24-2018, 10:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Secure Sentora With SSLForFree Chris L 1 4 ,659 01-22-2020, 09:19 PM
Last Post: ralphharder
Fail2ban for Sentora (Centos 7) bbspike 14 44 ,733 01-14-2020, 07:32 AM
Last Post: Vedran B
ADD SSL TO WINDOWS SENTORA khir 1 4 ,986 11-15-2018, 11:21 AM
Last Post: TGates

Forum Jump:


Users browsing this thread: 1 Guest(s)