From 263edf58f2751fbd042d71a1e786f6b203e3f71a Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 28 Dec 2012 22:53:05 +0100 Subject: stats for infobeamer/monitor --- includes/pages/guest_stats.php | 30 ++++++++++++++++++++++++++++++ install/default-conf/config.php | 4 ++++ public/index.php | 6 +++++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 includes/pages/guest_stats.php diff --git a/includes/pages/guest_stats.php b/includes/pages/guest_stats.php new file mode 100644 index 00000000..8d96bbbf --- /dev/null +++ b/includes/pages/guest_stats.php @@ -0,0 +1,30 @@ + "Wrong api_key."))); + } else die(json_encode(array('error' => "Missing parameter api_key."))); + +} + + +?> \ No newline at end of file diff --git a/install/default-conf/config.php b/install/default-conf/config.php index 543d1dce..35222c41 100644 --- a/install/default-conf/config.php +++ b/install/default-conf/config.php @@ -68,4 +68,8 @@ $shift_sum_formula = "SUM( // weigh every shift the same //$shift_sum_formula = "SUM(`end` - `start`)"; + +// For accessing stats +$api_key = ""; + ?> diff --git a/public/index.php b/public/index.php index a7efbd86..85771dec 100644 --- a/public/index.php +++ b/public/index.php @@ -33,7 +33,7 @@ if (isset ($_REQUEST['auth'])) // Gewünschte Seite/Funktion $p = isset ($user) ? "news" : "login"; -if (isset ($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && sql_num_query("SELECT * FROM `Privileges` WHERE `name`='" . sql_escape($_REQUEST['p']) . "' LIMIT 1") > 0) +if (isset ($_REQUEST['p']) && preg_match("/^[a-z0-9_]*$/i", $_REQUEST['p']) && ($_REQUEST['p'] == 'stats' || (sql_num_query("SELECT * FROM `Privileges` WHERE `name`='" . sql_escape($_REQUEST['p']) . "' LIMIT 1") > 0))) $p = $_REQUEST['p']; $title = Get_Text($p); @@ -47,6 +47,10 @@ elseif ($p == "atom") { require_once ('includes/pages/user_atom.php'); user_atom(); } +elseif ($p == "stats") { + require_once ('includes/pages/guest_stats.php'); + guest_stats(); +} // Recht dafür vorhanden? elseif (in_array($p, $privileges)) { if ($p == "news") { -- cgit v1.2.3-54-g00ecf