//StatisticsController : Refacto done

This commit is contained in:
mDeflotte committed 2011-09-28 13:49:32 +00:00
1 parent c740281b9a
commit 95a3f622c7
1 file changed
+6 -2
+6 -2
View File
@@ -27,12 +27,16 @@
class StatisticsControllerCore extends FrontController class StatisticsControllerCore extends FrontController
{ {
/**
* Assign template vars related to page content
* @see FrontController::process()
*/
public function process() public function process()
{ {
$this->displayHeader(false); $this->displayHeader(false);
$this->displayFooter(false); $this->displayFooter(false);
if (!isset($_POST['token']) OR !isset($_POST['type'])) if (!isset($_POST['token']) || !isset($_POST['type']))
die; die;
if ($_POST['type'] == 'navinfo') if ($_POST['type'] == 'navinfo')
@@ -57,7 +61,7 @@ class StatisticsControllerCore extends FrontController
{ {
if (sha1($_POST['id_connections'].$_POST['id_page'].$_POST['time_start']._COOKIE_KEY_) != $_POST['token']) if (sha1($_POST['id_connections'].$_POST['id_page'].$_POST['time_start']._COOKIE_KEY_) != $_POST['token'])
die; die;
if (!Validate::isInt($_POST['time']) OR $_POST['time'] <= 0) if (!Validate::isInt($_POST['time']) || $_POST['time'] <= 0)
die; die;
Connection::setPageTime((int)$_POST['id_connections'], (int)$_POST['id_page'], substr($_POST['time_start'], 0, 19), intval($_POST['time'])); Connection::setPageTime((int)$_POST['id_connections'], (int)$_POST['id_page'], substr($_POST['time_start'], 0, 19), intval($_POST['time']));
} }