From d8187c44abbacd52a5b4cd0c282aa8eda7f15f79 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 19 Nov 2012 12:38:33 +0000 Subject: [PATCH] --- inc/commons/class.common.url.php | 2 +- inc/ws/Controlleur/class.ws.stats.php | 5 +++-- inc/ws/Controlleur/class.ws.url.php | 15 ++++++++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/inc/commons/class.common.url.php b/inc/commons/class.common.url.php index 05e972468..d3d13e8ce 100644 --- a/inc/commons/class.common.url.php +++ b/inc/commons/class.common.url.php @@ -7,7 +7,7 @@ class commonUrl { $args = cubePage::getArgs($args); // Si l'utilisateur n'est pas connecté, on affiche le formulaire // de login - if (is_null($core->user) || !$core->user) { + if ($args[0]!='stats' && (is_null($core->user) || !$core->user)) { $args = array('login'); } else { if (isset($args[0]) && $args[0] == 'login') { diff --git a/inc/ws/Controlleur/class.ws.stats.php b/inc/ws/Controlleur/class.ws.stats.php index 94dc50697..e2c86a52b 100644 --- a/inc/ws/Controlleur/class.ws.stats.php +++ b/inc/ws/Controlleur/class.ws.stats.php @@ -62,8 +62,6 @@ class wsStats { } } - - $actions = array(); $actions[] = '' . $core->typo->Ajouter('Exporter au format Excel') . ''; @@ -127,6 +125,9 @@ class wsStats { } public static function load_stats($bid, $annee = null, $mois = null) { + $e = explode('_', $bid, 2); + $bid = $e[0]; + $root = WS_STATS . 'xml/' . $bid; if (is_null($annee)) { $xml = $root; diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 89924e9ef..4a2ac00dd 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -139,7 +139,7 @@ class wsUrl { } else { $res.=''; } - $res .= '' . $btStats . ''; + $res .= '' . $btStats . ''; if ($book->version > 1) { $res .= '' . $btDownload . ''; } else { @@ -599,10 +599,19 @@ html{height:100%}' . "\n"; } public static function stats($args) { + global $core; $bid = (isset($args[1])) ? $args[1] : null; + + list($bid, $hash) = explode('_', $bid); + + $r = $core->con->select('SELECT * FROM books WHERE book_id=\'' . $core->con->escape($bid) . '\' AND hash=\'' . $core->con->escape($hash) . '\''); + if (!$r->count()) { + return; + } + $annee = (isset($args[2])) ? $args[2] : null; $mois = (isset($args[3])) ? $args[3] : null; - return wsStats::display($bid, $annee, $mois); + return wsStats::display($bid . '_' . $hash, $annee, $mois); } public static function viewerp($args) { @@ -716,7 +725,7 @@ html{height:100%}' . "\n"; public static function viewerha($args) { global $core; - + $args = cubePage::getArgs($args); if (!isset($args[1])) { $args[1] = ''; -- 2.39.5