]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 19 Nov 2012 12:38:33 +0000 (12:38 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 19 Nov 2012 12:38:33 +0000 (12:38 +0000)
inc/commons/class.common.url.php
inc/ws/Controlleur/class.ws.stats.php
inc/ws/Controlleur/class.ws.url.php

index 05e972468013c6d740b044fea9c66072cc3e65d3..d3d13e8ce57325d6eb0301cee5415ed716bdd37e 100644 (file)
@@ -7,7 +7,7 @@ class commonUrl {
                $args = cubePage::getArgs($args);\r
                // Si l'utilisateur n'est pas connecté, on affiche le formulaire\r
                // de login\r
-               if (is_null($core->user) || !$core->user) {\r
+               if ($args[0]!='stats' && (is_null($core->user) || !$core->user)) {\r
                        $args = array('login');\r
                } else {\r
                        if (isset($args[0]) && $args[0] == 'login') {\r
index 94dc50697b9dcbb4c5f736d716d83aff8ada67b7..e2c86a52b35d7780ece00966c0d43b25ea1c9cd3 100644 (file)
@@ -62,8 +62,6 @@ class wsStats {
                        }\r
                }\r
 \r
-\r
-\r
                $actions = array();\r
                $actions[] = '<a href="' . $exporturl . '">' . $core->typo->Ajouter('Exporter au format Excel') . '</a>';\r
 \r
@@ -127,6 +125,9 @@ class wsStats {
        }\r
 \r
        public static function load_stats($bid, $annee = null, $mois = null) {\r
+               $e = explode('_', $bid, 2);\r
+               $bid = $e[0];\r
+\r
                $root = WS_STATS . 'xml/' . $bid;\r
                if (is_null($annee)) {\r
                        $xml = $root;\r
index 89924e9ef77a41fa43f24eb8cc3b13a13df122f4..4a2ac00dd78ffdcad0427172024aad4f5141a453 100644 (file)
@@ -139,7 +139,7 @@ class wsUrl {
                        } else {\r
                                $res.='<td></td><td></td>';\r
                        }\r
-                       $res .= '<td class="bouton"><a href="' . SITE_PATH . 'stats/' . $book->book_id . '" class="normallink">' . $btStats . '</a></td>';\r
+                       $res .= '<td class="bouton"><a href="' . SITE_PATH . 'stats/' . $book->book_id . '_' . $book->hash . '" class="normallink">' . $btStats . '</a></td>';\r
                        if ($book->version > 1) {\r
                                $res .= '<td class="bouton"><a href="#" class="openContextMenu" rel="' . $context_download_id . '" rev="' . $book->book_id . '">' . $btDownload . '</a></td>';\r
                        } else {\r
@@ -599,10 +599,19 @@ html{height:100%}' . "\n";
        }\r
 \r
        public static function stats($args) {\r
+               global $core;\r
                $bid = (isset($args[1])) ? $args[1] : null;\r
+\r
+               list($bid, $hash) = explode('_', $bid);\r
+\r
+               $r = $core->con->select('SELECT * FROM books WHERE book_id=\'' . $core->con->escape($bid) . '\' AND hash=\'' . $core->con->escape($hash) . '\'');\r
+               if (!$r->count()) {\r
+                       return;\r
+               }\r
+\r
                $annee = (isset($args[2])) ? $args[2] : null;\r
                $mois = (isset($args[3])) ? $args[3] : null;\r
-               return wsStats::display($bid, $annee, $mois);\r
+               return wsStats::display($bid . '_' . $hash, $annee, $mois);\r
        }\r
 \r
        public static function viewerp($args) {\r
@@ -716,7 +725,7 @@ html{height:100%}' . "\n";
        public static function viewerha($args) {\r
                global $core;\r
 \r
-               \r
+\r
                $args = cubePage::getArgs($args);\r
                if (!isset($args[1])) {\r
                        $args[1] = '';\r