Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Fix xml dir casesensitive (#2465)
Browse files Browse the repository at this point in the history
* Remove old script

* Create a constant for xml file path and remove tmpmodels and walk directories
  • Loading branch information
Walid Nouh committed Feb 2, 2018
1 parent 2880dd3 commit 69cfeb1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion inc/inventorycomputercomputer.class.php
Expand Up @@ -322,7 +322,7 @@ static function showDownloadInventoryFile($computers_id) {
$folder = '0';
}

if (file_exists(GLPI_PLUGIN_DOC_DIR."/fusioninventory/xml/computer/".$folder."/".$computers_id)) {
if (file_exists(PLUGIN_FUSIONINVENTORY_XML_DIR."computer/".$folder."/".$computers_id)) {
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_1'>";
echo "<th>";
Expand Down
2 changes: 1 addition & 1 deletion inc/networkequipment.class.php
Expand Up @@ -1227,7 +1227,7 @@ function displaySerializedInventory($items_id) {
if (empty($folder)) {
$folder = '0';
}
if (file_exists(GLPI_PLUGIN_DOC_DIR."/fusioninventory/xml/NetworkEquipment/".$folder."/".$items_id)) {
if (file_exists(PLUGIN_FUSIONINVENTORY_XML_DIR."networkequipment/".$folder."/".$items_id)) {
echo "/ <a href='".$CFG_GLPI['root_doc'].
"/plugins/fusioninventory/front/send_inventory.php".
"?itemtype=networkequipment".
Expand Down
8 changes: 1 addition & 7 deletions install/install.php
Expand Up @@ -188,12 +188,7 @@ function pluginFusioninventoryInstall($version, $migrationname = 'Migration') {
if (!is_dir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/upload')) {
mkdir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/upload');
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/walks')) {
mkdir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/walks');
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/tmpmodels')) {
mkdir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/tmpmodels');
}

/*
* Deploy folders
*/
Expand Down Expand Up @@ -361,4 +356,3 @@ function pluginFusioninventoryInstall($version, $migrationname = 'Migration') {
$mode_cli = (basename($_SERVER['SCRIPT_NAME']) == "cli_install.php");

}

18 changes: 6 additions & 12 deletions install/update.php
Expand Up @@ -277,20 +277,14 @@ function pluginFusioninventoryUpdate($current_version, $migrationname = 'Migrati
if (!is_dir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/xml')) {
mkdir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/xml');
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/xml/computer')) {
mkdir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/xml/computer');
if (!is_dir(PLUGIN_FUSIONINVENTORY_XML_DIR.'computer')) {
mkdir(PLUGIN_FUSIONINVENTORY_XML_DIR.'computer');
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/xml/printer')) {
mkdir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/xml/printer');
if (!is_dir(PLUGIN_FUSIONINVENTORY_XML_DIR.'printer')) {
mkdir(PLUGIN_FUSIONINVENTORY_XML_DIR.'printer');
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/xml/networkequipment')) {
mkdir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/xml/networkequipment');
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/walks')) {
mkdir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/walks');
}
if (!is_dir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/tmpmodels')) {
mkdir(GLPI_PLUGIN_DOC_DIR.'/fusioninventory/tmpmodels');
if (!is_dir(PLUGIN_FUSIONINVENTORY_XML_DIR.'networkequipment')) {
mkdir(PLUGIN_FUSIONINVENTORY_XML_DIR.'networkequipment');
}

// ********* Deploy folders ********************************************** //
Expand Down
2 changes: 2 additions & 0 deletions setup.php
Expand Up @@ -62,6 +62,8 @@
GLPI_PLUGIN_DOC_DIR."/fusioninventory/files/repository/");
define("PLUGIN_FUSIONINVENTORY_MANIFESTS_DIR",
GLPI_PLUGIN_DOC_DIR."/fusioninventory/files/manifests/");
define("PLUGIN_FUSIONINVENTORY_XML_DIR",
GLPI_PLUGIN_DOC_DIR."/fusioninventory/xml/");


/**
Expand Down

0 comments on commit 69cfeb1

Please sign in to comment.