]> _ Git - cubeextranet.git/commitdiff
wip #5137 @1.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 8 Mar 2022 17:15:20 +0000 (17:15 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 8 Mar 2022 17:15:20 +0000 (17:15 +0000)
inc/ws/Controlleur/class.ws.flash.php
inc/ws/Controlleur/class.ws.users.tree.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/DAO/class.ws.dao.book3.php
index.php

index 0bc58c2c108c2eedd710413391c5a05faa6e2f5e..01c6ee41acbc077525b5220073598a8a3583c50b 100644 (file)
@@ -779,7 +779,7 @@ class wsFlash extends cubeFlashGateway
         $this->xml->addChild('title', htmlspecialchars($book->nom));
         $this->xml->addChild('date', $book->changedate);
         $this->xml->addChild('lang', $book->lang);
-        $this->xml->addChild('settings', json_encode($book->parametres->toArray()));
+        $this->xml->addChild('settings', htmlspecialchars(json_encode($book->parametres->toArray())));
     }
 
     public function getBookInfos()
index c175a7048eb5659fae020b266c5762496cfb4c05..47816de8760a3c3aed39b6a7187d6529d232ce40 100644 (file)
@@ -19,9 +19,6 @@ class wsUsersTree
 \r
     public function refreshWSUsersTree()\r
     {\r
-        $this->con->execute('TRUNCATE TABLE ws_users_tree');\r
-        $this->con->execute('TRUNCATE TABLE ws_entreprises_tree');\r
-\r
         $this->users = array();\r
         $this->admins = array();\r
         $this->grades = array();\r
@@ -57,6 +54,10 @@ class wsUsersTree
         }\r
 \r
         $this->facturables = $this->getFacturables();\r
+\r
+\r
+        $this->con->execute('TRUNCATE TABLE ws_users_tree');\r
+        $this->con->execute('TRUNCATE TABLE ws_entreprises_tree');\r
         // Fabrication de l'arbre\r
         $c = $this->con->openCursor('ws_users_tree');\r
         $ce = $this->con->openCursor('ws_entreprises_tree');\r
@@ -79,7 +80,7 @@ class wsUsersTree
             try {\r
                 $c->insert();\r
             } catch (Exception $e) {\r
-                fb($e);\r
+\r
             }\r
             if (isset($evu[$c->entreprise_id])) {\r
                 continue;\r
@@ -87,7 +88,6 @@ class wsUsersTree
             try {\r
                 $ce->insert();\r
             } catch (Exception $e) {\r
-                fb($e);\r
             }\r
             $evu[$c->entreprise_id] = true;\r
         }\r
index b3d4fba22fcfcb9937581b6d0f37b3f4b37eaff8..df444ed9ad4701246a7163f023b7135ab4471587 100644 (file)
@@ -24,80 +24,54 @@ class wsDAOBook extends commonDAO
 
     protected function singleton($r)
     {
-        if (isset($r->id)) {
-            $book = new wsBook();
-            $book->book_id = $r->id;
-            $book->cid = $r->cid;
-            $book->nom = $r->name;
-            $book->lang = $r->locale;
-            $book->theme = $r->theme;
-            $book->proprietaire = $r->proprietaire_nom;
-            $book->proprietaire_id = $r->owner;
-            $book->proprietaire_utilisateur = $r->proprietaire_utilisateur;
-            $book->hash = $r->hash;
-            $book->compteur_visites = $r->visits_counter;
-            $book->status = $r->status;
-            $book->date_status = self::_toTimestamp($r->status_date);
-            $book->date = self::_toTimestamp($r->created_at);
-            $book->pages = array();
-            $book->chapters = $r->chapters;
-            $book->traductions = $r->translations;
-//            $book->specialLinks = $r->specialLinks;
-//            $book->specialRulers = $r->specialRulers;
-            $book->parametres = new wsBookParametres($this);
-            $book->parametres->importFromJson($r->settings);
-            //$book->extras = $r->extras;
-            $book->numerotation = $r->page_numbers;
-            $book->changedate = self::_toTimestamp($r->updated_at);
-            $book->compilehtml5date = $book->compile1date = $book->compiledate = self::_toTimestamp($r->compilation_date);
-            $book->facturable = $r->facturable;
-            $book->facturable_id = $r->facturable_id;
-            $book->tache = $r->extranet_task;
-            if (isset($r->projet)) {
-                $book->projet = $r->projet;
-            }
-            $book->version = 2;
-            $book->composition_update = self::_toTimestamp($r->composition_updated_at);
-//            $book->demo_counter = $r->demo_counter;
-           $book->exportdatas = $r->exportdatas;
-        } else {
-            $book = new wsBook();
-            $book->book_id = $r->book_id;
-            $book->cid = $r->cid;
-            $book->nom = $r->nom;
-            $book->lang = $r->lang;
-            $book->theme = $r->theme;
+
+        $book = new wsBook();
+        $book->book_id = $r->book_id;
+        $book->cid = $r->cid;
+        $book->nom = $r->nom;
+        $book->lang = $r->lang;
+        $book->theme = $r->theme;
+        if (isset($r->proprietaire_nom)) {
             $book->proprietaire = $r->proprietaire_nom;
+        }
+        if (isset($r->proprietaire_id)) {
             $book->proprietaire_id = $r->proprietaire_id;
+        }
+        if (isset($r->proprietaire_utilisateur)) {
             $book->proprietaire_utilisateur = $r->proprietaire_utilisateur;
-            $book->hash = $r->hash;
-            $book->compteur_visites = $r->compteur_visites;
-            $book->status = $r->status;
-            $book->date_status = $r->date_status;
-            $book->date = $r->date;
-            $book->pages = array();
-            $book->chapters = $r->chapters;
-            $book->traductions = $r->traductions;
-            $book->specialLinks = $r->specialLinks;
-            $book->specialRulers = $r->specialRulers;
-            $book->parametres = $r->parametres;
-            $book->extras = $r->extras;
-            $book->numerotation = $r->numerotation;
-            $book->changedate = $r->changedate;
-            $book->compiledate = $r->compiledate;
-            $book->compile1date = $r->compile1date;
-            $book->compilehtml5date = $r->compilehtml5date;
+        }
+        $book->hash = $r->hash;
+        $book->compteur_visites = $r->compteur_visites;
+        $book->status = $r->status;
+        $book->date_status = $r->date_status;
+        $book->date = $r->date;
+        $book->pages = array();
+        $book->chapters = $r->chapters;
+        $book->traductions = $r->traductions;
+        $book->specialLinks = $r->specialLinks;
+        $book->specialRulers = $r->specialRulers;
+        $book->parametres = $r->parametres;
+        $book->extras = $r->extras;
+        $book->numerotation = $r->numerotation;
+        $book->changedate = $r->changedate;
+        $book->compiledate = $r->compiledate;
+        $book->compile1date = $r->compile1date;
+        $book->compilehtml5date = $r->compilehtml5date;
+        if (isset($r->facturable)) {
             $book->facturable = $r->facturable;
+        }
+        if (isset($r->facturable_id)) {
             $book->facturable_id = $r->facturable_id;
-            $book->tache = $r->tache;
-            if (isset($r->projet)) {
-                $book->projet = $r->projet;
-            }
-            $book->version = $r->version;
-            $book->composition_update = $r->composition_update;
-            $book->demo_counter = $r->demo_counter;
-            $book->exportdatas = $r->exportdatas;
         }
+        $book->tache = $r->tache;
+        if (isset($r->projet)) {
+            $book->projet = $r->projet;
+        }
+        $book->version = $r->version;
+        $book->composition_update = $r->composition_update;
+        $book->demo_counter = $r->demo_counter;
+        $book->exportdatas = $r->exportdatas;
+
 
         return $book;
     }
@@ -1132,7 +1106,6 @@ class wsDAOBook extends commonDAO
     }
 
 
-
     public function compileTemp($book_id, $version, $dir)
     {
         if ($version == 'ha' || $version == 'hi') {
index 334166fc3245e872c3f95bfd39835ed0fd583a0e..8eb5776409061f273a051e69856ae8817d2415b0 100644 (file)
@@ -42,11 +42,8 @@ class wsDAOBook3 extends wsDAOBook
         $book->pages = array();
         $book->chapters = $r->chapters;
         $book->traductions = $r->translations;
-//            $book->specialLinks = $r->specialLinks;
-//            $book->specialRulers = $r->specialRulers;
         $book->parametres = new wsBookParametres($this);
         $book->parametres->importFromJson($r->settings);
-        //$book->extras = $r->extras;
         $book->numerotation = $r->page_numbers;
         $book->changedate = self::_toTimestamp($r->updated_at);
         $book->compilehtml5date = $book->compile1date = $book->compiledate = self::_toTimestamp($r->compilation_date);
index 66b0f77c344192c520cf0308ec650d624a8898ad..9bdd43b77301d20b2dcbaad763436f164361150b 100644 (file)
--- a/index.php
+++ b/index.php
@@ -4,7 +4,14 @@ set_exception_handler('exception_handle');
 
 function exception_handle($e)
 {
-       error_log(get_class($e) . ' : ' . $e->getMessage() . ' : ' . $e->getFile() . ' at line ' . $e->getLine());
+    error_log(get_class($e) . ' : ' . $e->getMessage() . ' : ' . $e->getFile() . ' at line ' . $e->getLine());
+}
+
+function before_session_start()
+{
+    if (stristr($_SERVER['PATH_INFO'], 'relay')) {
+        ini_set('redis.session.locking_enabled', 0);
+    }
 }
 
 require_once(dirname(__FILE__) . '/vendor/autoload.php');