From 4a9c0fe31688f9e24673244ec7f4445479410c48 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 21 Sep 2004 07:54:44 +0000 Subject: [PATCH] Cree le dossier log lors de l'initialisation --- .../includes/modules/modTelephonie.class.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/htdocs/includes/modules/modTelephonie.class.php b/htdocs/includes/modules/modTelephonie.class.php index f476783a54e..92464933d23 100644 --- a/htdocs/includes/modules/modTelephonie.class.php +++ b/htdocs/includes/modules/modTelephonie.class.php @@ -79,7 +79,64 @@ class modTelephonie extends DolibarrModules "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (141,'Consulter la telephonie','telephonie','r',0);", "INSERT INTO ".MAIN_DB_PREFIX."rights_def VALUES (142,'Configurer la telephonie','telephonie','w',0);"); + /* + * Documents + * + */ + if (defined("DOL_DATA_ROOT")) + { + $dir = DOL_DATA_ROOT . "/telephonie/" ; + + if (! file_exists($dir)) + { + umask(0); + if (! mkdir($dir, 0755)) + { + $this->error="Erreur: Le répertoire '$dir' n'existe pas et Dolibarr n'a pu le créer."; + } + } + + + $dir = DOL_DATA_ROOT . "/telephonie/ligne/" ; + + if (! file_exists($dir)) + { + umask(0); + if (! mkdir($dir, 0755)) + { + $this->error="Erreur: Le répertoire '$dir' n'existe pas et Dolibarr n'a pu le créer."; + } + } + + $dir = DOL_DATA_ROOT . "/telephonie/ligne/commande" ; + + if (! file_exists($dir)) + { + umask(0); + if (! mkdir($dir, 0755)) + { + $this->error="Erreur: Le répertoire '$dir' n'existe pas et Dolibarr n'a pu le créer."; + } + } + + $dir = DOL_DATA_ROOT . "/telephonie/logs" ; + + if (! file_exists($dir)) + { + umask(0); + if (! mkdir($dir, 0755)) + { + $this->error="Erreur: Le répertoire '$dir' n'existe pas et Dolibarr n'a pu le créer."; + } + } + + } + + return $this->_init($sql); + + + } /** suppression du module *