Index: trunk/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -r1676 -r1834 --- trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 1676) +++ trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 1834) @@ -19,7 +19,7 @@ * * @var Array */ - var $modules=Array(); + var $modules_installed = Array(); /** * Scan kernel and user classes @@ -30,10 +30,32 @@ function Init($prefix,$special) { parent::Init($prefix,$special); + + $db =& $this->Application->GetADODBConnection(); + $this->modules_installed = $db->GetCol('SELECT CONCAT(\'/\',Path) AS Path, Name FROM '.TABLE_PREFIX.'Modules','Name'); $this->scanModules(MODULES_PATH); } /** + * Checks if config file is allowed for includion (if module of config is installed) + * + * @param string $config_path relative path from in-portal directory + */ + function configAllowed($config_path) + { + $module_found = false; + foreach($this->modules_installed as $module_path) + { + if( substr($config_path, 0, strlen($module_path)) == $module_path ) + { + $module_found = true; + break; + } + } + return $module_found; + } + + /** * Read configs from all directories * on path specified * @@ -110,9 +132,11 @@ function includeConfigFiles() { + $db =& $this->Application->GetADODBConnection(); + foreach ($this->configFiles as $filename) { - $config_found = file_exists(DOC_ROOT.BASE_PATH.$filename); + $config_found = file_exists(DOC_ROOT.BASE_PATH.$filename) && $this->configAllowed($filename); if( defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_INCLUDES')) { if ( in_array($filename, get_required_files()) ) return;