diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 3c540ea65..b1fd96f0f 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -208,6 +208,7 @@ $config['fhc_acl'] = array 'system.tbl_webservicerecht' => 'basis/webservicerecht', 'system.tbl_webservicetyp' => 'basis/webservicetyp', 'system.tbl_udf' => 'system/udf', + 'system.tbl_extensions' => 'system/extensions', 'testtool.tbl_ablauf' => 'basis/ablauf', 'testtool.tbl_antwort' => 'basis/antwort', 'testtool.tbl_frage' => 'basis/frage', diff --git a/application/libraries/ExtensionsLib.php b/application/libraries/ExtensionsLib.php index 146cf49ec..57e4846c4 100644 --- a/application/libraries/ExtensionsLib.php +++ b/application/libraries/ExtensionsLib.php @@ -12,10 +12,10 @@ class ExtensionsLib const FILE_INPUT_NAME = 'extension'; const ARCHIVE_EXTENSIONS = array('.tgz', '.tbz2'); const EXTENSION_JSON_NAME = 'extension.json'; + const UPLOAD_PATH = APPPATH.'tmp/'; const EXTENSIONS_PATH = APPPATH.'extensions/'; - const UPLOAD_PATH = ExtensionsLib::EXTENSIONS_PATH.'tmp/'; - const DIRECTORIES_BLACKLIST = array('api', 'bo', 'core', 'errors', 'jobs', 'html', 'ms', 'tmp', 'udf'); - const SOFTLINK_TARGET_DIRECTORIES = array('config', 'controllers', 'helpers', 'libraries', 'models', 'views', 'widgets'); + const EXTENSIONS_DIR_NAME = 'extensions'; + const SOFTLINK_TARGET_DIRECTORIES = array('config', 'controllers', 'helpers', 'hooks', 'libraries', 'models', 'views', 'widgets'); private $_errorOccurred; // private $_currentInstalledExtensionVersion; // @@ -293,6 +293,7 @@ class ExtensionsLib { $this->_errorOccurred = true; $this->_printFailure('data base error'); + var_dump($result); } else { @@ -658,14 +659,17 @@ class ExtensionsLib foreach (ExtensionsLib::SOFTLINK_TARGET_DIRECTORIES as $key => $targetDirectory) { - if (!file_exists(APPPATH.$targetDirectory.'/'.$extensionName)) + if (!file_exists(APPPATH.$targetDirectory.'/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$extensionName)) { if (!is_dir($extensionPath.$targetDirectory)) { mkdir($extensionPath.$targetDirectory); } - $_addSoftLinks = symlink($extensionPath.$targetDirectory, APPPATH.$targetDirectory.'/'.$extensionName); + $_addSoftLinks = symlink( + $extensionPath.$targetDirectory, + APPPATH.$targetDirectory.'/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$extensionName + ); if (!$_addSoftLinks) { break; @@ -733,28 +737,25 @@ class ExtensionsLib { $extensionName = $result->retval[0]->name; - if (!in_array($extensionName, ExtensionsLib::DIRECTORIES_BLACKLIST)) + if ($enabled === true) { - if ($enabled === true) + $_toggleExtension = $this->_addSoftLinks($extensionName); + } + else + { + $_toggleExtension = $this->_delSoftLinks($extensionName); + } + + if ($_toggleExtension) + { + $result = $this->ci->ExtensionsModel->update($extensionId, array('enabled' => $enabled)); + if (isSuccess($result)) { - $_toggleExtension = $this->_addSoftLinks($extensionName); + $_toggleExtension = true; } else { - $_toggleExtension = $this->_delSoftLinks($extensionName); - } - - if ($_toggleExtension) - { - $result = $this->ci->ExtensionsModel->update($extensionId, array('enabled' => $enabled)); - if (isSuccess($result)) - { - $_toggleExtension = true; - } - else - { - $this->_delSoftLinks($extensionName); - } + $this->_delSoftLinks($extensionName); } } } diff --git a/application/tmp/.placeholder b/application/tmp/.placeholder new file mode 100644 index 000000000..e69de29bb