From: niekt0 Date: Tue, 5 Apr 2011 22:03:59 +0000 (+0200) Subject: logout idle fix (moved to constants) X-Git-Url: https://git.harvie.cz/?p=mirrors%2FKyberia-bloodline.git;a=commitdiff_plain;h=24634046428a423bcb371af50523d82bfb3c3a92 logout idle fix (moved to constants) --- diff --git a/wwwroot/inc/logout_idle.inc b/wwwroot/inc/logout_idle.inc index 8b5abb4..70955ef 100644 --- a/wwwroot/inc/logout_idle.inc +++ b/wwwroot/inc/logout_idle.inc @@ -1,7 +1,13 @@ = (time() - 60*60)) { //TODO predelat timeout do konstanty v nastaveni + +// Logout user, if idle for more then LOGOUT_IDLE_SEC seconds + +if (( !isset($_SESSION['last_request'] ) || + ( $_SESSION['last_request'] >= (time() - LOGOUT_IDLE_SEC))) { $_SESSION['last_request'] = time(); } else { require_once(INCLUDE_DIR."eventz/logout.inc"); logout(); } + +?> diff --git a/wwwroot/inc/senate.inc b/wwwroot/inc/senate.inc index f99800d..3dd4976 100644 --- a/wwwroot/inc/senate.inc +++ b/wwwroot/inc/senate.inc @@ -2,6 +2,9 @@ define('DAILY_K',30); define('REGISTRATION_VOTES',2); //too small so far +// logout after one hour +define('LOGOUT_IDLE_SEC', 3600); + // An attempt to remove hard-code constants from code define('REGISTRATION_TEXT_NODE',791946); define('REGISTRATION_REQUEST_NODE',2091448);