diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 0fee7486d..4a113be59 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -267,36 +267,36 @@ class Config $this->m_sFile = $sConfigFile; $this->m_aAppModules = array( // Some default modules, always present can be move to an official iTop Module later if needed - '/application/transaction.class.inc.php', - '/application/menunode.class.inc.php', - '/application/user.preferences.class.inc.php', - '/application/audit.rule.class.inc.php', + 'application/transaction.class.inc.php', + 'application/menunode.class.inc.php', + 'application/user.preferences.class.inc.php', + 'application/audit.rule.class.inc.php', // Romain - That's dirty, because those 3 classes are in fact part of the core // but I needed those classes to be derived from cmdbAbstractObject // (to be managed via the GUI) and this class in not really known from // the core, PLUS I needed the includes to be there also for the setup // to create the tables. - '/core/event.class.inc.php', - '/core/action.class.inc.php', - '/core/trigger.class.inc.php', + 'core/event.class.inc.php', + 'core/action.class.inc.php', + 'core/trigger.class.inc.php', ); $this->m_aDataModels = array(); $this->m_aAddons = array( // Default AddOn, always present can be moved to an official iTop Module later if needed - 'user rights' => '/addons/userrights/userrightsprofile.class.inc.php', + 'user rights' => 'addons/userrights/userrightsprofile.class.inc.php', ); $this->m_aDictionaries = array( // Default dictionaries, always present can be moved to an official iTop Module later if needed - '/dictionaries/dictionary.itop.core.php', - '/dictionaries/dictionary.itop.ui.php', // Support for English - '/dictionaries/fr.dictionary.itop.ui.php', // Support for French - '/dictionaries/fr.dictionary.itop.core.php', // Support for French - '/dictionaries/es_cr.dictionary.itop.ui.php', // Support for Spanish (from Costa Rica) - '/dictionaries/es_cr.dictionary.itop.core.php', // Support for Spanish (from Costa Rica) - '/dictionaries/de.dictionary.itop.ui.php', // Support for German - '/dictionaries/de.dictionary.itop.core.php', // Support for German - '/dictionaries/pt_br.dictionary.itop.ui.php', // Support for Brazilian Portuguese - '/dictionaries/pt_br.dictionary.itop.core.php', // Support for Brazilian Portuguese + 'dictionaries/dictionary.itop.core.php', + 'dictionaries/dictionary.itop.ui.php', // Support for English + 'dictionaries/fr.dictionary.itop.ui.php', // Support for French + 'dictionaries/fr.dictionary.itop.core.php', // Support for French + 'dictionaries/es_cr.dictionary.itop.ui.php', // Support for Spanish (from Costa Rica) + 'dictionaries/es_cr.dictionary.itop.core.php', // Support for Spanish (from Costa Rica) + 'dictionaries/de.dictionary.itop.ui.php', // Support for German + 'dictionaries/de.dictionary.itop.core.php', // Support for German + 'dictionaries/pt_br.dictionary.itop.ui.php', // Support for Brazilian Portuguese + 'dictionaries/pt_br.dictionary.itop.core.php', // Support for Brazilian Portuguese ); foreach($this->m_aSettings as $sPropCode => $aSettingInfo) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index f9cf7d91f..c266b0d64 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -3348,16 +3348,21 @@ abstract class MetaModel protected static function Plugin($sConfigFile, $sModuleType, $sToInclude) { - if (substr($sToInclude, 0, 3) == '../') + $sFirstChar = substr($sToInclude, 0, 1); + $sSecondChar = substr($sToInclude, 1, 1); + if (($sFirstChar != '/') && ($sFirstChar != '\\') && ($sSecondChar != ':')) { - // Preserve compatibility with config files written before 1.0.1 - // Replace '../' by '/' - $sFile = APPROOT.'/'.substr($sToInclude, 3); - } - elseif (substr($sToInclude, 0, 1) == '/') - { - // Preferred... - $sFile = APPROOT.$sToInclude; + // It is a relative path, prepend APPROOT + if (substr($sToInclude, 0, 3) == '../') + { + // Preserve compatibility with config files written before 1.0.1 + // Replace '../' by '/' + $sFile = APPROOT.'/'.substr($sToInclude, 3); + } + else + { + $sFile = APPROOT.'/'.$sToInclude; + } } else { diff --git a/setup/index.php b/setup/index.php index e9b92aac8..226238472 100644 --- a/setup/index.php +++ b/setup/index.php @@ -531,7 +531,7 @@ function CreateAdminAccount(SetupWebPage $oP, Config $oConfig, $sAdminUser, $sAd function ListModuleFiles($sRelDir, SetupWebPage $oP) { - $sDirectory = APPROOT.$sRelDir; + $sDirectory = APPROOT.'/'.$sRelDir; //echo "

$sDirectory

\n"; if ($hDir = opendir($sDirectory)) { @@ -654,7 +654,7 @@ function AddParamsToForm(SetupWebpage $oP, $aParamValues, $aExcludeParams = arra function GetAvailableModules(SetupWebpage $oP) { clearstatcache(); - ListModuleFiles('/modules', $oP); + ListModuleFiles('modules', $oP); return $oP->GetModules(); }