From: vincent@cubedesigners.com Date: Tue, 8 Mar 2022 17:15:20 +0000 (+0000) Subject: wip #5137 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b3a60987fc0e09dabb614e050ce5c5fc1adf748a;p=cubeextranet.git wip #5137 @1.5 --- diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 0bc58c2c1..01c6ee41a 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -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() diff --git a/inc/ws/Controlleur/class.ws.users.tree.php b/inc/ws/Controlleur/class.ws.users.tree.php index c175a7048..47816de87 100644 --- a/inc/ws/Controlleur/class.ws.users.tree.php +++ b/inc/ws/Controlleur/class.ws.users.tree.php @@ -19,9 +19,6 @@ class wsUsersTree public function refreshWSUsersTree() { - $this->con->execute('TRUNCATE TABLE ws_users_tree'); - $this->con->execute('TRUNCATE TABLE ws_entreprises_tree'); - $this->users = array(); $this->admins = array(); $this->grades = array(); @@ -57,6 +54,10 @@ class wsUsersTree } $this->facturables = $this->getFacturables(); + + + $this->con->execute('TRUNCATE TABLE ws_users_tree'); + $this->con->execute('TRUNCATE TABLE ws_entreprises_tree'); // Fabrication de l'arbre $c = $this->con->openCursor('ws_users_tree'); $ce = $this->con->openCursor('ws_entreprises_tree'); @@ -79,7 +80,7 @@ class wsUsersTree try { $c->insert(); } catch (Exception $e) { - fb($e); + } if (isset($evu[$c->entreprise_id])) { continue; @@ -87,7 +88,6 @@ class wsUsersTree try { $ce->insert(); } catch (Exception $e) { - fb($e); } $evu[$c->entreprise_id] = true; } diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index b3d4fba22..df444ed9a 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -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') { diff --git a/inc/ws/DAO/class.ws.dao.book3.php b/inc/ws/DAO/class.ws.dao.book3.php index 334166fc3..8eb577640 100644 --- a/inc/ws/DAO/class.ws.dao.book3.php +++ b/inc/ws/DAO/class.ws.dao.book3.php @@ -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); diff --git a/index.php b/index.php index 66b0f77c3..9bdd43b77 100644 --- 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');