$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
}\r
}\r
\r
-\r
-\r
$actions = array();\r
$actions[] = '<a href="' . $exporturl . '">' . $core->typo->Ajouter('Exporter au format Excel') . '</a>';\r
\r
}\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
} 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
}\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
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