From: Harvie Date: Tue, 5 Apr 2011 20:49:15 +0000 (+0200) Subject: Automatic idle logout without cron X-Git-Url: https://git.harvie.cz/?p=mirrors%2FKyberia-bloodline.git;a=commitdiff_plain;h=f046f788e8ba60e21b575c89d72cbf91c5210e23 Automatic idle logout without cron --- diff --git a/wwwroot/inc/logout_idle.inc b/wwwroot/inc/logout_idle.inc new file mode 100644 index 0000000..8b5abb4 --- /dev/null +++ b/wwwroot/inc/logout_idle.inc @@ -0,0 +1,7 @@ += (time() - 60*60)) { //TODO predelat timeout do konstanty v nastaveni + $_SESSION['last_request'] = time(); +} else { + require_once(INCLUDE_DIR."eventz/logout.inc"); + logout(); +} diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index 490ee44..2bf47a3 100644 --- a/wwwroot/nodes.php +++ b/wwwroot/nodes.php @@ -97,9 +97,11 @@ if ($_SESSION['debugging']) { //initializing node if (!is_numeric($_GET['node_id'])) { - $_GET['node_id']=WELCOME_NODE; + $_GET['node_id']=WELCOME_NODE; //Tohle uz je v PHP rewritech!!!! } +require_once(INCLUDE_DIR.'logout_idle.inc'); //Logout when idle + $node = nodes::getNodeById($_GET['node_id'],(isset($_SESSION['user_id']))?$_SESSION['user_id']:''); //XXX Paths are wrong (!)