]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 3 Feb 2011 16:49:50 +0000 (16:49 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 3 Feb 2011 16:49:50 +0000 (16:49 +0000)
.htaccess
inc/ws/Controlleur/class.ws.url.php
inc/ws/_common.php

index 690dc17c8685c21fa798a9c40aa80f2f442a308c..7deb29f2a4531f8788ee338566a014108cfa3596 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -30,3 +30,8 @@ RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.html$ viewer/$1_$2_$3
 RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.swf$ fluidbook/compile/index.swf [L]\r
 RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/player.swf$ fluidbook/compile/player.swf [L]\r
 RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/(.+)$ fluidbook/books/final/$1/$4 [L]\r
+\r
+RewriteRule ^vieweru/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.html$ vieweru/$1_$2_$3/index [L]\r
+RewriteRule ^vieweru/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.swf$ fluidbook/compile/_unprotected/index.swf [L]\r
+RewriteRule ^vieweru/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/player.swf$ fluidbook/compile/_unprotected/player.swf [L]\r
+RewriteRule ^vieweru/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/(.+)$ fluidbook/books/final/$1/$4 [L]
\ No newline at end of file
index 5bd8b8ab77b7fb44244a92ec4419171750d6524a..d12eeb57f703033342a6078f0c1e2a0795732273 100644 (file)
@@ -255,18 +255,28 @@ html{height:100%}' . "\n";
                return wsStats::display($bid, $annee, $mois);\r
        }\r
 \r
-       public static function viewer($args)\r
+       public static function vieweru($args)\r
        {\r
-               global $core;\r
-               global $css;\r
-               global $js;\r
-               global $standard;\r
-               global $meta;\r
+               commonDroits::min(5);\r
 \r
-               define('MINIMIZE_JS', false);\r
-               define('MINIMIZE_CSS', false);\r
-               define('JQUERY', false);\r
+               $args = cubePage::getArgs($args);\r
 \r
+               $e = explode('_', $args[0]);\r
+               if (count($e) == 2 || $e[2] < TIME-10) {\r
+                       $e[2] = TIME;\r
+                       http::redirect(SITE_PATH . 'vieweru/' . implode('_', $e) . '/');\r
+                       exit;\r
+               }\r
+\r
+               $book_id = $e[0];\r
+\r
+               self::checkDocumentVersionOfBook($book_id);\r
+\r
+               echo self::commonViewer($book_id,$e[1]);\r
+       }\r
+\r
+       public static function viewer($args)\r
+       {\r
                $args = cubePage::getArgs($args);\r
 \r
                $e = explode('_', $args[0]);\r
@@ -276,14 +286,36 @@ html{height:100%}' . "\n";
                        exit;\r
                }\r
 \r
-               $dao = new wsDAOBook($core->con);\r
                $book_id = $e[0];\r
 \r
                self::checkDocumentVersionOfBook($book_id);\r
                wsSecureSWF::checkProtectedSWF();\r
 \r
+               echo self::commonViewer($book_id,$e[1]);\r
+       }\r
+\r
+       public static function commonViewer($book_id,$hash)\r
+       {\r
+               if (!defined('MINIMIZE_JS')) {\r
+                       define('MINIMIZE_JS', false);\r
+               }\r
+               if (!defined('MINIMIZE_CSS')) {\r
+                       define('MINIMIZE_CSS', false);\r
+               }\r
+               if (!defined('JQUERY')) {\r
+                       define('JQUERY', false);\r
+               }\r
+\r
+               global $core;\r
+               global $css;\r
+               global $js;\r
+               global $standard;\r
+               global $meta;\r
+\r
+               $dao = new wsDAOBook($core->con);\r
+\r
                $book = $dao->selectById($book_id);\r
-               if ($book->hash != $e[1]) {\r
+               if ($book->hash != $hash) {\r
                        commonDroits::error();\r
                }\r
 \r
@@ -332,7 +364,7 @@ html{height:100%}' . "\n";
                $res .= '</body>';\r
                $res .= '</html>';\r
 \r
-               echo $res;\r
+               return $res;\r
        }\r
 \r
        public static function statsxls($args)\r
@@ -381,7 +413,6 @@ html{height:100%}' . "\n";
                exit;\r
        }\r
 \r
-\r
        protected static function checkDocumentVersionOfBook($book_id)\r
        {\r
                global $core;\r
index f87e3052a8bdfd4ecab30e54d98b52eb0155cdc0..391841f952383d36d449fee2eebb514a1be146b9 100644 (file)
@@ -10,6 +10,7 @@ $core->url->register('flash', 'flash', '^flash(.*)$', array('wsFlash', 'in'));
 $core->url->register('services', 'services', '^services(.*)$', array('wsServices', 'in'));\r
 $core->url->register('editor', 'editor', '^editor/(.*)$', array('wsUrl', 'editor'));\r
 $core->url->register('viewer', 'viewer', '^viewer/(.*)$', array('wsUrl', 'viewer'));\r
+$core->url->register('vieweru', 'vieweru', '^vieweru/(.*)$', array('wsUrl', 'vieweru'));\r
 \r
 if (DEV) {\r
        $tools = ROOT . '/../inc/tools/';\r