]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 10 Jan 2011 13:17:47 +0000 (13:17 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 10 Jan 2011 13:17:47 +0000 (13:17 +0000)
inc/ws/Controlleur/class.ws.services.php
inc/ws/DAO/class.ws.dao.book.php

index e4922e04adf5ec139a11e783f77674bad0f5af62..c6bc68b08f114be7382c2776c0eaf502d33059bd 100644 (file)
@@ -14,8 +14,11 @@ class wsServices extends cubeFlashGateway {
                // Check protection hash\r
                $hash = md5(substr($this->args['fromemail'], 2, 6) . substr($this->args['email'], 3, 5) . 'SFGHF566!S' . $this->args['id']);\r
                if ($hash != $this->args['hash']) {\r
+                       $this->xml->addChild('hashOK', '0');\r
                        $this->xml->addChild('ok', '0');\r
                        return;\r
+               } else {\r
+                       $this->xml->addChild('hashOK', '1');\r
                }\r
                // Send the email\r
                $mail = new cubeMail();\r
index f5492fc897b904692031f622e89c037395be34b2..4f90354e48637f2fd426207889e0b86ac83c8cd1 100644 (file)
@@ -508,6 +508,12 @@ class wsDAOBook extends extranetDAO {
                $index = '';\r
                $textes = '';\r
 \r
+               $hash = $book_id;\r
+               $hash .= 'kjgl!az4.';\r
+               $hash .= count($pages);\r
+               $hash .= round($size[0]);\r
+               $hash = sha1($hash);\r
+\r
                $this->makeTextsIndexes($book_id, $index, $textes);\r
                $daoDoc->getLinksAndRulers($book_id, $links, $rulers);\r
 \r
@@ -576,6 +582,7 @@ class wsDAOBook extends extranetDAO {
                $flex->addFont(FONT_PATH . '/' . $lang->font, 'GeneralFont', $lang->charset);\r
                $flex->addFont(FONT_PATH . '/FluidbookCredits.ttf', 'CreditsFont', 'ASCII');\r
                $flexLight->addFont(FONT_PATH . '/FluidbookLoader.ttf', 'LoaderFont', 'Numerals');\r
+               $flexLight->addVariable('checksum', $hash, false, true, 'String');\r
                $res .= $flex->compile() . "\n\n-------------------\n\n";\r
                $flexLight->addVariable('datasSize', filesize($compilerDir . '/FluidbookDatas.swf'));\r
                $res .= $flexLight->compile();\r