From cefbc70ede686ab6548c7b426b9a7277abee00fa Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 23 May 2016 15:20:46 +0200 Subject: [PATCH] Fixed feature to add cron extension in meta. Tiquet: #3669 --- .../include/functions_extensions.php | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_extensions.php b/pandora_console/include/functions_extensions.php index 186dd57e8b..afea388b58 100644 --- a/pandora_console/include/functions_extensions.php +++ b/pandora_console/include/functions_extensions.php @@ -93,11 +93,24 @@ function extensions_is_extension ($page) { * @param bool $enterprise */ function extensions_get_extensions ($enterprise = false) { + $dir = EXTENSIONS_DIR; + $master_dir = ENTERPRISE_DIR . '/' . EXTENSIONS_DIR; $handle = false; - if ($enterprise) - $dir = ENTERPRISE_DIR.'/'.EXTENSIONS_DIR; - + if ($enterprise) { + $dir = ENTERPRISE_DIR . '/' . EXTENSIONS_DIR; + if (defined("METACONSOLE")) { + $dir = '../' . EXTENSIONS_DIR; + $master_dir = '../' . EXTENSIONS_DIR; + } + } + else { + if (defined("METACONSOLE")) { + $dir = '../../' . $dir; + $master_dir = '../' . EXTENSIONS_DIR; + } + } + if (file_exists ($dir)) $handle = @opendir ($dir); @@ -134,7 +147,7 @@ function extensions_get_extensions ($enterprise = false) { } /* Load extensions in enterprise directory */ - if (! $enterprise && file_exists (ENTERPRISE_DIR.'/'.EXTENSIONS_DIR)) + if (! $enterprise && file_exists ($master_dir)) return array_merge ($extensions, extensions_get_extensions (true)); return $extensions;