<?php

session_start();

require_once dirname(__FILE__) . "/se-lib/Lib.php";
Lib::loadClass('V');
Lib::loadClass('S');
Lib::loadClass('User');

if (!User::logged()) {
	die('401: Unauthorized');
}

S::init();

if ('getTimer' == V::get('task', '', $_REQUEST)) {
	// just return time diff from last activity
	$tm = S::timeoutGet();
	echo $tm;
	exit;
} else {
	S::timeoutUpdate(true);// User is authorized - update logout time
}

?>
