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
#1
Timeout for Sentora Admin Panel
Hi,

Is there any way I can set timeout for Sentora Admin Panel ? Now, its like once login and you will be in till the browser cache is cleared.

Thanks in advance
Reply
Thanks given by:
#2
RE: Timeout for Sentora Admin Panel
(11-11-2015, 03:13 AM)minufreelance Wrote: Hi,

Is there any way I can set timeout for Sentora Admin Panel ? Now, its like once login and you will be in till the browser cache is cleared.

Thanks in advance



Whether anyone has come across such a setting as it is important concerning the server security ?
Reply
Thanks given by:
#3
RE: Timeout for Sentora Admin Panel
One should always log out of any site/forums/etc. that they have logged into.
I think way back when somebody had made something like this, but it was a long time ago and I am sure it's lost... I'll take a look around and see what I can find.
-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:
#4
RE: Timeout for Sentora Admin Panel
(11-11-2015, 03:05 PM)TGates Wrote: One should always log out of any site/forums/etc. that they have logged into.
I think way back when somebody had made something like this, but it was a long time ago and I am sure it's lost... I'll take a look around and see what I can find.

Thanks a lot TGates. There are chances that someone may forget to logout or probably close the window without logging out.. In all the usual control panel nowadays has this session timeout feature and its mandatory I guess concerning security aspect.

Awaiting your reply :-)
Reply
Thanks given by:
#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
#6
RE: Timeout for Sentora Admin Panel
(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:
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


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.
Reply
Thanks given by:
#7
RE: Timeout for Sentora Admin Panel
I have made these changes and it does successfully end the user session -- BUT the time interval is ignored. I've had to remove it because I am unable to complete any action without being interrupted with a quick logout.

Any thoughts why this is?
Reply
Thanks given by:
#8
RE: Timeout for Sentora Admin Panel
(11-13-2018, 04:11 AM)republicus Wrote: I have made these changes and it does successfully end the user session -- BUT the time interval is ignored. I've had to remove it because I am unable to complete any action without being interrupted with a quick logout.

Any thoughts why this is?

Have you tried to increase the time to 240 (4 minutes) to see if that makes a difference?
-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:
#9
RE: Timeout for Sentora Admin Panel
(11-15-2018, 11:16 AM)TGates Wrote: Have you tried to increase the time to 240 (4 minutes) to see if that makes a difference?

I had set it as high as 10 minutes with no changes.

I just add the code again to 240 and the results are the same. After 60 seconds of inactivity it kicks no matter what number of seconds I set.
Reply
Thanks given by:
#10
RE: Timeout for Sentora Admin Panel
(11-15-2018, 07:41 PM)republicus Wrote: I had set it as high as 10 minutes with no changes.

I just add the code again to 240 and the results are the same. After 60 seconds of inactivity it kicks no matter what number of seconds I set.

I'm wondering if there is something in the server config that is taking over. A timeout setting in the php config maybe? I really do not have the time right now to dig into it Sad Maybe a quick snoop on google could shed some light on this Angel 

Google: php set session timeout

Or maybe see if there is a better/working way of doing this:
Google: php auto logout after inactivity
-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:


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

Forum Jump:


Users browsing this thread: 1 Guest(s)