mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
- Fixed the detection of relative path in the config file to make it compatible with *nix
SVN:trunk[963]
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 '<root>/'
|
||||
$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 '<root>/'
|
||||
$sFile = APPROOT.'/'.substr($sToInclude, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sFile = APPROOT.'/'.$sToInclude;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -531,7 +531,7 @@ function CreateAdminAccount(SetupWebPage $oP, Config $oConfig, $sAdminUser, $sAd
|
||||
|
||||
function ListModuleFiles($sRelDir, SetupWebPage $oP)
|
||||
{
|
||||
$sDirectory = APPROOT.$sRelDir;
|
||||
$sDirectory = APPROOT.'/'.$sRelDir;
|
||||
//echo "<p>$sDirectory</p>\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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user