diff --git a/htdocs/includes/modules/modTelephonie.class.php b/htdocs/includes/modules/modTelephonie.class.php index 92464933d23..7ee5c9d5da7 100644 --- a/htdocs/includes/modules/modTelephonie.class.php +++ b/htdocs/includes/modules/modTelephonie.class.php @@ -97,39 +97,30 @@ class modTelephonie extends DolibarrModules } - $dir = DOL_DATA_ROOT . "/telephonie/ligne/" ; - - if (! file_exists($dir)) + $dir[0] = DOL_DATA_ROOT . "/telephonie/ligne/" ; + $dir[1] = DOL_DATA_ROOT . "/telephonie/ligne/commande" ; + $dir[2] = DOL_DATA_ROOT . "/telephonie/logs" ; + + + for ($i = 0 ; $i < sizeof($dir) ; $i++) { - umask(0); - if (! mkdir($dir, 0755)) + if (is_dir($dir[$i])) { - $this->error="Erreur: Le répertoire '$dir' n'existe pas et Dolibarr n'a pu le créer."; + dolibarr_syslog ("Le dossier '".$dir[$i]."' existe"); + } + else + { + if (! @mkdir($dir[$i], 0755)) + { + print "