From b5fd09f393b08f09a72f2851dc7b24e683fc9cfc Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 19 Jan 2017 13:09:33 +0100 Subject: [statistics_reporting] Check if user is logged in in doAjax() --- modules-available/statistics_reporting/page.inc.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'modules-available') diff --git a/modules-available/statistics_reporting/page.inc.php b/modules-available/statistics_reporting/page.inc.php index 1428848a..27d478dc 100644 --- a/modules-available/statistics_reporting/page.inc.php +++ b/modules-available/statistics_reporting/page.inc.php @@ -46,11 +46,15 @@ class Page_Statistics_Reporting extends Page protected function doAjax() { - $this->action = Request::any('action', false, 'string'); - if ($this->action === 'setReporting') { - Property::set("reportingStatus", Request::get('reporting', "on", 'string')); - } elseif ($this->action === 'getReporting') { - echo Property::get("reportingStatus", "on"); + if (!User::isLoggedIn()) { + echo "No."; + } else { + $this->action = Request::any('action', false, 'string'); + if ($this->action === 'setReporting') { + Property::set("reportingStatus", Request::get('reporting', "on", 'string')); + } elseif ($this->action === 'getReporting') { + echo Property::get("reportingStatus", "on"); + } } } } -- cgit v1.2.3-55-g7522