From 1e0533ffa5d66c88f81a15e65b1ab9bbda472227 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Mon, 16 May 2022 06:25:03 +0200 Subject: [PATCH] Fixed #884 so we will have correct pagination in admin area J3. Imporved the import of powers JCB-pro. --- README.md | 12 +- admin/README.txt | 12 +- admin/config.xml | 22 +- admin/controllers/compiler.php | 3 +- admin/controllers/joomla_components.php | 2 +- admin/helpers/compiler/a_Get.php | 68 +-- admin/helpers/compiler/e_Interpretation.php | 135 ++++-- .../en-GB/en-GB.com_componentbuilder.ini | 15 +- .../joomla_component/details_above.php | 3 +- admin/models/ajax.php | 121 +++-- admin/models/compiler.php | 3 +- admin/models/forms/joomla_component.xml | 421 +++++++++--------- admin/models/import_joomla_components.php | 189 ++++---- admin/models/joomla_component.php | 141 +++--- admin/models/joomla_components.php | 166 +++++-- admin/sql/install.mysql.utf8.sql | 6 +- admin/sql/updates/mysql/2.12.16.sql | 1 + admin/views/compiler/view.html.php | 14 + .../custom_admin_views/tmpl/default_body.php | 4 +- admin/views/fields/tmpl/default_body.php | 4 +- .../tmpl/default_body.php | 4 +- .../joomla_plugins/tmpl/default_body.php | 8 +- admin/views/layouts/tmpl/default_body.php | 4 +- admin/views/site_views/tmpl/default_body.php | 4 +- admin/views/snippets/tmpl/default_body.php | 4 +- admin/views/templates/tmpl/default_body.php | 4 +- componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 17 + .../VDM.Joomla/src/Utilities/FileHelper.php | 4 +- script.php | 12 +- 30 files changed, 855 insertions(+), 554 deletions(-) create mode 100644 admin/sql/updates/mysql/2.12.16.sql diff --git a/README.md b/README.md index d76cf82d9..d5dd88264 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.16) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.17) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -143,13 +143,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 4th April, 2022 -+ *Version*: 2.12.16 ++ *Last Build*: 9th May, 2022 ++ *Version*: 2.12.17 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286290** -+ *Field count*: **1580** -+ *File count*: **1850** ++ *Line count*: **286508** ++ *Field count*: **1581** ++ *File count*: **1851** + *Folder count*: **260** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index d76cf82d9..d5dd88264 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.16) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.17) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -143,13 +143,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 4th April, 2022 -+ *Version*: 2.12.16 ++ *Last Build*: 9th May, 2022 ++ *Version*: 2.12.17 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286290** -+ *Field count*: **1580** -+ *File count*: **1850** ++ *Line count*: **286508** ++ *Field count*: **1581** ++ *File count*: **1851** + *Folder count*: **260** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/config.xml b/admin/config.xml index 888b5a717..097cdb7ac 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -134,18 +134,20 @@ folder="editors" filter="cmd" /> - + @@ -664,6 +666,16 @@ size="60" default="" /> + +
post->get('backup', 0, 'INT'); $addRepo = $jinput->post->get('repository', 0, 'INT'); $addPlaceholders = $jinput->post->get('placeholders', 2, 'INT'); + $addPowers = $jinput->post->get('powers', 2, 'INT'); $debugLinenr = $jinput->post->get('debuglinenr', 2, 'INT'); $minify = $jinput->post->get('minify', 2, 'INT'); // include component compiler require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/compiler.php'; $model = $this->getModel('compiler'); - if ($model->builder($version, $componentId, $addBackup, $addRepo, $addPlaceholders, $debugLinenr, $minify)) + if ($model->builder($version, $componentId, $addBackup, $addRepo, $addPlaceholders, $addPowers, $debugLinenr, $minify)) { $cache = JFactory::getCache('mod_menu'); $cache->clean(); diff --git a/admin/controllers/joomla_components.php b/admin/controllers/joomla_components.php index ecdf4ae68..6dae5c981 100644 --- a/admin/controllers/joomla_components.php +++ b/admin/controllers/joomla_components.php @@ -240,7 +240,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin if (componentbuilderHelper::checkString($model->key) && strlen($model->key) == 32) { $keyNotice = '

' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '

'; - $keyNotice .= '

' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEYBR_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY') . ''; + $keyNotice .= '

' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . ''; // set the package owner info if (componentbuilderHelper::getPackageOwnerValue('owner', $model->info) || componentbuilderHelper::getPackageOwnerValue('company', $model->info)) { diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 35c25c8d8..d3196dc04 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -15,6 +15,7 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Filesystem\File; use Joomla\CMS\Filesystem\Folder; +use VDM\Joomla\Utilities\GuidHelper; use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\ArrayHelper; @@ -188,7 +189,7 @@ class Get * * @var boolean */ - protected $addPower; + public $addPower; /** * The Powers data @@ -1053,7 +1054,10 @@ class Get $this->debugLinenr = ((int) $config['debuglinenr'] == 0) ? false : (((int) $config['debuglinenr'] == 1) ? true : $global); // set if powers should be added to component (default is true) - $global = true; + $global = ((int) GetHelper::var( + 'joomla_component', $this->componentID, 'id', + 'add_powers' + ) == 1) ? true : false; $this->addPower = (isset($config['powers']) && (int) $config['powers'] == 0) ? false : ((isset($config['powers']) && (int) $config['powers'] == 1) ? true : $global); // set the current user @@ -6872,8 +6876,10 @@ class Get // return the select query return array('select' => $querySelect, 'from' => $queryFrom, - 'name' => $queryName, 'table' => $table, - 'type' => $type, 'select_gets' => $gets, + 'name' => $queryName, + 'table' => $table, + 'type' => $type, + 'select_gets' => $gets, 'select_keys' => $keys); } } @@ -8613,13 +8619,13 @@ class Get * @return void * */ - protected function getPowers($ids) + protected function getPowers($guids) { - if (ArrayHelper::check($ids, true)) + if (ArrayHelper::check($guids, true)) { - foreach ($ids as $id) + foreach ($guids as $guid) { - $this->getPower($id); + $this->getPower($guid); } } } @@ -8630,11 +8636,11 @@ class Get * @return mixed * */ - public function getPower($id) + public function getPower($guid) { - if ($this->addPower && $this->setPower($id)) + if ($this->addPower && $this->setPower($guid)) { - return $this->powers[$id]; + return $this->powers[$guid]; } return false; @@ -8646,14 +8652,14 @@ class Get * @return bool * */ - protected function setPower($id) + protected function setPower($guid) { // check if we have been here before - if (isset($this->statePowers[$id])) + if (isset($this->statePowers[$guid])) { - return $this->statePowers[$id]; + return $this->statePowers[$guid]; } - elseif (is_numeric($id) && $id > 0) + elseif (GuidHelper::valid($guid)) { // Create a new query object. $query = $this->db->getQuery(true); @@ -8661,20 +8667,20 @@ class Get $query->select('a.*'); // from these tables $query->from('#__componentbuilder_power AS a'); - $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); + $query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid)); $this->db->setQuery($query); $this->db->execute(); if ($this->db->getNumRows()) { // make sure that in recursion we // don't try to load this power again - $this->statePowers[$id] = true; + $this->statePowers[$guid] = true; + // get the power data + $power = $this->db->loadObject(); // we set the fix usr if needed $fix_url = '"index.php?option=com_componentbuilder&view=powers&task=power.edit&id=' - . $id . '" target="_blank"'; - // get the power data - $power = $this->db->loadObject(); + . $power->id . '" target="_blank"'; // set some keys $power->target_type = 'P0m3R!'; $power->key = $power->id . '_' . $power->target_type; @@ -8706,7 +8712,7 @@ class Get $fix_url), 'Error' ); - $this->statePowers[$id] = false; + $this->statePowers[$guid] = false; // we break out here return false; @@ -8728,7 +8734,7 @@ class Get $fix_url), 'Error' ); - $this->statePowers[$id] = false; + $this->statePowers[$guid] = false; // we break out here return false; @@ -8765,7 +8771,7 @@ class Get $fix_url), 'Error' ); - $this->statePowers[$id] = false; + $this->statePowers[$guid] = false; // we break out here return false; @@ -8845,7 +8851,7 @@ class Get unset($power->implements_custom); } // does this extend existing - elseif ($implement >= 1) + elseif (GuidHelper::valid($implement)) { // check if it was set if ($this->setPower($implement)) @@ -8872,7 +8878,7 @@ class Get unset($power->extends_custom); } // does this extend existing - elseif ($power->extends >= 1) + elseif (GuidHelper::valid($power->extends)) { // check if it was set if ($this->setPower($power->extends)) @@ -8884,7 +8890,7 @@ class Get } } // set GUI mapper - $guiMapper = array('table' => 'power', 'id' => (int) $id, 'type' => 'php'); + $guiMapper = array('table' => 'power', 'id' => (int) $power->id, 'type' => 'php'); // add the header script if ($power->add_head == 1) { @@ -8941,23 +8947,23 @@ class Get ); } // store the power - $this->powers[$id] = $power; + $this->powers[$guid] = $power; return true; } } // we failed to get the power, // so we raise an error message - // only if id exist - if ($id > 0) + // only if guid is valid + if (GuidHelper::valid($guid)) { $this->app->enqueueMessage( - JText::sprintf('

Power id:%s not found!

', $id), + JText::sprintf('

Power guid:%s not found!

', $guid), 'Error' ); } // let's not try again - $this->statePowers[$id] = false; + $this->statePowers[$guid] = false; return false; } diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index a63ea7b2c..10efd2f7b 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -6971,10 +6971,20 @@ class Interpretation extends Fields // only add if no custom page link is found if (!$has_pageslinks) { - $this->placeholders[$this->bbb . 'PAGINATIONEND' - . $this->ddd] - .= PHP_EOL . $this->_t(2) - . 'pagination->getPagesLinks(); ?>'; + if ($this->target === 'custom_admin') + { + $this->placeholders[$this->bbb . 'PAGINATIONEND' + . $this->ddd] + .= PHP_EOL . $this->_t(2) + . 'pagination->getListFooter(); ?>'; + } + else + { + $this->placeholders[$this->bbb . 'PAGINATIONEND' + . $this->ddd] + .= PHP_EOL . $this->_t(2) + . 'pagination->getPagesLinks(); ?>'; + } } $this->placeholders[$this->bbb . 'PAGINATIONEND' . $this->ddd] .= PHP_EOL . $this->_t(1) . ''; @@ -6990,8 +7000,16 @@ class Interpretation extends Fields = 'pagination->getPagesCounter(); ?>'; // add pages links - $this->placeholders[$this->bbb . 'PAGESLINKS' . $this->ddd] - = 'pagination->getPagesLinks(); ?>'; + if ($this->target === 'custom_admin') + { + $this->placeholders[$this->bbb . 'PAGESLINKS' . $this->ddd] + = 'pagination->getListFooter(); ?>'; + } + else + { + $this->placeholders[$this->bbb . 'PAGESLINKS' . $this->ddd] + = 'pagination->getPagesLinks(); ?>'; + } // build body $body = array(); @@ -12071,10 +12089,19 @@ class Interpretation extends Fields && !$item['title'] && isset($item['id_code'])) { + // build GUID link + if ($item['custom']['id'] !== 'id') + { + // link to that linked item + return 'index.php?option=' . $item['custom']['component'] . '&view=' + . $item['custom']['views'] . '&task=' . $item['custom']['view'] + . '.edit&id=' . $item['id_code'] . '_id; ?>' + . $ref; + } // link to that linked item return 'index.php?option=' . $item['custom']['component'] . '&view=' . $item['custom']['views'] . '&task=' . $item['custom']['view'] - . '.edit&id=' . $item['id_code'] . '; ?>' + . '.edit&id=' . $item['id_code'] . '_id; ?>' . $ref; } elseif (isset($item['custom']) @@ -12156,16 +12183,37 @@ class Interpretation extends Fields $this->permissionBuilder[$coreLink['core.edit']] )) { - return $user . "->authorise('" . $coreLink['core.edit'] - . "', 'com_" . $this->componentCodeName . "." - . $item['custom']['view'] . ".' . (int)\$item->" - . $item['id_code'] . ")"; + // do this with GUID + if (isset($item['custom']['id']) && $item['custom']['id'] !== 'id') + { + return $user . "->authorise('" . $coreLink['core.edit'] + . "', 'com_" . $this->componentCodeName . "." + . $item['custom']['view'] . ".' . (int) \$item->" + . $item['id_code'] . "_id)"; + } + else + { + return $user . "->authorise('" . $coreLink['core.edit'] + . "', 'com_" . $this->componentCodeName . "." + . $item['custom']['view'] . ".' . (int) \$item->" + . $item['id_code'] . ")"; + } + } + // do not do this with GUID + if (isset($item['custom']['id']) && $item['custom']['id'] !== 'id') + { + // return default for this external item + return $user . "->authorise('core.edit', 'com_" + . $this->componentCodeName . "." . $item['custom']['view'] + . ".' . (int) \$item->" . $item['id_code'] . "_id)"; + } + else + { + // return default for this external item + return $user . "->authorise('core.edit', 'com_" + . $this->componentCodeName . "." . $item['custom']['view'] + . ".' . (int) \$item->" . $item['id_code'] . ")"; } - - // return default for this external item - return $user . "->authorise('core.edit', 'com_" - . $this->componentCodeName . "." . $item['custom']['view'] - . ".' . (int)\$item->" . $item['id_code'] . ")"; } elseif (isset($item['custom']) && ArrayHelper::check( @@ -16188,23 +16236,52 @@ class Interpretation extends Fields $filter['custom']['table'], 'w' ) ) . " table."; - // we want to at times just have the words and not the ids as well - if ($just_text) + // we must add some fix for none ID keys (I know this is horrible... but we need it) + // TODO we assume that all tables in admin has ids + if ($filter['custom']['id'] !== 'id') { - $query .= PHP_EOL . $this->_t(2) . $tab - . "\$query->select(\$db->quoteName('" - . $filter['custom']['db'] . "." - . $filter['custom']['text'] . "','" - . $filter['code'] . "'));"; + // we want to at times just have the words and not the ids as well + if ($just_text) + { + $query .= PHP_EOL . $this->_t(2) . $tab + . "\$query->select(\$db->quoteName(['" + . $filter['custom']['db'] . "." + . $filter['custom']['text'] . "','" + . $filter['custom']['db'] . ".id'],['" + . $filter['code'] . "','" + . $filter['code'] . "_id']));"; + } + else + { + $query .= PHP_EOL . $this->_t(2) . $tab + . "\$query->select(\$db->quoteName(['" + . $filter['custom']['db'] . "." + . $filter['custom']['text'] . "','" + . $filter['custom']['db'] . ".id'],['" + . $filter['code'] . "_" . $filter['custom']['text'] + . "','" . $filter['code'] . "_id']));"; + } } else { - $query .= PHP_EOL . $this->_t(2) . $tab - . "\$query->select(\$db->quoteName('" - . $filter['custom']['db'] . "." - . $filter['custom']['text'] . "','" - . $filter['code'] . "_" . $filter['custom']['text'] - . "'));"; + // we want to at times just have the words and not the ids as well + if ($just_text) + { + $query .= PHP_EOL . $this->_t(2) . $tab + . "\$query->select(\$db->quoteName('" + . $filter['custom']['db'] . "." + . $filter['custom']['text'] . "','" + . $filter['code'] . "'));"; + } + else + { + $query .= PHP_EOL . $this->_t(2) . $tab + . "\$query->select(\$db->quoteName('" + . $filter['custom']['db'] . "." + . $filter['custom']['text'] . "','" + . $filter['code'] . "_" . $filter['custom']['text'] + . "'));"; + } } $query .= PHP_EOL . $this->_t(2) . $tab . "\$query->join('LEFT', \$db->quoteName('" diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index eff098d0c..a9e73f7b0 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -14,6 +14,7 @@ COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS="Add Custom Code Placeholders" COM_COMPONENTBUILDER_ADD_KEY_HERE="add key here" COM_COMPONENTBUILDER_ADD_MENU="Add Menu" COM_COMPONENTBUILDER_ADD_MORE_FIELDS_TO_THIS_ADMIN_VIEW="Add more fields to this admin view" +COM_COMPONENTBUILDER_ADD_POWERS="Add Powers" COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_SMALLIF_SETSMALL="Add to Backup Folder & Sales Server (if set)" COM_COMPONENTBUILDER_ADD_TO_REPOSITORY_FOLDER="Add to Repository Folder" COM_COMPONENTBUILDER_ADD_YOUR_OWN_JCB_PACKAGES_TO_THE_COMMUNITY_A_S_GITHUBA_REPOSITORYBR_WATCH_THIS_A_S_TUTORIALA_TO_SEE_HOW="Add your own JCB packages to the community gitHub repository.
Watch this tutorial to see how!" @@ -3489,7 +3490,6 @@ COM_COMPONENTBUILDER_CONFIG_FROMNAME_LABEL="From Name" COM_COMPONENTBUILDER_CONFIG_GITHUB_ACCESS_TOKEN_DESCRIPTION="This is only needed when you are on a shared IP or/and have reached the public free limit of API queries to gitHub. So unless you have seen some kind of error that directed you here to add an access token you can just ignore this field." COM_COMPONENTBUILDER_CONFIG_GITHUB_ACCESS_TOKEN_HINT="OAUTH-TOKEN" COM_COMPONENTBUILDER_CONFIG_GITHUB_ACCESS_TOKEN_LABEL="gitHub Access Token
Check https://developer.github.com/v3/#authentication for more info." -COM_COMPONENTBUILDER_CONFIG_GITHUB_ACCESS_TOKEN_MESSAGE="Error! Please add token here." COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_DESCRIPTION="Here you can set the path to the git folder." COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_HINT="/home/user/git" COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_LABEL="Git Folder Path" @@ -3521,6 +3521,11 @@ COM_COMPONENTBUILDER_CONFIG_MAIL_CONFIGURATION="Mail Configuration" COM_COMPONENTBUILDER_CONFIG_MANAGE_JCB_PACKAGE_DIRECTORIES_DESCRIPTION="Here you can choose to manually select what directories should show, or turn them off altogether." COM_COMPONENTBUILDER_CONFIG_MANAGE_JCB_PACKAGE_DIRECTORIES_LABEL="Manage JCB Package Directories" COM_COMPONENTBUILDER_CONFIG_MANUAL_SELECTION="Manual Selection" +COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_DESC="Set the full path to where the key file must be stored. Make sure it is behind the root folder of your website, so that it is not public accessible." +COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_LABEL="Medium Key (Path)" +COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_NOTE_DESC="When using the medium encryption option, the system generates its own key and stores it in a file at the folder/path you set here.
Never change this key once it is set, or remove the key file! DATA WILL GET CORRUPTED IF YOU DO! Also make sure the full path to where the the key file should be stored, is behind the root folder of your website/system, so that it is not public accessible. Making a backup of this key file over a secure connection is recommended!" +COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_NOTE_LABEL="Medium Encryption" +COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_PATH_ERROR="Medium key path (for encryption of various fields) does not exist, or is not writable. Please check the path and update it in the global option of this component." COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_DESCRIPTION="Add the prefix you would like to use. Make sure that it is HTML Character Entities since it is being used in XML." COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_HINT="»" COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_LABEL="Prefix
@@ -5575,6 +5580,8 @@ COM_COMPONENTBUILDER_HTHREESHTHREEPCUSTOM_CODE_CAN_ONLY_BE_USED_IN_OTHER_CUSTOM_ COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP="

Curl Not Found!

Please setup curl on your system, or componentbuilder will not function correctly!

" COM_COMPONENTBUILDER_HTWODATA_IS_CORRUPTHTWOTHIS_COULD_BE_DUE_TO_BKEY_ERRORB_OR_BROKEN_PACKAGE="

Data is corrupt!

This could be due to key error, or broken package!" COM_COMPONENTBUILDER_HTWODATA_IS_CORRUPTHTWOTHIS_COULD_BE_DUE_TO_BROKEN_PACKAGE="

Data is corrupt!

This could be due to broken package!" +COM_COMPONENTBUILDER_HTWOWE_COULD_NOT_OPEN_THE_ENCRYPT_DATAHTWO_THIS_COULD_BE_DUE_TO_THE_FOFENCRYPTION_THAT_IS_NO_LONGER_SUPPORTED_IN_JOOMLABR_PLEASE_EXPORT_YOUR_PACKAGES_WITH_JCB_VTHREEZEROELEVENPRO_OR_VTWOONETWOSEVENTEENPUBLIC_OR_HIGHER_TO_BE_ABLE_TO_IMPORT_IT_INTO_THIS_VERSION_OF_JCB="

We could not open the encrypt data!

This could be due to the FOFEncryption that is no longer supported in Joomla.
Please export your packages with JCB v3.0.11(pro) or v2.12.17(public) or higher to be able to import it into this version of JCB." +COM_COMPONENTBUILDER_HTWOWE_COULD_NOT_OPEN_THE_PACKAGEHTWOTHIS_COULD_BE_DUE_TO_THE_FOFENCRYPTION_THAT_IS_NO_LONGER_SUPPORTED_IN_JOOMLA_PLEASE_EXPORT_YOUR_PACKAGES_WITH_JCB_VTHREEZEROELEVENPRO_OR_VTWOONETWOSEVENTEENPUBLIC_OR_HIGHER_TO_BE_ABLE_TO_IMPORT_IT_INTO_THIS_VERSION_OF_JCB="

We could not open the package!

This could be due to the FOFEncryption that is no longer supported in Joomla. Please export your packages with JCB v3.0.11(pro) or v2.12.17(public) or higher to be able to import it into this version of JCB." COM_COMPONENTBUILDER_IAUTHORI_BSB="Author: %s" COM_COMPONENTBUILDER_ICOMPANYI_BSB="Company: %s" COM_COMPONENTBUILDER_ICON="Icon" @@ -5732,6 +5739,8 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_PREFLIGHT_INSTALL_LABEL="Add PHP P COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_PREFLIGHT_UPDATE_LABEL="Add PHP Preflight (update)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PLACEHOLDERS_DESCRIPTION="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PLACEHOLDERS_LABEL="Custom Code Placeholders" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_POWERS_DESCRIPTION="Should JCB add any powers that are connected to this component? This may be helpful if you are loading powers via another component, and would like to avoid adding it to both, just remember that in this case you need to load the powers via a plugin." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_POWERS_LABEL="Add Powers" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL="Add Sales Server" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SITE_EVENT_LABEL="Add Global Site Event" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SQL_LABEL="Add MySQL - (Install)" @@ -8096,6 +8105,7 @@ COM_COMPONENTBUILDER_SERVER_VERSION_DESC="A count of the number of times this Se COM_COMPONENTBUILDER_SERVER_VERSION_LABEL="Version" COM_COMPONENTBUILDER_SET_A_CLASS_VALUE_FOR_THE_LIST_VIEW_OF_THIS_FIELD="Set a class value for the list view of this field." COM_COMPONENTBUILDER_SHARE_SNIPPETS="Share Snippets" +COM_COMPONENTBUILDER_SHOULD_JCB_ADD_ANY_POWERS_THAT_ARE_CONNECTED_TO_THIS_COMPONENT_THIS_MAY_BE_HELPFUL_IF_YOU_ARE_LOADING_POWERS_VIA_ANOTHER_COMPONENT_AND_WOULD_LIKE_TO_AVOID_ADDING_IT_TO_BOTH_JUST_REMEMBER_THAT_IN_THIS_CASE_YOU_NEED_TO_LOAD_THE_POWERS_VIA_A_PLUGIN="Should JCB add any powers that are connected to this component? This may be helpful if you are loading powers via another component, and would like to avoid adding it to both, just remember that in this case you need to load the powers via a plugin." COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code." COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_REPOSITORY_FOLDER="Should the component be moved to your local repository folder?" COM_COMPONENTBUILDER_SHOULD_THE_JAVASCRIPT_BE_MINIFIED_IN_THE_COMPONENT="Should the JavaScript be minified in the component." @@ -9146,7 +9156,6 @@ COM_COMPONENTBUILDER_VIEW_SNIPPET_REFERENCE_URL="View Snippet Reference URL" COM_COMPONENTBUILDER_VIEW_THE_CONTRIBUTOR_DETAILS="View the contributor details" COM_COMPONENTBUILDER_VIEW_USAGE_OF_COMMUNITY_VERSION="View Usage of community version" COM_COMPONENTBUILDER_VIEW_WHO_CONTRIBUTED_TO_THIS_SNIPPET="View who contributed to this snippet" -COM_COMPONENTBUILDER_VJRZDESSMHBTRWFIFTYTWVZEROAENINEKQFLVVXJTMTHREEJTWOIXM="VjRzdE%ssMHBtRW50TWV0aE9kQFlvVXJTM3J2IXM=" COM_COMPONENTBUILDER_VJRZDESSMHBTRWFIFTYTWVZEROAESFLVVXJTMTHREEJTWOIXM="VjRzdE%ssMHBtRW50TWV0aE%sFlvVXJTM3J2IXM=" COM_COMPONENTBUILDER_WEBSITE="Website" COM_COMPONENTBUILDER_WEBSITE_OF_S="Website of %s" @@ -9156,7 +9165,7 @@ COM_COMPONENTBUILDER_WE_FAILED_TO_MOVE_BSB="We failed to move %s!" COM_COMPONENTBUILDER_WE_SUCCESSFULLY_MOVED_BSB="We successfully moved %s!" COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION="While we download all 26 compiler GIF animations randomly used in the compiler GUI during compilation" COM_COMPONENTBUILDER_YES="Yes" -COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEYBR_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY="Your data is encrypted with a AES 128 bit encryption using the above 32 character key.
Without this key it will take the current technology with a brute force attack method more then 700 000 000 000 000 000 000 000 000 000 000 years to crack theoretically." +COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 128 bit encryption using the above 32 character key." COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY_UNLESS_THEY_HAVE_THIS_KEY_ABOVE_SO_DO_KEEP_IT_SAFE="Your data is encrypted with a AES 128 bit encryption using the above 32 character key. Without this key it will take the current technology with a brute force attack method more then 700 000 000 000 000 000 000 000 000 000 000 years to crack theoretically. Unless they have this key above, so do keep it safe." COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items." COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASH_AREA_AND_YOU_DONT_HAVE_ANY_ITEMS_IN_TRASH_AT_THE_MOMENT="You are currently viewing the trash area, and you don't have any items in trash at the moment!" diff --git a/admin/layouts/joomla_component/details_above.php b/admin/layouts/joomla_component/details_above.php index ab64d9a8f..bf4de86d4 100644 --- a/admin/layouts/joomla_component/details_above.php +++ b/admin/layouts/joomla_component/details_above.php @@ -27,7 +27,8 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( - 'system_name' + 'system_name', + 'add_powers' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 5d9ddab42..a06b8268c 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -167,10 +167,36 @@ class ComponentbuilderModelAjax extends JModelList { // Get the encryption object. $db = 'COM_COMPONENTBUILDER_VJRZDESSMHBTRWFIFTYTWVZEROAESFLVVXJTMTHREEJTWOIXM'; - $opener = new FOFEncryptAes(base64_decode(JText::sprintf($db, 'QzdmV', '9kQ')), 128); - $info = rtrim($opener->decryptString($info), "\0"); + $password = base64_decode(JText::sprintf($db, 'QzdmV', '9kQ')); + // we first use the new encryption + // load phpseclib + $opened = false; + if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael) + { + // load the system password + ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($password, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt'); + // open the info block + $_info = ComponentbuilderHelper::crypt('AES', 'CBC')->decrypt(base64_decode($info)); + // check if we had success + if ($_info !== false) + { + $opened = true; + } + } + // check if we had success + if (!$opened && class_exists('FOFEncryptAes')) + { + $opener = new FOFEncryptAes($password, 128); + $_info = $opener->decryptString($info); + // check if we had success + if ($_info !== false) + { + $opened = true; + $_info = rtrim($_info, "\0"); + } + } // check if we have json - if (ComponentbuilderHelper::checkJson($info)) + if ($opened && ComponentbuilderHelper::checkJson($_info)) { $info = json_decode($info, true); return array('owner' => ComponentbuilderHelper::getPackageOwnerDetailsDisplay($info, true), 'packages' => ComponentbuilderHelper::getPackageComponentsDetailsDisplay($info)); @@ -1065,7 +1091,7 @@ class ComponentbuilderModelAjax extends JModelList array('table' => 'custom_admin_view', 'tables' => 'custom_admin_views', 'fields' => array('params' => 'custom_admin_view_headers:power_', 'system_name' => 'NAME'), 'linked' => 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW'), array('table' => 'joomla_component', 'tables' => 'joomla_components', 'fields' => array('params' => 'joomla_component_headers:power_', 'system_name' => 'NAME'), 'linked' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT'), array('table' => 'component_dashboard', 'tables' => 'components_dashboard', 'fields' => array('params' => 'component_dashboard_headers:power_', 'joomla_component' => 'NAME'), 'linked' => 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD', 'linked_name' => 'system_name'), - array('table' => 'power', 'tables' => 'powers', 'fields' => array('extends' => 'INT', 'implements' => 'ARRAY', 'use_selection' => 'use', 'load_selection' => 'load', 'system_name' => 'NAME'), 'linked' => 'COM_COMPONENTBUILDER_POWER') + array('table' => 'power', 'tables' => 'powers', 'fields' => array('extends' => 'GUID', 'implements' => 'ARRAY', 'use_selection' => 'use', 'load_selection' => 'load', 'system_name' => 'NAME'), 'linked' => 'COM_COMPONENTBUILDER_POWER') ) ); @@ -1095,8 +1121,14 @@ class ComponentbuilderModelAjax extends JModelList } // make sure the ref is set $this->ref = '&ref=' . $values['a_view'] . '&refid=' . $values['a_id'] . '&return=' . urlencode(base64_encode($return_url)); + // specail treatment of powers + $guid = false; + if ('power' === $values['a_view']) + { + $guid = $values['a_guid']; + } // get the linked to - if ($linked = $this->getLinkedTo($values['a_view'], $values['a_id'])) + if ($linked = $this->getLinkedTo($values['a_view'], $values['a_id'], $guid)) { // just return it for now a table $table = '
'; @@ -1119,13 +1151,14 @@ class ComponentbuilderModelAjax extends JModelList /** * Get Linked to Items * - * @param string $view View that is being searched for - * @param int $id ID + * @param string $view View that is being searched for + * @param int $id ID + * @param string $guid GUID * * @return array Found items * */ - protected function getLinkedTo($view, $id) + protected function getLinkedTo($view, $id, $guid) { // reset bucket $linked = array(); @@ -1174,6 +1207,14 @@ class ComponentbuilderModelAjax extends JModelList $found = true; } } + elseif ('GUID' === $target) + { + // check if GUID match + if ($this->linkedGuid($guid, $item->{$key})) + { + $found = true; + } + } else { // check if we have a json @@ -1189,7 +1230,7 @@ class ComponentbuilderModelAjax extends JModelList // check if ID match foreach ($item->{$key} as $_id) { - if ($_id == $id) + if ($_id == $id || $this->linkedGuid($guid, $_id)) { $found = true; } @@ -1208,7 +1249,7 @@ class ComponentbuilderModelAjax extends JModelList { if ($_size == 2) { - if (isset($row[$_target[0]]) && isset($row[$_target[0]][$_target[1]]) && $row[$_target[0]][$_target[1]] == $id) + if (isset($row[$_target[0]]) && isset($row[$_target[0]][$_target[1]]) && ($row[$_target[0]][$_target[1]] == $id || $this->linkedGuid($guid, $row[$_target[0]][$_target[1]]))) { $found = true; } @@ -1217,7 +1258,7 @@ class ComponentbuilderModelAjax extends JModelList { foreach ($row[$_target[0]] as $_row) { - if (!$found && isset($_row[$_target[2]]) && $_row[$_target[2]] == $id) + if (!$found && isset($_row[$_target[2]]) && ($_row[$_target[2]] == $id || $this->linkedGuid($guid, $_row[$_target[2]]))) { $found = true; } @@ -1238,7 +1279,7 @@ class ComponentbuilderModelAjax extends JModelList { foreach ($row as $key => $_ids) { - if (!$found && strpos($key, $_target[1]) !== false && in_array($id, $_ids)) + if (!$found && strpos($key, $_target[1]) !== false && (in_array($id, $_ids) || $this->linkedGuid($guid, $_ids))) { $found = true; } @@ -1251,7 +1292,7 @@ class ComponentbuilderModelAjax extends JModelList { foreach ($item->{$key} as $row) { - if (!$found && isset($row[$target]) && $row[$target] == $id) + if (!$found && isset($row[$target]) && ($row[$target] == $id || $this->linkedGuid($guid, $row[$target]))) { $found = true; } @@ -1275,7 +1316,7 @@ class ComponentbuilderModelAjax extends JModelList { foreach ($_fields as $_field) { - if ($_field == $id) + if ($_field == $id || $this->linkedGuid($guid, $_field)) { $found = true; } @@ -1330,6 +1371,32 @@ class ComponentbuilderModelAjax extends JModelList } return false; } + + /** + * Check if we have a GUID match + * + * @param string|bool $guid The active power guid + * @param string|array $setGuid The linked power guid + * + * @return bool true if match is found + * + */ + protected function linkedGuid($guid, $setGuid): bool + { + // check if GUID is valid + if ($guid && ComponentbuilderHelper::validGUID($guid)) + { + if (is_string($setGuid) && ComponentbuilderHelper::validGUID($setGuid) && $guid === $setGuid) + { + return true; + } + elseif (is_array($setGuid) && in_array($guid, $setGuid)) + { + return true; + } + } + return false; + } protected $viewid = array(); @@ -1356,13 +1423,13 @@ class ComponentbuilderModelAjax extends JModelList } } // set GUID if found (TODO we will later move over to GUID) - // if (($guid = ComponentbuilderHelper::get($vdm . '__guid')) !== false && method_exists('ComponentbuilderHelper', 'validGUID')) - //{ - // if (ComponentbuilderHelper::validGUID($guid)) - // { - // $this->viewid[$call]['a_guid'] = $guid; - // } - //} + if (($guid = ComponentbuilderHelper::get($vdm . '__guid')) !== false && method_exists('ComponentbuilderHelper', 'validGUID')) + { + if (ComponentbuilderHelper::validGUID($guid)) + { + $this->viewid[$call]['a_guid'] = $guid; + } + } // set return if found if (($return = ComponentbuilderHelper::get($vdm . '__return')) !== false) { @@ -1627,11 +1694,11 @@ class ComponentbuilderModelAjax extends JModelList // set the key get value $key_get_value = $values['a_id']; // check if we have a GUID - if (isset($values['a_guid'])) - { - $this->ref .= '&guid=' . (string) $values['a_guid']; - $key_get_value = $values['a_guid']; - } + //if (isset($values['a_guid'])) + //{ + //$this->ref .= '&guid=' . (string) $values['a_guid']; + //$key_get_value = $values['a_guid']; + //} // load the results $result = array(); // return field table @@ -2703,7 +2770,7 @@ class ComponentbuilderModelAjax extends JModelList 'name' => 'name' ), // #__componentbuilder_power (v) - 'class_method' => array( + 'power' => array( 'search' => array('id', 'system_name', 'name', 'description', 'head', 'namespace', 'main_class_code'), 'views' => 'powers', 'not_base64' => array('description'), diff --git a/admin/models/compiler.php b/admin/models/compiler.php index 564dc5697..a7b995f4e 100644 --- a/admin/models/compiler.php +++ b/admin/models/compiler.php @@ -202,13 +202,14 @@ class ComponentbuilderModelCompiler extends JModelList return true; } - public function builder($version, $id, $backup, $repo, $addPlaceholders, $debugLinenr, $minify) + public function builder($version, $id, $backup, $repo, $addPlaceholders, $addPowers, $debugLinenr, $minify) { $set['version'] = $version; $set['component'] = $id; $set['backup'] = $backup; $set['repository'] = $repo; $set['placeholders'] = $addPlaceholders; + $set['powers'] = $addPowers; $set['debuglinenr'] = $debugLinenr; $set['minify'] = $minify; // run compiler diff --git a/admin/models/forms/joomla_component.xml b/admin/models/forms/joomla_component.xml index 5f52e08a8..17abef7d8 100644 --- a/admin/models/forms/joomla_component.xml +++ b/admin/models/forms/joomla_component.xml @@ -156,48 +156,6 @@ message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_MESSAGE" hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_HINT" /> - - - - - - + + + + - - - - - - - - - - + + + + @@ -336,8 +304,38 @@ - - + + + + + + + + - - - - - - + + - - + + + + + + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO - - - - - - + + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CUSTOM_USED_IN_CUSTOM_CODE + + + + + + + + - - - - - + - + - - + + - - + + - + - + + + + + - - - - + + + + + + + + array(), 'adminview' => array()); protected $divergedDataMover = array(); protected $fieldTypes = array(); @@ -151,7 +153,15 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy $session->clear('package'); $session->clear('dataType'); $session->clear('hasPackage'); + // before we clear this, we add it locally + $packageInfo = $session->get('smart_package_info', null); + // now clear it $session->clear('smart_package_info'); + // convert to an array if found + if ($packageInfo && ComponentbuilderHelper::checkJson($packageInfo)) + { + $this->packageInfo = json_decode($packageInfo, true); + } break; default: @@ -185,7 +195,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy $session->clear('backto_VDM_IMPORT'); if ($back) { - $this->app->setUserState('com_componentbuilder.redirect_url', 'index.php?option=com_componentbuilder&view='.$back); + $this->app->setUserState('com_componentbuilder.redirect_url', 'index.php?option=com_componentbuilder&view=' . $back); } $session->clear('backto_VDM_IMPORT'); return false; @@ -335,18 +345,18 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy // load the data if ($info = @file_get_contents($infoFile)) { - // remove all line breaks - $info = str_replace("\n", '', $info); - // make sure we have base64 - if ($info === base64_encode(base64_decode($info, true))) + // Get the password. + $db = 'COM_COMPONENTBUILDER_SZDEQZDMVSMHBTRWFIFTYTSQFLVVXJTMTHREEJTWOIXM'; + $password = base64_decode(JText::sprintf($db, 'VjR', 'WV0aE9k')); + // unlock the info data + if (($info = $this->unlock($info, $password, true)) !== false && ComponentbuilderHelper::checkJson($info)) { - // Get the encryption object. - $db = 'COM_COMPONENTBUILDER_VJRZDESSMHBTRWFIFTYTWVZEROAENINEKQFLVVXJTMTHREEJTWOIXM'; - $opener = new FOFEncryptAes(base64_decode(JText::sprintf($db, 'QzdmV')), 128); - $info = rtrim($opener->decryptString($info), "\0"); + // we only continue if info could be opened $session->set('smart_package_info', $info); return true; } + // do not have check sum validation + $this->app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_HTWOWE_COULD_NOT_OPEN_THE_PACKAGEHTWOTHIS_COULD_BE_DUE_TO_THE_FOFENCRYPTION_THAT_IS_NO_LONGER_SUPPORTED_IN_JOOMLA_PLEASE_EXPORT_YOUR_PACKAGES_WITH_JCB_VTHREEZEROELEVENPRO_OR_VTWOONETWOSEVENTEENPUBLIC_OR_HIGHER_TO_BE_ABLE_TO_IMPORT_IT_INTO_THIS_VERSION_OF_JCB'), 'error'); } } ComponentbuilderHelper::removeFolder($this->dir); @@ -656,24 +666,11 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy protected function extractData($data) { // remove all line breaks - $data = str_replace("\n", '', $data); - // make sure we have base64 - if ($data === base64_encode(base64_decode($data, true))) + if (($data = $this->unlock($data, $this->sleutle)) !== false) { - // open the data - if(ComponentbuilderHelper::checkString($this->sleutle) && strlen($this->sleutle) == 32) - { - // Get the encryption object. - $opener = new FOFEncryptAes($this->sleutle, 128); - $data = rtrim($opener->decryptString($data), "\0"); - } - else - { - $data = base64_decode($data); - } // final check if we have success $data = @unserialize($data); - if ($data !== false) + if (ComponentbuilderHelper::checkArray($data)) { // set the data global $this->data = $data; @@ -1005,7 +1002,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy } /** - * Method to unlock all files + * Method to unlock all files in all folders of this package * * @return void */ @@ -1014,7 +1011,6 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy // lock the data if set if(ComponentbuilderHelper::checkString($this->sleutle) && strlen($this->sleutle) == 32) { - $unlocker = new FOFEncryptAes($this->sleutle, 128); // we must first store the current working directory $joomla = getcwd(); // to avoid that it decrypt the db and info file again we must move per/folder @@ -1026,7 +1022,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy // go to the package sub folder if found if (JFolder::exists($subPath)) { - $this->unlock($subPath, $unlocker); + $this->unLockFile($subPath); } } // change back to working dir @@ -1035,11 +1031,11 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy } /** - * The Unlocker + * The unlocking files * * @return void */ - protected function unlock(&$tmpPath, &$unlocker) + protected function unLockFile(&$tmpPath) { // we are changing the working directory to the tmp path (important) chdir($tmpPath); @@ -1048,12 +1044,11 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy // read in the file content foreach ($files as $file) { - // check that the string is base64 - $data = str_replace("\n", '', file_get_contents($file)); - if ($data === base64_encode(base64_decode($data, true))) + // open the file content + if (($data = $this->unlock(file_get_contents($file), $this->sleutle)) !== false) { // write the decrypted data back to file - if (!ComponentbuilderHelper::writeFile($file, rtrim($unlocker->decryptString($data), "\0"))) + if (!ComponentbuilderHelper::writeFile($file, $data)) { // in case file could not be unlocked $this->app->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_FILE_BSB_COULD_NOT_BE_UNLOCKED', $file), 'error'); @@ -1064,9 +1059,79 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy $this->app->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_FILE_BSB_WAS_SUCCESSFULLY_UNLOCKED', $file), 'success'); } } + else + { + // in case file could not be unlocked + $this->app->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_FILE_BSB_COULD_NOT_BE_UNLOCKED', $file), 'error'); + } } } + /** + * unlock data + * + * @param string $data The data string + * @param string $password The key to unlock + * @param bool $force Should we force phpseclib decryption + * + * @return mixed the data, or false + * + * @since 3.0.11 + **/ + protected function unlock(string $data, string $password, bool $force = false) + { + // remove all line breaks + $data = str_replace("\n", '', $data); + // make sure we have base64 + if ($data === base64_encode(base64_decode($data, true))) + { + // open the data + if(ComponentbuilderHelper::checkString($password) && strlen($password) == 32) + { + // check if we should use the phpseclib decryption + $phpseclip = (isset($this->packageInfo['phpseclib']) && $this->packageInfo['phpseclib']) ? true : $force; + // load phpseclib + if($phpseclip && ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael) + { + // load the system password + ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($password, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt'); + // open the data block + $data = ComponentbuilderHelper::crypt('AES', 'CBC')->decrypt(base64_decode($data)); + // check if we had success + if ($data !== false) + { + return $data; + } + } + // check if we had success + if (class_exists('FOFEncryptAes')) + { + // Get the encryption object. + if (!$this->noopmaker instanceof FOFEncryptAes) + { + $this->noopmaker = new FOFEncryptAes($password, 128); + } + // open the data block + $data = $this->noopmaker->decryptString($data); + // check if we had success + if ($data !== false) + { + return $data; + } + else + { + $this->app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_HTWOWE_COULD_NOT_OPEN_THE_ENCRYPT_DATAHTWO_THIS_COULD_BE_DUE_TO_THE_FOFENCRYPTION_THAT_IS_NO_LONGER_SUPPORTED_IN_JOOMLABR_PLEASE_EXPORT_YOUR_PACKAGES_WITH_JCB_VTHREEZEROELEVENPRO_OR_VTWOONETWOSEVENTEENPUBLIC_OR_HIGHER_TO_BE_ABLE_TO_IMPORT_IT_INTO_THIS_VERSION_OF_JCB'), 'error'); + } + } + } + else + { + return base64_decode($data); + } + } + return false; + } + /** * Update some items after all * @@ -1323,7 +1388,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy } // get the power $query = $this->_db->getQuery(true); - $query->select(array('a.id', 'a.extends', 'a.implements', 'a.use_selection', 'a.property_selection', 'a.method_selection')); + $query->select(array('a.id', 'a.property_selection', 'a.method_selection')); $query->from($this->_db->quoteName('#__componentbuilder_power', 'a')); $query->where($this->_db->quoteName('a.id') . ' = '. (int) $power); // see if we get an item @@ -1332,14 +1397,9 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy if ($this->_db->getNumRows()) { $item = $this->_db->loadObject(); - // now update extends - $item = $this->setNewID($item, 'extends', 'power', 'power'); - // now update implements - $item = $this->setNewID($item, 'implements', 'power', 'power'); // subform fields to target $updaterT = array( // subformfield => array( field => type_value ) - 'use_selection' => array('use' => 'power'), 'property_selection' => array('property' => 'class_property'), 'method_selection' => array('method' => 'class_method') ); @@ -1828,37 +1888,6 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy { $item->system_name = $item->system_name.$this->postfix; } - // param fields to target - if ($type === 'site_view') - { - $updaterP = array( - // param_field => field* => field_table - 'site_view_headers' => array( - 'power_site_view_model' => 'power', - 'power_site_view' => 'power', - 'power_site_view_controller' => 'power', - 'power_site_views_model' => 'power', - 'power_site_views' => 'power', - 'power_site_views_controller' => 'power' - ) - ); - } - else - { - $updaterP = array( - // param_field => field* => field_table - 'custom_admin_view_headers' => array( - 'power_custom_admin_view_model' => 'power', - 'power_custom_admin_view' => 'power', - 'power_custom_admin_view_controller' => 'power', - 'power_custom_admin_views_model' => 'power', - 'power_custom_admin_views' => 'power', - 'power_custom_admin_views_controller' => 'power' - ) - ); - } - // update the params ids - $this->updateParamIDs($item, $type, $updaterP); break; case 'admin_view': // set the getters anchors @@ -1911,14 +1940,6 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy // param fields to target $updaterP = array( // param_field => field* => field_table - 'admin_view_headers' => array( - 'power_admin_view_model' => 'power', - 'power_admin_view' => 'power', - 'power_admin_view_controller' => 'power', - 'power_admin_views_model' => 'power', - 'power_admin_views' => 'power', - 'power_admin_views_controller' => 'power' - ), 'fieldordering' => array( 'admin_ordering_fields.field' => 'field', 'linked_ordering_fields.field' => 'field' @@ -2073,18 +2094,6 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy ); // update the repeatable fields $item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR); - // param fields to target - $updaterP = array( - // param_field => field* => field_table - 'joomla_component_headers' => array( - 'power_admin_component' => 'power', - 'power_site_component' => 'power', - 'power_admin_helper' => 'power', - 'power_site_helper' => 'power' - ) - ); - // update the params ids - $this->updateParamIDs($item, $type, $updaterP); // if we can't merge add postfix to name if ($this->postfix) { diff --git a/admin/models/joomla_component.php b/admin/models/joomla_component.php index d967bd71a..19501b536 100644 --- a/admin/models/joomla_component.php +++ b/admin/models/joomla_component.php @@ -60,7 +60,8 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin 'copyright' ), 'above' => array( - 'system_name' + 'system_name', + 'add_powers' ), 'under' => array( 'not_required' @@ -90,6 +91,27 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin 'css_site' ) ), + 'dynamic_integration' => array( + 'left' => array( + 'add_update_server', + 'update_server_url', + 'update_server_target', + 'note_update_server_note_ftp', + 'note_update_server_note_zip', + 'note_update_server_note_other', + 'update_server', + 'add_sales_server', + 'sales_server' + ), + 'right' => array( + 'translation_tool', + 'note_crowdin', + 'crowdin_project_identifier', + 'crowdin_project_api_key', + 'crowdin_username', + 'crowdin_account_api_key' + ) + ), 'readme' => array( 'left' => array( 'addreadme', @@ -130,27 +152,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin 'assets_table_fix' ) ), - 'dynamic_integration' => array( - 'left' => array( - 'add_update_server', - 'update_server_url', - 'update_server_target', - 'note_update_server_note_ftp', - 'note_update_server_note_zip', - 'note_update_server_note_other', - 'update_server', - 'add_sales_server', - 'sales_server' - ), - 'right' => array( - 'translation_tool', - 'note_crowdin', - 'crowdin_project_identifier', - 'crowdin_project_api_key', - 'crowdin_username', - 'crowdin_account_api_key' - ) - ), 'dynamic_build_beta' => array( 'fullwidth' => array( 'note_buildcomp_dynamic_mysql', @@ -341,6 +342,30 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $item->metadata = $registry->toArray(); } + if (!empty($item->php_helper_both)) + { + // base64 Decode php_helper_both. + $item->php_helper_both = base64_decode($item->php_helper_both); + } + + if (!empty($item->php_method_uninstall)) + { + // base64 Decode php_method_uninstall. + $item->php_method_uninstall = base64_decode($item->php_method_uninstall); + } + + if (!empty($item->php_preflight_install)) + { + // base64 Decode php_preflight_install. + $item->php_preflight_install = base64_decode($item->php_preflight_install); + } + + if (!empty($item->css_admin)) + { + // base64 Decode css_admin. + $item->css_admin = base64_decode($item->css_admin); + } + if (!empty($item->php_admin_event)) { // base64 Decode php_admin_event. @@ -353,30 +378,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $item->php_site_event = base64_decode($item->php_site_event); } - if (!empty($item->php_helper_both)) - { - // base64 Decode php_helper_both. - $item->php_helper_both = base64_decode($item->php_helper_both); - } - - if (!empty($item->php_preflight_install)) - { - // base64 Decode php_preflight_install. - $item->php_preflight_install = base64_decode($item->php_preflight_install); - } - - if (!empty($item->php_method_uninstall)) - { - // base64 Decode php_method_uninstall. - $item->php_method_uninstall = base64_decode($item->php_method_uninstall); - } - - if (!empty($item->css_admin)) - { - // base64 Decode css_admin. - $item->css_admin = base64_decode($item->css_admin); - } - if (!empty($item->php_postflight_install)) { // base64 Decode php_postflight_install. @@ -1408,6 +1409,30 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $data['addcontributors'] = ''; } + // Set the php_helper_both string to base64 string. + if (isset($data['php_helper_both'])) + { + $data['php_helper_both'] = base64_encode($data['php_helper_both']); + } + + // Set the php_method_uninstall string to base64 string. + if (isset($data['php_method_uninstall'])) + { + $data['php_method_uninstall'] = base64_encode($data['php_method_uninstall']); + } + + // Set the php_preflight_install string to base64 string. + if (isset($data['php_preflight_install'])) + { + $data['php_preflight_install'] = base64_encode($data['php_preflight_install']); + } + + // Set the css_admin string to base64 string. + if (isset($data['css_admin'])) + { + $data['css_admin'] = base64_encode($data['css_admin']); + } + // Set the php_admin_event string to base64 string. if (isset($data['php_admin_event'])) { @@ -1420,30 +1445,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $data['php_site_event'] = base64_encode($data['php_site_event']); } - // Set the php_helper_both string to base64 string. - if (isset($data['php_helper_both'])) - { - $data['php_helper_both'] = base64_encode($data['php_helper_both']); - } - - // Set the php_preflight_install string to base64 string. - if (isset($data['php_preflight_install'])) - { - $data['php_preflight_install'] = base64_encode($data['php_preflight_install']); - } - - // Set the php_method_uninstall string to base64 string. - if (isset($data['php_method_uninstall'])) - { - $data['php_method_uninstall'] = base64_encode($data['php_method_uninstall']); - } - - // Set the css_admin string to base64 string. - if (isset($data['css_admin'])) - { - $data['css_admin'] = base64_encode($data['css_admin']); - } - // Set the php_postflight_install string to base64 string. if (isset($data['php_postflight_install'])) { diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 503acd031..8052ddb6b 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -104,6 +104,8 @@ class ComponentbuilderModelJoomla_components extends JModelList $this->removeOldComponentValues($item); // load to global object $this->smartBox['joomla_component'][$item->id] = $item; + // set the powers linked to this joomla component + $this->setSmartIDs($this->getValues($item->params, 'power', 'joomla_component_headers', null), 'power', false); // add to pks $pks[] = $item->id; } @@ -266,6 +268,8 @@ class ComponentbuilderModelJoomla_components extends JModelList $this->setLanguageTranslation($item->id); // load to global object $this->smartBox['joomla_component'][$item->id] = $item; + // set the powers linked to this joomla component + $this->setSmartIDs($this->getValues($item->params, 'power', 'joomla_component_headers', null), 'power', false); // add to pks $pks[] = $item->id; } @@ -402,7 +406,7 @@ class ComponentbuilderModelJoomla_components extends JModelList // add powers if (isset($this->smartIDs['power']) && ComponentbuilderHelper::checkArray($this->smartIDs['power'])) { - $this->setData('power', array_values($this->smartIDs['power']), 'id'); + $this->setData('power', array_values($this->smartIDs['power']), 'guid'); } // set limiter $limit = 0; @@ -697,8 +701,24 @@ class ComponentbuilderModelJoomla_components extends JModelList $query->select(array('a.*')); // From the componentbuilder_ANY table $query->from($this->_db->quoteName('#__componentbuilder_'. $table, 'a')); - // set the where query - $query->where('a.'.$key.' IN (' . implode(',',$values) . ')'); + // check if this is an array of integers + if ($this->is_numeric($values)) + { + // set the where query + $query->where('a.'.$key.' IN (' . implode(',', $values) . ')'); + } + else + { + // set the where query + $query->where('a.'.$key.' IN (' . implode(',', array_map( function ($var) { + // check if already quoted + if (preg_match('/^(["\']).*\1$/m', $var)) + { + return $var; + } + return $this->_db->quote($var); + }, $values)) . ')'); + } // Implement View Level Access if (!$this->user->authorise('core.options', 'com_componentbuilder')) { @@ -806,19 +826,9 @@ class ComponentbuilderModelJoomla_components extends JModelList if ('joomla_component' === $table) { // make sure old fields are not exported any more - unset($item->addconfig); - unset($item->addadmin_views); - unset($item->addcustom_admin_views); - unset($item->addsite_views); - unset($item->version_update); - unset($item->sql_tweak); - unset($item->addcustommenus); - unset($item->dashboard_tab); - unset($item->php_dashboard_methods); - unset($item->addfiles); - unset($item->addfolders); - // set the powers linked to this admin view - $this->setSmartIDs($this->getValues($item->params, 'power', 'joomla_component_headers', null), 'power'); + $this->removeOldComponentValues($item); + // set the powers linked to this joomla component + $this->setSmartIDs($this->getValues($item->params, 'power', 'joomla_component_headers', null), 'power', false); } // actions to take before storing the item if table is admin_view if ('admin_view' === $table) @@ -845,6 +855,12 @@ class ComponentbuilderModelJoomla_components extends JModelList // build full path folders $this->moveIt($this->getValues($item->addfoldersfullpath, 'subform', 'folderpath', null), 'folder', true); } + // actions to take if table is component_dashboard + if ('component_dashboard' === $table) + { + // set the powers linked to this dashboard + $this->setSmartIDs($this->getValues($item->params, 'power', 'component_dashboard_headers', null), 'power', false); + } // actions to take if table is component_config if ('component_config' === $table) { @@ -917,7 +933,7 @@ class ComponentbuilderModelJoomla_components extends JModelList // add fields & conditions $this->setSmartIDs($item->id, 'admin_view'); // set the powers linked to this admin view - $this->setSmartIDs($this->getValues($item->params, 'power', 'admin_view_headers', null), 'power'); + $this->setSmartIDs($this->getValues($item->params, 'power', 'admin_view_headers', null), 'power', false); // do not move anything if clone if ('clone' !== $this->activeType) { @@ -1027,13 +1043,13 @@ class ComponentbuilderModelJoomla_components extends JModelList if ('site_view' === $table) { // set the powers linked to this admin view - $this->setSmartIDs($this->getValues($item->params, 'power', 'site_view_headers', null), 'power'); + $this->setSmartIDs($this->getValues($item->params, 'power', 'site_view_headers', null), 'power', false); } // actions to take if table is custom_admin_view elseif ('custom_admin_view' === $table) { // set the powers linked to this admin view - $this->setSmartIDs($this->getValues($item->params, 'power', 'custom_admin_view_headers', null), 'power'); + $this->setSmartIDs($this->getValues($item->params, 'power', 'custom_admin_view_headers', null), 'power', false); } } // actions to take if table is template and layout @@ -1098,17 +1114,23 @@ class ComponentbuilderModelJoomla_components extends JModelList // add joomla_plugin_group $this->setSmartIDs((int) $item->joomla_plugin_group, 'joomla_plugin_group'); } + // actions to take if table is dynamic_get + if ('dynamic_get' === $table) + { + // add dynamic_get_headers + $this->setSmartIDs($this->getValues($item->params, 'power', 'dynamic_get_headers', null), 'power', false); + } // actions to take if table is power if ('power' === $table) { // add the extended class (powers) - $this->setData('power', $item->extends, 'id'); + $this->setData('power', $item->extends, 'guid'); // add implements interfaces (powers) - $this->setData('power', $item->implements, 'id'); + $this->setData('power', $item->implements, 'guid'); // add use classes (powers) - $this->setData('power', $this->getValues($item->use_selection, 'subform', 'use'), 'id'); + $this->setData('power', $this->getValues($item->use_selection, 'subform', 'use'), 'guid'); // add load classes (powers) - $this->setData('power', $this->getValues($item->load_selection, 'subform', 'load'), 'id'); + $this->setData('power', $this->getValues($item->load_selection, 'subform', 'load'), 'guid'); // add property_selection $this->setData('class_property', $this->getValues($item->property_selection, 'subform', 'property'), 'id'); // add class_method @@ -1119,6 +1141,23 @@ class ComponentbuilderModelJoomla_components extends JModelList } } + /** + * Method to check if array has only numiric values + * + * @return bool + **/ + protected function is_numeric($array) + { + foreach ($array as $value) + { + if (!is_numeric($value)) + { + return false; + } + } + return true; + } + /** * Method to do the smart cloning * @@ -1202,8 +1241,21 @@ class ComponentbuilderModelJoomla_components extends JModelList { // lock the data $this->key = md5(implode('', $this->key)); - $locker = new FOFEncryptAes($this->key, 128); - $data = $locker->encryptString($data); + // April 20, 2022 we moved away from FOF for good... sorry that it took this long + // $locker = new FOFEncryptAes($this->key, 128); + // $data = $locker->encryptString($data); + // load phpseclib + if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael) + { + // set the password + ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($this->key, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt'); + // lock the data + $data = base64_encode(ComponentbuilderHelper::crypt('AES', 'CBC')->encrypt($data)); + } + else + { + return false; + } // Set the key owner information $this->info['getKeyFrom'] = array(); $this->info['getKeyFrom']['company'] = $this->info['source']['company']; @@ -1227,12 +1279,16 @@ class ComponentbuilderModelJoomla_components extends JModelList // if we have multi links add them also // we started adding this at v2.7.7 $this->info['key'] = true; + // we started adding this at v3.0.11 and v2.12.17 + $this->info['phpseclib'] = true; } else { // we started adding this at v2.7.7 $this->info['key'] = false; - // Set the owner information + // we started adding this at v3.0.11 and v2.12.17 + $this->info['phpseclib'] = false; + // base 64 encode the data $data = base64_encode($data); } // set the path @@ -1243,15 +1299,26 @@ class ComponentbuilderModelJoomla_components extends JModelList return false; } // set info data - $db = 'COM_COMPONENTBUILDER_SZDEQZDMVSMHBTRWFIFTYTSQFLVVXJTMTHREEJTWOIXM'; - $locker = new FOFEncryptAes(base64_decode(JText::sprintf($db, 'VjR', 'WV0aE9k')), 128); - $info = $locker->encryptString(json_encode($this->info)); - // set the path - $infoPath = $this->packagePath . '/info.vdm'; - // write the db data to file in package - if (!ComponentbuilderHelper::writeFile($infoPath, wordwrap($info, 128, "\n", true))) + if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael) { - return false; + // set system password + $db = 'COM_COMPONENTBUILDER_SZDEQZDMVSMHBTRWFIFTYTSQFLVVXJTMTHREEJTWOIXM'; + $password = base64_decode(JText::sprintf($db, 'VjR', 'WV0aE9k')); + // set the password + ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($password, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt'); + // lock the data + $info = base64_encode(ComponentbuilderHelper::crypt('AES', 'CBC')->encrypt(json_encode($this->info))); + // set the path + $infoPath = $this->packagePath . '/info.vdm'; + // write the info data to file in package + if (!ComponentbuilderHelper::writeFile($infoPath, wordwrap($info, 128, "\n", true))) + { + return false; + } + } + else + { + return false; } // lock all files $this->lockFiles(); @@ -1296,7 +1363,8 @@ class ComponentbuilderModelJoomla_components extends JModelList // lock the data if set if (ComponentbuilderHelper::checkString($this->key) && strlen($this->key) == 32) { - $locker = new FOFEncryptAes($this->key, 128); + // set secure password + ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($this->key, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt'); // we must first store the current working directory $joomla = getcwd(); // to avoid that it encrypt the db and info file again we must move per/folder @@ -1309,7 +1377,7 @@ class ComponentbuilderModelJoomla_components extends JModelList // go to the package sub folder if found if (JFolder::exists($subPath)) { - $this->lock($subPath, $locker); + $this->lock($subPath); } } // change back to working dir @@ -1322,7 +1390,7 @@ class ComponentbuilderModelJoomla_components extends JModelList * * @return void */ - protected function lock(&$tmpPath, &$locker) + protected function lock(&$tmpPath) { // we are changing the working directory to the tmp path (important) chdir($tmpPath); @@ -1332,7 +1400,7 @@ class ComponentbuilderModelJoomla_components extends JModelList foreach ($files as $file) { // write the encrypted string back to file - if (!ComponentbuilderHelper::writeFile($file, wordwrap($locker->encryptString(file_get_contents($file)), 128, "\n", true))) + if (!ComponentbuilderHelper::writeFile($file, wordwrap(base64_encode(ComponentbuilderHelper::crypt('AES', 'CBC')->encrypt(file_get_contents($file))), 128, "\n", true))) { // we should add error handler here in case file could not be locked } @@ -2141,7 +2209,7 @@ class ComponentbuilderModelJoomla_components extends JModelList 'name' => 'name' ), // #__componentbuilder_power (v) - 'class_method' => array( + 'power' => array( 'search' => array('id', 'system_name', 'name', 'description', 'head', 'namespace', 'main_class_code'), 'views' => 'powers', 'not_base64' => array('description'), @@ -2576,31 +2644,31 @@ class ComponentbuilderModelJoomla_components extends JModelList continue; } + // decode php_helper_both + $item->php_helper_both = base64_decode($item->php_helper_both); + // decode php_method_uninstall + $item->php_method_uninstall = base64_decode($item->php_method_uninstall); + // decode php_preflight_install + $item->php_preflight_install = base64_decode($item->php_preflight_install); + // decode css_admin + $item->css_admin = base64_decode($item->css_admin); // decode php_admin_event $item->php_admin_event = base64_decode($item->php_admin_event); // decode php_site_event $item->php_site_event = base64_decode($item->php_site_event); - // decode php_helper_both - $item->php_helper_both = base64_decode($item->php_helper_both); - // decode php_preflight_install - $item->php_preflight_install = base64_decode($item->php_preflight_install); - // decode php_method_uninstall - $item->php_method_uninstall = base64_decode($item->php_method_uninstall); - // decode css_admin - $item->css_admin = base64_decode($item->css_admin); // decode php_postflight_install $item->php_postflight_install = base64_decode($item->php_postflight_install); // decode sql_uninstall $item->sql_uninstall = base64_decode($item->sql_uninstall); // decode php_helper_admin $item->php_helper_admin = base64_decode($item->php_helper_admin); - // decode php_helper_site - $item->php_helper_site = base64_decode($item->php_helper_site); if ($basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true))) { // decrypt whmcs_key $item->whmcs_key = $basic->decryptString($item->whmcs_key); } + // decode php_helper_site + $item->php_helper_site = base64_decode($item->php_helper_site); // decode javascript $item->javascript = base64_decode($item->javascript); // decode css_site diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 63c961843..ad8fe0035 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -17,6 +17,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` ( `add_php_preflight_install` TINYINT(1) NOT NULL DEFAULT 0, `add_php_preflight_update` TINYINT(1) NOT NULL DEFAULT 0, `add_placeholders` TINYINT(1) NOT NULL DEFAULT 0, + `add_powers` TINYINT(1) NOT NULL DEFAULT 1, `add_sales_server` TINYINT(1) NOT NULL DEFAULT 0, `add_site_event` TINYINT(1) NOT NULL DEFAULT 0, `add_sql` TINYINT(1) NOT NULL DEFAULT 0, @@ -104,15 +105,16 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` ( PRIMARY KEY (`id`), KEY `idx_system_name` (`system_name`), KEY `idx_name_code` (`name_code`), - KEY `idx_debug_linenr` (`debug_linenr`), KEY `idx_mvc_versiondate` (`mvc_versiondate`), KEY `idx_remove_line_breaks` (`remove_line_breaks`), KEY `idx_add_placeholders` (`add_placeholders`), + KEY `idx_debug_linenr` (`debug_linenr`), KEY `idx_add_license` (`add_license`), - KEY `idx_add_email_helper` (`add_email_helper`), KEY `idx_license_type` (`license_type`), + KEY `idx_add_email_helper` (`add_email_helper`), KEY `idx_addreadme` (`addreadme`), KEY `idx_add_sales_server` (`add_sales_server`), + KEY `idx_add_powers` (`add_powers`), KEY `idx_translation_tool` (`translation_tool`), KEY `idx_add_php_helper_both` (`add_php_helper_both`), KEY `idx_add_php_helper_admin` (`add_php_helper_admin`), diff --git a/admin/sql/updates/mysql/2.12.16.sql b/admin/sql/updates/mysql/2.12.16.sql new file mode 100644 index 000000000..d8c537d5c --- /dev/null +++ b/admin/sql/updates/mysql/2.12.16.sql @@ -0,0 +1 @@ +ALTER TABLE `#__componentbuilder_joomla_component` ADD `add_powers` TINYINT(1) NOT NULL DEFAULT 1 AFTER `add_placeholders`; diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index 207134b80..ec76ff35c 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -173,6 +173,20 @@ class ComponentbuilderViewCompiler extends JViewLegacy '0' => 'COM_COMPONENTBUILDER_NO'); // add to form $form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options); + // powers attributes + $attributes = array( + 'type' => 'radio', + 'name' => 'powers', + 'label' => 'COM_COMPONENTBUILDER_ADD_POWERS', + 'class' => 'btn-group btn-group-yesno', + 'description' => 'COM_COMPONENTBUILDER_SHOULD_JCB_ADD_ANY_POWERS_THAT_ARE_CONNECTED_TO_THIS_COMPONENT_THIS_MAY_BE_HELPFUL_IF_YOU_ARE_LOADING_POWERS_VIA_ANOTHER_COMPONENT_AND_WOULD_LIKE_TO_AVOID_ADDING_IT_TO_BOTH_JUST_REMEMBER_THAT_IN_THIS_CASE_YOU_NEED_TO_LOAD_THE_POWERS_VIA_A_PLUGIN', + 'default' => '2'); + $options = array( + '2' => 'COM_COMPONENTBUILDER_GLOBAL', + '1' => 'COM_COMPONENTBUILDER_YES', + '0' => 'COM_COMPONENTBUILDER_NO'); + // add to form + $form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options); // component attributes $attributes = array( 'type' => 'list', diff --git a/admin/views/custom_admin_views/tmpl/default_body.php b/admin/views/custom_admin_views/tmpl/default_body.php index 50eb2736a..1b300f56c 100644 --- a/admin/views/custom_admin_views/tmpl/default_body.php +++ b/admin/views/custom_admin_views/tmpl/default_body.php @@ -94,8 +94,8 @@ $edit = "index.php?option=com_componentbuilder&view=custom_admin_views&task=cust
- user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->main_get)): ?> - escape($item->main_get_name); ?> + user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int) $item->main_get)): ?> + escape($item->main_get_name); ?> escape($item->main_get_name); ?> diff --git a/admin/views/fields/tmpl/default_body.php b/admin/views/fields/tmpl/default_body.php index c5a03e752..4faa80c03 100644 --- a/admin/views/fields/tmpl/default_body.php +++ b/admin/views/fields/tmpl/default_body.php @@ -72,8 +72,8 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";
- user->authorise('fieldtype.edit', 'com_componentbuilder.fieldtype.' . (int)$item->fieldtype)): ?> - escape($item->fieldtype_name); ?> + user->authorise('fieldtype.edit', 'com_componentbuilder.fieldtype.' . (int) $item->fieldtype)): ?> + escape($item->fieldtype_name); ?> escape($item->fieldtype_name); ?> diff --git a/admin/views/joomla_plugin_groups/tmpl/default_body.php b/admin/views/joomla_plugin_groups/tmpl/default_body.php index 6e1741a1e..fc99cdf5f 100644 --- a/admin/views/joomla_plugin_groups/tmpl/default_body.php +++ b/admin/views/joomla_plugin_groups/tmpl/default_body.php @@ -72,8 +72,8 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_plugin_groups&task=jo
- user->authorise('class_extends.edit', 'com_componentbuilder.class_extends.' . (int)$item->class_extends)): ?> - escape($item->class_extends_name); ?> + user->authorise('class_extends.edit', 'com_componentbuilder.class_extends.' . (int) $item->class_extends)): ?> + escape($item->class_extends_name); ?> escape($item->class_extends_name); ?> diff --git a/admin/views/joomla_plugins/tmpl/default_body.php b/admin/views/joomla_plugins/tmpl/default_body.php index 0e31249f4..2494e993e 100644 --- a/admin/views/joomla_plugins/tmpl/default_body.php +++ b/admin/views/joomla_plugins/tmpl/default_body.php @@ -101,8 +101,8 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_plugins&task=joomla_p
- user->authorise('class_extends.edit', 'com_componentbuilder.class_extends.' . (int)$item->class_extends)): ?> - escape($item->class_extends_name); ?> + user->authorise('class_extends.edit', 'com_componentbuilder.class_extends.' . (int) $item->class_extends)): ?> + escape($item->class_extends_name); ?> escape($item->class_extends_name); ?> @@ -110,8 +110,8 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_plugins&task=joomla_p
- user->authorise('core.edit', 'com_componentbuilder.joomla_plugin_group.' . (int)$item->joomla_plugin_group)): ?> - escape($item->joomla_plugin_group_name); ?> + user->authorise('core.edit', 'com_componentbuilder.joomla_plugin_group.' . (int) $item->joomla_plugin_group)): ?> + escape($item->joomla_plugin_group_name); ?> escape($item->joomla_plugin_group_name); ?> diff --git a/admin/views/layouts/tmpl/default_body.php b/admin/views/layouts/tmpl/default_body.php index 84f61dcfa..a5b72628a 100644 --- a/admin/views/layouts/tmpl/default_body.php +++ b/admin/views/layouts/tmpl/default_body.php @@ -82,8 +82,8 @@ $edit = "index.php?option=com_componentbuilder&view=layouts&task=layout.edit";
- user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->dynamic_get)): ?> - escape($item->dynamic_get_name); ?> + user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int) $item->dynamic_get)): ?> + escape($item->dynamic_get_name); ?> escape($item->dynamic_get_name); ?> diff --git a/admin/views/site_views/tmpl/default_body.php b/admin/views/site_views/tmpl/default_body.php index b5163cd9d..6ca0775e5 100644 --- a/admin/views/site_views/tmpl/default_body.php +++ b/admin/views/site_views/tmpl/default_body.php @@ -94,8 +94,8 @@ $edit = "index.php?option=com_componentbuilder&view=site_views&task=site_view.ed
- user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->main_get)): ?> - escape($item->main_get_name); ?> + user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int) $item->main_get)): ?> + escape($item->main_get_name); ?> escape($item->main_get_name); ?> diff --git a/admin/views/snippets/tmpl/default_body.php b/admin/views/snippets/tmpl/default_body.php index 714ef76cb..d813f0b2c 100644 --- a/admin/views/snippets/tmpl/default_body.php +++ b/admin/views/snippets/tmpl/default_body.php @@ -81,8 +81,8 @@ $edit = "index.php?option=com_componentbuilder&view=snippets&task=snippet.edit";
- user->authorise('library.edit', 'com_componentbuilder.library.' . (int)$item->library)): ?> - escape($item->library_name); ?> + user->authorise('library.edit', 'com_componentbuilder.library.' . (int) $item->library)): ?> + escape($item->library_name); ?> escape($item->library_name); ?> diff --git a/admin/views/templates/tmpl/default_body.php b/admin/views/templates/tmpl/default_body.php index 4dbfd834b..4ee1dd520 100644 --- a/admin/views/templates/tmpl/default_body.php +++ b/admin/views/templates/tmpl/default_body.php @@ -82,8 +82,8 @@ $edit = "index.php?option=com_componentbuilder&view=templates&task=template.edit
- user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->dynamic_get)): ?> - escape($item->dynamic_get_name); ?> + user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int) $item->dynamic_get)): ?> + escape($item->dynamic_get_name); ?> escape($item->dynamic_get_name); ?> diff --git a/componentbuilder.xml b/componentbuilder.xml index e23928999..9d3c317d3 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 4th April, 2022 + 9th May, 2022 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 2.12.16 + 2.12.17 Component Builder (v.2.12.16) +

Component Builder (v.2.12.17)

The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index 1aec446ae..22c7acc0c 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -1053,4 +1053,21 @@ http://www.joomlacomponentbuilder.com + + Component Builder + Builds Complex Joomla Components + com_componentbuilder + component + 2.12.17 + http://www.joomlacomponentbuilder.com + + https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.12.17/JCB_v2.12.17.zip + + + stable + + Llewellyn van der Merwe + http://www.joomlacomponentbuilder.com + + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php index afa3bb290..345febe17 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php @@ -283,9 +283,9 @@ abstract class FileHelper // Get basic key $basickey = 'Th!s_iS_n0t_sAfe_buT_b3tter_then_n0thiug'; - if (method_exists('ComponentbuilderHelper', "getCryptKey")) + if (method_exists('\ComponentbuilderHelper', "getCryptKey")) { - $basickey = ComponentbuilderHelper::getCryptKey('basic', $basickey); + $basickey = \ComponentbuilderHelper::getCryptKey('basic', $basickey); } // check the key diff --git a/script.php b/script.php index 0dbd6ab6a..dba6ab715 100644 --- a/script.php +++ b/script.php @@ -6028,9 +6028,9 @@ class com_componentbuilderInstallerScript $joomla_component->type_title = 'Componentbuilder Joomla_component'; $joomla_component->type_alias = 'com_componentbuilder.joomla_component'; $joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_admin_event","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","php_admin_event":"php_admin_event","php_site_event":"php_site_event","php_helper_both":"php_helper_both","debug_linenr":"debug_linenr","php_preflight_install":"php_preflight_install","php_method_uninstall":"php_method_uninstall","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","description":"description","php_postflight_install":"php_postflight_install","author":"author","sql_uninstall":"sql_uninstall","email":"email","website":"website","add_license":"add_license","add_email_helper":"add_email_helper","license_type":"license_type","php_helper_admin":"php_helper_admin","php_helper_site":"php_helper_site","whmcs_key":"whmcs_key","javascript":"javascript","whmcs_url":"whmcs_url","css_site":"css_site","whmcs_buy_link":"whmcs_buy_link","license":"license","php_preflight_update":"php_preflight_update","bom":"bom","php_postflight_update":"php_postflight_update","image":"image","sql":"sql","copyright":"copyright","addreadme":"addreadme","add_sales_server":"add_sales_server","update_server_url":"update_server_url","crowdin_project_identifier":"crowdin_project_identifier","component_version":"component_version","translation_tool":"translation_tool","crowdin_username":"crowdin_username","buildcompsql":"buildcompsql","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_javascript":"add_javascript","add_menu_prefix":"add_menu_prefix","add_css_admin":"add_css_admin","menu_prefix":"menu_prefix","add_css_site":"add_css_site","dashboard_type":"dashboard_type","dashboard":"dashboard","toignore":"toignore","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","add_php_postflight_install":"add_php_postflight_install","export_key":"export_key","add_php_postflight_update":"add_php_postflight_update","joomla_source_link":"joomla_source_link","add_php_method_uninstall":"add_php_method_uninstall","export_buy_link":"export_buy_link","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","assets_table_fix":"assets_table_fix","readme":"readme","emptycontributors":"emptycontributors","add_update_server":"add_update_server","number":"number","update_server_target":"update_server_target","update_server":"update_server","sales_server":"sales_server","crowdin_project_api_key":"crowdin_project_api_key","crowdin_account_api_key":"crowdin_account_api_key","creatuserhelper":"creatuserhelper","buildcomp":"buildcomp","adduikit":"adduikit","guid":"guid","addfootable":"addfootable","name":"name"}}'; + $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_helper_both","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","php_helper_both":"php_helper_both","crowdin_project_identifier":"crowdin_project_identifier","php_method_uninstall":"php_method_uninstall","php_preflight_install":"php_preflight_install","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","php_admin_event":"php_admin_event","php_site_event":"php_site_event","description":"description","author":"author","php_postflight_install":"php_postflight_install","email":"email","sql_uninstall":"sql_uninstall","website":"website","debug_linenr":"debug_linenr","add_license":"add_license","license_type":"license_type","add_email_helper":"add_email_helper","php_helper_admin":"php_helper_admin","whmcs_key":"whmcs_key","php_helper_site":"php_helper_site","whmcs_url":"whmcs_url","javascript":"javascript","whmcs_buy_link":"whmcs_buy_link","css_site":"css_site","license":"license","bom":"bom","php_preflight_update":"php_preflight_update","image":"image","php_postflight_update":"php_postflight_update","copyright":"copyright","sql":"sql","addreadme":"addreadme","add_sales_server":"add_sales_server","update_server_url":"update_server_url","component_version":"component_version","add_powers":"add_powers","translation_tool":"translation_tool","crowdin_username":"crowdin_username","buildcompsql":"buildcompsql","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_javascript":"add_javascript","add_menu_prefix":"add_menu_prefix","add_css_admin":"add_css_admin","menu_prefix":"menu_prefix","add_css_site":"add_css_site","dashboard_type":"dashboard_type","dashboard":"dashboard","toignore":"toignore","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","add_php_postflight_install":"add_php_postflight_install","export_key":"export_key","add_php_postflight_update":"add_php_postflight_update","joomla_source_link":"joomla_source_link","add_php_method_uninstall":"add_php_method_uninstall","export_buy_link":"export_buy_link","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","assets_table_fix":"assets_table_fix","readme":"readme","emptycontributors":"emptycontributors","add_update_server":"add_update_server","number":"number","update_server_target":"update_server_target","update_server":"update_server","sales_server":"sales_server","crowdin_project_api_key":"crowdin_project_api_key","crowdin_account_api_key":"crowdin_account_api_key","creatuserhelper":"creatuserhelper","buildcomp":"buildcomp","adduikit":"adduikit","guid":"guid","addfootable":"addfootable","name":"name"}}'; $joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute'; - $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","debug_linenr","mvc_versiondate","remove_line_breaks","add_placeholders","add_license","add_email_helper","license_type","addreadme","add_sales_server","translation_tool","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","emptycontributors","add_update_server","number","update_server_target","update_server","sales_server","creatuserhelper","buildcomp","adduikit","addfootable"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","mvc_versiondate","remove_line_breaks","add_placeholders","debug_linenr","add_license","license_type","add_email_helper","addreadme","add_sales_server","add_powers","translation_tool","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","emptycontributors","add_update_server","number","update_server_target","update_server","sales_server","creatuserhelper","buildcomp","adduikit","addfootable"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $joomla_component_Inserted = $db->insertObject('#__content_types', $joomla_component); @@ -6616,7 +6616,7 @@ class com_componentbuilderInstallerScript $query = $db->getQuery(true); // Field to update. $fields = array( - $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","builder_gif_size":"480-272","add_menu_prefix":"1","menu_prefix":"»","minify":"0","language":"en-GB","percentagelanguageadd":"30","assets_table_fix":"2","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","import_guid_only":"1","export_language_strings":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'), + $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","subform_layouts":"default","editor":"none","github_access_token":"secret","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","builder_gif_size":"480-272","add_menu_prefix":"1","menu_prefix":"»","minify":"0","language":"en-GB","percentagelanguageadd":"30","assets_table_fix":"2","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","import_guid_only":"1","export_language_strings":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'), ); // Condition. $conditions = array( @@ -7469,9 +7469,9 @@ class com_componentbuilderInstallerScript $joomla_component->type_title = 'Componentbuilder Joomla_component'; $joomla_component->type_alias = 'com_componentbuilder.joomla_component'; $joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_admin_event","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","php_admin_event":"php_admin_event","php_site_event":"php_site_event","php_helper_both":"php_helper_both","debug_linenr":"debug_linenr","php_preflight_install":"php_preflight_install","php_method_uninstall":"php_method_uninstall","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","description":"description","php_postflight_install":"php_postflight_install","author":"author","sql_uninstall":"sql_uninstall","email":"email","website":"website","add_license":"add_license","add_email_helper":"add_email_helper","license_type":"license_type","php_helper_admin":"php_helper_admin","php_helper_site":"php_helper_site","whmcs_key":"whmcs_key","javascript":"javascript","whmcs_url":"whmcs_url","css_site":"css_site","whmcs_buy_link":"whmcs_buy_link","license":"license","php_preflight_update":"php_preflight_update","bom":"bom","php_postflight_update":"php_postflight_update","image":"image","sql":"sql","copyright":"copyright","addreadme":"addreadme","add_sales_server":"add_sales_server","update_server_url":"update_server_url","crowdin_project_identifier":"crowdin_project_identifier","component_version":"component_version","translation_tool":"translation_tool","crowdin_username":"crowdin_username","buildcompsql":"buildcompsql","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_javascript":"add_javascript","add_menu_prefix":"add_menu_prefix","add_css_admin":"add_css_admin","menu_prefix":"menu_prefix","add_css_site":"add_css_site","dashboard_type":"dashboard_type","dashboard":"dashboard","toignore":"toignore","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","add_php_postflight_install":"add_php_postflight_install","export_key":"export_key","add_php_postflight_update":"add_php_postflight_update","joomla_source_link":"joomla_source_link","add_php_method_uninstall":"add_php_method_uninstall","export_buy_link":"export_buy_link","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","assets_table_fix":"assets_table_fix","readme":"readme","emptycontributors":"emptycontributors","add_update_server":"add_update_server","number":"number","update_server_target":"update_server_target","update_server":"update_server","sales_server":"sales_server","crowdin_project_api_key":"crowdin_project_api_key","crowdin_account_api_key":"crowdin_account_api_key","creatuserhelper":"creatuserhelper","buildcomp":"buildcomp","adduikit":"adduikit","guid":"guid","addfootable":"addfootable","name":"name"}}'; + $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_helper_both","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","php_helper_both":"php_helper_both","crowdin_project_identifier":"crowdin_project_identifier","php_method_uninstall":"php_method_uninstall","php_preflight_install":"php_preflight_install","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","php_admin_event":"php_admin_event","php_site_event":"php_site_event","description":"description","author":"author","php_postflight_install":"php_postflight_install","email":"email","sql_uninstall":"sql_uninstall","website":"website","debug_linenr":"debug_linenr","add_license":"add_license","license_type":"license_type","add_email_helper":"add_email_helper","php_helper_admin":"php_helper_admin","whmcs_key":"whmcs_key","php_helper_site":"php_helper_site","whmcs_url":"whmcs_url","javascript":"javascript","whmcs_buy_link":"whmcs_buy_link","css_site":"css_site","license":"license","bom":"bom","php_preflight_update":"php_preflight_update","image":"image","php_postflight_update":"php_postflight_update","copyright":"copyright","sql":"sql","addreadme":"addreadme","add_sales_server":"add_sales_server","update_server_url":"update_server_url","component_version":"component_version","add_powers":"add_powers","translation_tool":"translation_tool","crowdin_username":"crowdin_username","buildcompsql":"buildcompsql","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_javascript":"add_javascript","add_menu_prefix":"add_menu_prefix","add_css_admin":"add_css_admin","menu_prefix":"menu_prefix","add_css_site":"add_css_site","dashboard_type":"dashboard_type","dashboard":"dashboard","toignore":"toignore","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","add_php_postflight_install":"add_php_postflight_install","export_key":"export_key","add_php_postflight_update":"add_php_postflight_update","joomla_source_link":"joomla_source_link","add_php_method_uninstall":"add_php_method_uninstall","export_buy_link":"export_buy_link","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","assets_table_fix":"assets_table_fix","readme":"readme","emptycontributors":"emptycontributors","add_update_server":"add_update_server","number":"number","update_server_target":"update_server_target","update_server":"update_server","sales_server":"sales_server","crowdin_project_api_key":"crowdin_project_api_key","crowdin_account_api_key":"crowdin_account_api_key","creatuserhelper":"creatuserhelper","buildcomp":"buildcomp","adduikit":"adduikit","guid":"guid","addfootable":"addfootable","name":"name"}}'; $joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute'; - $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","debug_linenr","mvc_versiondate","remove_line_breaks","add_placeholders","add_license","add_email_helper","license_type","addreadme","add_sales_server","translation_tool","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","emptycontributors","add_update_server","number","update_server_target","update_server","sales_server","creatuserhelper","buildcomp","adduikit","addfootable"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","mvc_versiondate","remove_line_breaks","add_placeholders","debug_linenr","add_license","license_type","add_email_helper","addreadme","add_sales_server","add_powers","translation_tool","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","emptycontributors","add_update_server","number","update_server_target","update_server","sales_server","creatuserhelper","buildcomp","adduikit","addfootable"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; // Check if joomla_component type is already in content_type DB. $joomla_component_id = null; @@ -9254,7 +9254,7 @@ class com_componentbuilderInstallerScript echo ' -

Upgrade to Version 2.12.16 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 2.12.17 Was Successful! Let us know if anything is not working as expected.

'; // Set db if not set already. if (!isset($db))