Stable release of v3.1.19

We fixed #972 so that custom code (in the header) will be added after the power namespaces. We added a message to show when a server move failed. We fixed the BaseConfig to not use '_' as separator. We fixed the footable loading issue. We removed the need for passing placeholders by reference. We added the option to generate a CHANGELOG. We fixed the server class to load new client if server details changed. We fixed the readme placeholder issue #978. We fixed the empty server url issue #978. Fixed Package import to now use the phplibsec version 3.
This commit is contained in:
Robot 2023-02-27 14:27:41 +02:00
parent 339aec221e
commit 737bd03e46
Signed by untrusted user: Robot
GPG Key ID: 14DECD44E7E1BB95
55 changed files with 1900 additions and 1048 deletions

12
CHANGELOG.md Normal file
View File

@ -0,0 +1,12 @@
# v3.1.19
- We fixed #972 so that custom code (in the header) will be added after the power namespaces
- We added a message to show when a server move failed
- We fixed the BaseConfig to not use '_' as separator
- We fixed the footable loading issue
- We removed the need for passing placeholders by reference
- We added the option to generate a CHANGELOG
- We fixed the server class to load new client if server details changed.
- We fixed the readme placeholder issue #978.
- We fixed the empty server url issue #978.
- Fixed Package import to now use the phplibsec version 3

View File

@ -9,7 +9,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 [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.17) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.19) 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)
@ -99,18 +99,22 @@ To install these packages [watch this tutorial](https://vdm.bz/how-to-install-jc
Where can you get support and help?
====================
+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE)
+ [German Basic Introduction](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7)
+ [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
+ [The JCB! Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki)
+ [Forum](https://vdm.bz/jcb-forum)
+ [Report a Security Issue](https://www.joomlacomponentbuilder.com/report-security-issues)
+ [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint)
+ [Open Issue On Gitea](https://git.vdm.dev/joomla/Component-Builder/issues) ^^
Since [JCB](https://www.joomlacomponentbuilder.com) has [become a community](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
We have started a [**JCB forum**](https://vdm.bz/jcb-forum) where you can post questions, about how things work, or if you need some kind of help in relation to your development of your components.
- [Package](https://git.vdm.dev/joomla/pkg-component-builder).
- [Download](https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip).
- [Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE).
- [German](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7).
- [Hello World](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45).
- [Discussions](https://github.com/vdm-io/Joomla-Component-Builder/discussions).
- [Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki).
- [Issues](https://git.vdm.dev/joomla/Component-Builder/issues).
- [Issues Stream](https://t.me/jcb_issues). ^^
- [Updates](https://t.me/jcb_updates).
- [User Group](https://t.me/jcb_group).
- [Announcement](https://t.me/Joomla_component_builder).
- [Beta](https://git.vdm.dev/joomla-beta/pkg-component-builder).
- [Nightly Build](https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip).
- [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint).
- [Security](https://www.vdm.io/report-security-issues).
^^ Then if you run into any issues, related to the [JCB](https://git.vdm.dev/joomla/Component-Builder/issues) code, like bugs, **start by searching** the (*open & closed*) issues over on [Gitea](https://git.vdm.dev/joomla/Component-Builder/issues), and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md).
@ -140,14 +144,14 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 12th February, 2023
+ *Version*: 3.1.17
+ *Last Build*: 27th February, 2023
+ *Version*: 3.1.19
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **364590**
+ *Field count*: **2009**
+ *File count*: **2325**
+ *Folder count*: **409**
+ *Line count*: **366135**
+ *Field count*: **2021**
+ *File count*: **2339**
+ *Folder count*: **411**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -9,7 +9,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 [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.17) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.19) 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)
@ -99,18 +99,22 @@ To install these packages [watch this tutorial](https://vdm.bz/how-to-install-jc
Where can you get support and help?
====================
+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE)
+ [German Basic Introduction](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7)
+ [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
+ [The JCB! Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki)
+ [Forum](https://vdm.bz/jcb-forum)
+ [Report a Security Issue](https://www.joomlacomponentbuilder.com/report-security-issues)
+ [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint)
+ [Open Issue On Gitea](https://git.vdm.dev/joomla/Component-Builder/issues) ^^
Since [JCB](https://www.joomlacomponentbuilder.com) has [become a community](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
We have started a [**JCB forum**](https://vdm.bz/jcb-forum) where you can post questions, about how things work, or if you need some kind of help in relation to your development of your components.
- [Package](https://git.vdm.dev/joomla/pkg-component-builder).
- [Download](https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip).
- [Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE).
- [German](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7).
- [Hello World](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45).
- [Discussions](https://github.com/vdm-io/Joomla-Component-Builder/discussions).
- [Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki).
- [Issues](https://git.vdm.dev/joomla/Component-Builder/issues).
- [Issues Stream](https://t.me/jcb_issues). ^^
- [Updates](https://t.me/jcb_updates).
- [User Group](https://t.me/jcb_group).
- [Announcement](https://t.me/Joomla_component_builder).
- [Beta](https://git.vdm.dev/joomla-beta/pkg-component-builder).
- [Nightly Build](https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip).
- [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint).
- [Security](https://www.vdm.io/report-security-issues).
^^ Then if you run into any issues, related to the [JCB](https://git.vdm.dev/joomla/Component-Builder/issues) code, like bugs, **start by searching** the (*open & closed*) issues over on [Gitea](https://git.vdm.dev/joomla/Component-Builder/issues), and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md).
@ -140,14 +144,14 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 12th February, 2023
+ *Version*: 3.1.17
+ *Last Build*: 27th February, 2023
+ *Version*: 3.1.19
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **364590**
+ *Field count*: **2009**
+ *File count*: **2325**
+ *Folder count*: **409**
+ *Line count*: **366135**
+ *Field count*: **2021**
+ *File count*: **2339**
+ *Folder count*: **411**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -17,8 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Utilities\ArrayHelper;
###IMPORT_CONTROLLER_HEADER###
/**
* ###Component### Import Base Controller

View File

@ -17,8 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Utilities\ArrayHelper;
###IMPORT_CUSTOM_CONTROLLER_HEADER###
/**
* ###Component### ###View### Base Controller

View File

@ -17,13 +17,9 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
###IMPORT_MODEL_HEADER###
/**
/***
* ###Component### Import Base Database Model
*/
class ###Component###ModelImport extends BaseDatabaseModel

View File

@ -17,11 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
###IMPORT_CUSTOM_MODEL_HEADER###
/**
* ###Component### ###View### Base Database Model

View File

@ -0,0 +1 @@
###CHANGELOG###

View File

@ -207,6 +207,12 @@
"rename": false,
"type": "file"
},
"CHANGELOG.md": {
"naam": "CHANGELOG.md",
"path": "c0mp0n3nt/",
"rename": false,
"type": "file"
},
"headercheck.php": {
"naam": "headercheck.php",
"path": "c0mp0n3nt/site/helpers",

View File

@ -207,6 +207,12 @@
"rename": false,
"type": "file"
},
"CHANGELOG.md": {
"naam": "CHANGELOG.md",
"path": "c0mp0n3nt/",
"rename": false,
"type": "file"
},
"headercheck.php": {
"naam": "headercheck.php",
"path": "c0mp0n3nt/site/helpers",

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
/**
* Componentbuilder Import_joomla_components Base Controller

View File

@ -14,6 +14,10 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Utilities\ArrayHelper as JCBArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use Joomla\CMS\Language\Text;
/**
* Joomla_components Admin Controller
@ -198,12 +202,12 @@ class ComponentbuilderControllerJoomla_components extends AdminController
$session->set('backto_VDM_IMPORT', 'joomla_components');
$session->set('dataType_VDM_IMPORTINTO', 'smart_package');
// Redirect to import view.
$message = JText::_('COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL');
$message = Text::_('COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components&target=smartPackage', false), $message);
return;
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP');
$message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
@ -211,7 +215,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
public function smartExport()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
JSession::checkToken() or die(Text::_('JINVALID_TOKEN'));
// Get the model
$model = $this->getModel('Joomla_components');
// check if export is allowed for this user.
@ -224,10 +228,10 @@ class ComponentbuilderControllerJoomla_components extends AdminController
// Sanitize the input
JArrayHelper::toInteger($pks);
// check if there is any selections
if (!ComponentbuilderHelper::checkArray($pks))
if (!JCBArrayHelper::check($pks))
{
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_NO_COMPONENTS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN');
$message = Text::_('COM_COMPONENTBUILDER_NO_COMPONENTS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
@ -237,43 +241,44 @@ class ComponentbuilderControllerJoomla_components extends AdminController
if ($model->getSmartExport($pks))
{
// set the key string
if (componentbuilderHelper::checkString($model->key) && strlen($model->key) == 32)
if (StringHelper::check($model->key) && strlen($model->key) == 32)
{
$keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
$keyNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '</h1>';
$keyNotice = '<h1>' . Text::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
$keyNotice .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '</p>';
// set the package owner info
if (componentbuilderHelper::getPackageOwnerValue('owner', $model->info) || componentbuilderHelper::getPackageOwnerValue('company', $model->info))
if (PackageFactory::_('Display.Details')->hasOwner($model->info))
{
$ownerDetails = componentbuilderHelper::getPackageOwnerDetailsDisplay($model->info, true);
$ownerDetails = PackageFactory::_('Display.Details')->owner($model->info, true);
}
else
{
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '</h2>';
$ownerDetails .= '<p>' . JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '</p>';
$ownerDetails .= '<h3>' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '</h3>';
$ownerDetails .= '<p>' . JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '</p>';
$ownerDetails = '<h2>' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '</h2>';
$ownerDetails .= '<p>' . Text::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '</p>';
$ownerDetails .= '<h3>' . Text::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '</h3>';
$ownerDetails .= '<p>' . Text::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '</p>';
}
}
else
{
$keyNotice = '<h1>' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '</h1>';
$ownerDetails = '<p>' . JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '</p>';
$keyNotice = '<h1>' . Text::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '</h1>';
$ownerDetails = '<p>' . Text::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '</p>';
}
// Redirect to the list screen with success.
$message = array();
$message[] = '<h1>' . JText::_('COM_COMPONENTBUILDER_EXPORT_COMPLETED') . '</h1>';
$message[] = '<h1>' . Text::_('COM_COMPONENTBUILDER_EXPORT_COMPLETED') . '</h1>';
$message[] = '<p>' . JText::sprintf('COM_COMPONENTBUILDER_PATH_TO_THE_ZIPPED_PACKAGE_IS_CODESCODE_BR_S_S', $model->zipPath, $keyNotice, $ownerDetails) . '</p>';
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode('', $message), 'Success');
return;
}
else
{
if (componentbuilderHelper::checkString($model->packagePath))
if (StringHelper::check($model->packagePath))
{
// clear all if not successful
ComponentbuilderHelper::removeFolder($model->packagePath);
}
if (componentbuilderHelper::checkString($model->zipPath))
if (StringHelper::check($model->zipPath))
{
// clear all if not successful
JFile::delete($model->zipPath);
@ -281,7 +286,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
}
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED_PLEASE_TRY_AGAIN_LATTER');
$message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED_PLEASE_TRY_AGAIN_LATTER');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
@ -318,8 +323,8 @@ class ComponentbuilderControllerJoomla_components extends AdminController
{
$textNotice = array();
$keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
$keyNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '</p>';
$textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $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_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') . '<br />';
// set the package owner info
if ((isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner'])))
{
@ -449,7 +454,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
public function cloner()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
JSession::checkToken() or die(Text::_('JINVALID_TOKEN'));
// Get the model
$model = $this->getModel('Joomla_components');
// check if export is allowed for this user.
@ -462,10 +467,10 @@ class ComponentbuilderControllerJoomla_components extends AdminController
// Sanitize the input
JArrayHelper::toInteger($pks);
// check if there is any selections
if (!ComponentbuilderHelper::checkArray($pks))
if (!JCBArrayHelper::check($pks))
{
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_NO_COMPONENT_WAS_SELECTED_PLEASE_MAKE_A_SELECTION_OF_ONE_COMPONENT_AND_TRY_AGAIN');
$message = Text::_('COM_COMPONENTBUILDER_NO_COMPONENT_WAS_SELECTED_PLEASE_MAKE_A_SELECTION_OF_ONE_COMPONENT_AND_TRY_AGAIN');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
@ -473,7 +478,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
elseif (count( (array) $pks) !== 1)
{
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_ONLY_ONE_COMPONENT_CAN_BE_CLONED_AT_A_TIME_PLEASE_SELECT_ONE_AND_TRY_AGAIN');
$message = Text::_('COM_COMPONENTBUILDER_ONLY_ONE_COMPONENT_CAN_BE_CLONED_AT_A_TIME_PLEASE_SELECT_ONE_AND_TRY_AGAIN');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
@ -483,17 +488,17 @@ class ComponentbuilderControllerJoomla_components extends AdminController
if ($model->cloner($pks))
{
// clone was successful
$message = JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_WITH_ALL_LINKED_ADMIN_VIEWS_FIELDS_LINKED_TO_ADMIN_VIEWS_CUSTOM_ADMIN_VIEWS_SITE_VIEWS_TEMPLATES_AND_LAYOUTS_WERE_CLONED_SUCCESSFUL');
$message = Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_WITH_ALL_LINKED_ADMIN_VIEWS_FIELDS_LINKED_TO_ADMIN_VIEWS_CUSTOM_ADMIN_VIEWS_SITE_VIEWS_TEMPLATES_AND_LAYOUTS_WERE_CLONED_SUCCESSFUL');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message);
return;
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_CLONE_FAILED');
$message = Text::_('COM_COMPONENTBUILDER_CLONE_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_CLONE_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP');
$message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_CLONE_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
@ -502,5 +507,6 @@ class ComponentbuilderControllerJoomla_components extends AdminController
{
// admin area does not have API user, only front-end (so we fallback on login user)
return JFactory::getUser();
}
}
}

View File

@ -707,12 +707,20 @@ class Compiler extends Infusion
&& ($update_server = CFactory::_('Component')->get('update_server')) !== null)
{
// move to server
CFactory::_('Server')->legacyMove(
if (!CFactory::_('Server')->legacyMove(
$update_server_xml_path,
$this->updateServerFileName . '.xml',
(int) $update_server,
CFactory::_('Component')->get('update_server_protocol')
);
))
{
$this->app->enqueueMessage(
JText::sprintf(
'Upload of component (%s) update server XML failed.',
CFactory::_('Component')->get('system_name')
), 'Error'
);
}
// remove the local file
File::delete($update_server_xml_path);
}
@ -738,12 +746,20 @@ class Compiler extends Infusion
))
{
// move to server
CFactory::_('Server')->legacyMove(
if (!CFactory::_('Server')->legacyMove(
$module->update_server_xml_path,
$module->update_server_xml_file_name,
(int) $module->update_server,
$module->update_server_protocol
);
))
{
$this->app->enqueueMessage(
JText::sprintf(
'Upload of module (%s) update server XML failed.',
$module->name
), 'Error'
);
}
// remove the local file
File::delete($module->update_server_xml_path);
}
@ -771,12 +787,20 @@ class Compiler extends Infusion
))
{
// move to server
CFactory::_('Server')->legacyMove(
if (!CFactory::_('Server')->legacyMove(
$plugin->update_server_xml_path,
$plugin->update_server_xml_file_name,
(int) $plugin->update_server,
$plugin->update_server_protocol
);
))
{
$this->app->enqueueMessage(
JText::sprintf(
'Upload of plugin (%s) update server XML failed.',
$plugin->name
), 'Error'
);
}
// remove the local file
File::delete($plugin->update_server_xml_path);
}
@ -844,6 +868,13 @@ class Compiler extends Infusion
{
// do a final run to update the readme file
$two = 0;
// counter data if not set already
if (!CFactory::_('Content')->exist('LINE_COUNT')
|| CFactory::_('Content')->get('LINE_COUNT') != CFactory::_('Utilities.Counter')->line)
{
CFactory::_('Utilities.Counter')->set();
}
// search for the readme
foreach (CFactory::_('Utilities.Files')->get('static') as $static)
{
if (('README.md' === $static['name']
@ -864,12 +895,6 @@ class Compiler extends Infusion
private function setReadMe($path)
{
// set readme data if not set already
if (!CFactory::_('Content')->exist('LINE_COUNT')
|| CFactory::_('Content')->get('LINE_COUNT') != CFactory::_('Utilities.Counter')->line)
{
CFactory::_('Utilities.Counter')->set();
}
// get the file
$string = FileHelper::getContent($path);
// update the file
@ -1063,12 +1088,20 @@ class Compiler extends Infusion
&$component_sales_name, &$this->componentData)
);
// move to server
CFactory::_('Server')->legacyMove(
if (!CFactory::_('Server')->legacyMove(
$this->filepath['component'],
$component_sales_name . '.zip',
(int) CFactory::_('Component')->get('sales_server'),
CFactory::_('Component')->get('sales_server_protocol')
);
))
{
$this->app->enqueueMessage(
JText::sprintf(
'Upload of component (%s) zip file failed.',
CFactory::_('Component')->get('system_name')
), 'Error'
);
}
}
}
// Trigger Event: jcb_ce_onAfterZipComponent
@ -1158,12 +1191,20 @@ class Compiler extends Infusion
&$module)
);
// move to server
CFactory::_('Server')->legacyMove(
if (!CFactory::_('Server')->legacyMove(
$this->filepath['modules'][$module->id],
$module->zip_name . '.zip',
(int) $module->sales_server,
$module->sales_server_protocol
);
))
{
$this->app->enqueueMessage(
JText::sprintf(
'Upload of module (%s) zip file failed.',
$module->name
), 'Error'
);
}
}
}
// Trigger Event: jcb_ce_onAfterZipModule
@ -1252,12 +1293,20 @@ class Compiler extends Infusion
&$plugin)
);
// move to server
CFactory::_('Server')->legacyMove(
if (!CFactory::_('Server')->legacyMove(
$this->filepath['plugins'][$plugin->id],
$plugin->zip_name . '.zip',
(int) $plugin->sales_server,
$plugin->sales_server_protocol
);
))
{
$this->app->enqueueMessage(
JText::sprintf(
'Upload of plugin (%s) zip file failed.',
$plugin->name
), 'Error'
);
}
}
}
// Trigger Event: jcb_ce_onAfterZipPlugin

View File

@ -1064,7 +1064,8 @@ class Interpretation extends Fields
$addActive = true;
if (CFactory::_('Component')->isArray('version_update'))
{
foreach (CFactory::_('Component')->get('version_update') as $nr => &$update)
$updates = CFactory::_('Component')->get('version_update');
foreach ($updates as $nr => &$update)
{
$this->setUpdateXMLSQL($update, $updateXML, $addDynamicSQL);
@ -1074,6 +1075,7 @@ class Interpretation extends Fields
$addActive = false;
}
}
CFactory::_('Component')->set('version_update', $updates);
}
// add the dynamic sql if not already added
if ($addDynamicSQL
@ -1094,7 +1096,7 @@ class Interpretation extends Fields
$this->setDynamicUpdateXMLSQL($updateXML, $addActive);
}
// add the update server file
if (CFactory::_('Component')->get('add_update_server', 3) != 3)
if (CFactory::_('Component')->get('update_server_target', 3) != 3)
{
$updateXML[] = '</updates>';
// UPDATE_SERVER_XML
@ -15450,6 +15452,18 @@ class Interpretation extends Fields
CFactory::_('Content')->set_('import_' . $nameListCode, 'VIEWS', 'IMPORT_' . CFactory::_('Placeholder')->get_h('VIEWS'));
CFactory::_('Content')->set_('import_' . $nameListCode, 'Views', 'Import_' . CFactory::_('Placeholder')->get_h('views'));
CFactory::_('Content')->set_('import_' . $nameListCode, 'views', 'import_' . CFactory::_('Placeholder')->get_h('views'));
// IMPORT_CUSTOM_CONTROLLER_HEADER <<<DYNAMIC>>> add the header details for the controller
CFactory::_('Content')->set_('import_' . $nameListCode, 'IMPORT_CUSTOM_CONTROLLER_HEADER', $this->setFileHeader(
'import.custom.controller',
$nameListCode
));
// IMPORT_CUSTOM_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
CFactory::_('Content')->set_('import_' . $nameListCode, 'IMPORT_CUSTOM_MODEL_HEADER', $this->setFileHeader(
'import.custom.model',
$nameListCode
));
}
public function setListQuery(&$nameSingleCode, &$nameListCode)
@ -22183,9 +22197,19 @@ class Interpretation extends Fields
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
break;
case 'custom.admin.view.controller':
case 'import.custom.controller':
case 'import.controller':
$headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;';
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
break;
case 'import.custom.model':
case 'import.model':
$headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;';
$headers[] = 'use Joomla\CMS\Filesystem\File;';
$headers[] = 'use Joomla\CMS\Filesystem\Folder;';
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
$headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;';
break;
case 'admin.views.controller':
case 'custom.admin.views.controller':
case 'dashboard.controller':

View File

@ -625,8 +625,7 @@ class Infusion extends Interpretation
if (isset($view['port']) && $view['port']
|| 1 == $view['settings']->add_custom_import)
{
$this->eximportView[$nameListCode]
= true;
$this->eximportView[$nameListCode] = true;
if (1 == $view['settings']->add_custom_import)
{
// this view has custom import scripting
@ -1382,6 +1381,14 @@ class Infusion extends Interpretation
CFactory::_('Content')->set_('import', 'IMPORT_SAVE_METHOD', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_(
ComponentbuilderHelper::getDynamicScripts('save')
));
// IMPORT_CONTROLLER_HEADER <<<DYNAMIC>>> add the header details for the controller
CFactory::_('Content')->set_('import', 'IMPORT_CONTROLLER_HEADER', $this->setFileHeader(
'import.controller', 'import'
));
// IMPORT_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
CFactory::_('Content')->set_('import', 'IMPORT_MODEL_HEADER', $this->setFileHeader(
'import.model', 'import'
));
}
// ensure that the ajax model and controller is set if needed
@ -1798,6 +1805,12 @@ class Infusion extends Interpretation
CFactory::_('Content')->set('README', CFactory::_('Component')->get('readme'));
}
// CHANGELOG
if (($changelog = CFactory::_('Component')->get('changelog')) !== null)
{
CFactory::_('Content')->set('CHANGELOG', $changelog);
}
// Infuse POWERS
CFactory::_('Power.Infusion')->set();

View File

@ -5634,7 +5634,7 @@ COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_S
COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP="<h2>Curl Not Found!</h2><p>Please setup curl on your system, or <b>componentbuilder</b> will not function correctly!</p>"
COM_COMPONENTBUILDER_HTWODATA_IS_CORRUPTHTWOTHIS_COULD_BE_DUE_TO_BKEY_ERRORB_OR_BROKEN_PACKAGE="<h2>Data is corrupt!</h2>This could be due to <b>key error</b>, or broken package!"
COM_COMPONENTBUILDER_HTWODATA_IS_CORRUPTHTWOTHIS_COULD_BE_DUE_TO_BROKEN_PACKAGE="<h2>Data is corrupt!</h2>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="<h2>We could not open the encrypt data!</h2> This could be due to the FOFEncryption that is no longer supported in Joomla.<br />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_ENCRYPT_DATAHTWO_THIS_COULD_BE_DUE_TO_THE_FOFENCRYPTION_THAT_IS_NO_LONGER_SUPPORTED_IN_JOOMLABR_PLEASE_EXPORT_YOUR_PACKAGES_WITH_JCB_VTHREEONEONENINE_OR_HIGHER_TO_BE_ABLE_TO_IMPORT_IT_INTO_THIS_VERSION_OF_JCB="<h2>We could not open the encrypt data!</h2> This could be due to the FOFEncryption that is no longer supported in Joomla.<br />Please export your packages with JCB v3.1.19 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="<h2>We could not open the package!</h2>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="<i>Author:</i> <b>%s</b>"
COM_COMPONENTBUILDER_ICOMPANYI_BSB="<i>Company:</i> <b>%s</b>"
@ -9094,6 +9094,8 @@ COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER="S
COM_COMPONENTBUILDER_SORRY_THIS_VALIDATION_RULE_NAME_S_ALREADY_EXIST_AS_PART_OF_THE_JOOMLA_CORE_NO_NEED_TO_CREATE_IT_IF_YOU_ARE_ADAPTING_IT_GIVE_IT_YOUR_OWN_UNIQUE_NAME="Sorry this validation rule name (%s) already exist as part of the Joomla core! No need to create it, if you are adapting it give it your own unique name."
COM_COMPONENTBUILDER_SORRY_THIS_VALIDATION_RULE_NAME_S_ALREADY_EXIST_IN_YOUR_SYSTEM="Sorry this validation rule name (%s) already exist in your system!"
COM_COMPONENTBUILDER_SORTABLE="Sortable"
COM_COMPONENTBUILDER_SOURCE_CODE="source code"
COM_COMPONENTBUILDER_SOURCE_CODE_FOR_JOOMLA_COMPONENT="Source Code for Joomla Component"
COM_COMPONENTBUILDER_START_A_SEARCH="Start a Search"
COM_COMPONENTBUILDER_STOP_A_SEARCH="Stop a Search"
COM_COMPONENTBUILDER_SUBMENU="Submenu"
@ -9126,7 +9128,6 @@ COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED="Success! The snippet was sav
COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED_BUT_THE_MODIFIED_DATE_COULD_NOT_BE_ADJUSTED_BR_BR_BTHIS_MEANS_THE_SNIPPETS_WILL_CONTINUE_TO_APPEAR_OUT_OF_DATEB="Success! The snippet was saved. But the modified date could not be adjusted. <br /><br /><b>This means the snippets will continue to appear out of date.</b>"
COM_COMPONENTBUILDER_SUPPORT_JCB_TODAY="Support JCB Today"
COM_COMPONENTBUILDER_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WITH_A_BFINANCIAL_DONATIONB_TO_SHOW_GRATITUDE_FOR_THE_TIME_AND_EFFORT_SAVED_IN_YOUR_DEVELOPMENT_PROCESS_YOUR_CONTRIBUTION_NO_MATTER_THE_SIZE_WILL_BE_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY_HELP_ENSURE_THE_GROWTH_AND_RELEVANCE_OF_THIS_ESSENTIAL_TOOL="Support Joomla Component Builder (JCB) with a <b>financial donation</b> to show gratitude for the time and effort saved in your development process. Your contribution, no matter the size, will be appreciated by the project's team and the wider community. Help ensure the growth and relevance of this essential tool."
COM_COMPONENTBUILDER_SZDEQZDMVSMHBTRWFIFTYTSQFLVVXJTMTHREEJTWOIXM="%szdEQzdmVsMHBtRW50T%sQFlvVXJTM3J2IXM="
COM_COMPONENTBUILDER_SZIP_COULD_NOT_BE_INSTALLED="%s.zip could not be installed!"
COM_COMPONENTBUILDER_SZIP_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION="%s.zip was removed the from tmp folder during installation!"
COM_COMPONENTBUILDER_S_BEING_IMPORTED="%s Being Imported"
@ -9558,8 +9559,7 @@ COM_COMPONENTBUILDER_YES_UPDATE_ALL="Yes! Update ALL"
COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_BALLB_VALUES_THAT_CAN_BE_FOUND_IN_THE_DATABASE="Your are about to update <b>ALL</b> values that can be found in the database."
COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW="Your are about to update row"
COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE="Your component will be compiled to work in Joomla 3"
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 <a href="http://random-ize.com/how-long-to-hack-pass/" target="_blank" title="How long to hack pass">700 000 000 000 000 000 000 000 000 000 000</a> years to crack theoretically. Unless they have this key above, so do keep it safe."
COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 256 bit encryption using the above 32 character key."
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!"
COM_COMPONENTBUILDER_YOU_CAN_DIRECTLY_DOWNLOAD_THE_LATEST_UPDATE_OR_USE_THE_JOOMLA_UPDATE_AREA="You can directly download the latest update, or use the Joomla update area."

View File

@ -15,7 +15,12 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
use VDM\Gitea\Gitea;
use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Utilities\FileHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
use Joomla\Registry\Registry;
use Joomla\CMS\Language\Text;
use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
/**
@ -90,7 +95,7 @@ class ComponentbuilderModelAjax extends ListModel
// set the url
$url = "https://api.crowdin.com/api/project/$identifier/info?key=$key&json";
// get the details
if (($details = ComponentbuilderHelper::getFileContents($url, false)) !== false && ComponentbuilderHelper::checkJson($details))
if (($details = FileHelper::getContent($url, false)) !== false && JsonHelper::check($details))
{
$details = json_decode($details, true);
// check if there is an error
@ -102,9 +107,9 @@ class ComponentbuilderModelAjax extends ListModel
if (isset($details['details']))
{
$html = '<div class="alert alert-success" id="crowdin_message">';
$html .= '<h1>' . JText::_('COM_COMPONENTBUILDER_COMPONENT_SUCCESSFULLY_LINKED') . '</h1>';
$html .= '<h1>' . Text::_('COM_COMPONENTBUILDER_COMPONENT_SUCCESSFULLY_LINKED') . '</h1>';
$html .= '<h3>' . $details['details']['name'] . '</h3>';
if (ComponentbuilderHelper::checkString($details['details']['description']))
if (StringHelper::check($details['details']['description']))
{
$html .= '<p>';
$html .= $details['details']['description'];
@ -128,7 +133,7 @@ class ComponentbuilderModelAjax extends ListModel
$html .= '</b></li>';
$html .= '</ul>';
$html .= '</div>';
return array('html' => $html);
return ['html' => $html];
}
}
return false;
@ -153,7 +158,7 @@ class ComponentbuilderModelAjax extends ListModel
$db->execute();
if ($db->loadRowList())
{
return array( 'html' => $this->componentDetailsDisplay($db->loadObject()));
return ['html' => $this->componentDetailsDisplay($db->loadObject())];
}
return false;
}
@ -166,47 +171,26 @@ class ComponentbuilderModelAjax extends ListModel
// convert URL
$url = base64_decode($package);
$url = str_replace('.zip', '.info', $url);
// check if url exist
if ($info = ComponentbuilderHelper::getFileContents($url, false))
if ($info = FileHelper::getContent($url, false))
{
// Get the encryption object.
$db = 'COM_COMPONENTBUILDER_VJRZDESSMHBTRWFIFTYTWVZEROAESFLVVXJTMTHREEJTWOIXM';
$password = base64_decode(JText::sprintf($db, 'QzdmV', '9kQ'));
// we first use the new encryption
// load phpseclib <https://phpseclib.com/docs/symmetric>
$opened = false;
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael)
if ((($info_ = PackageFactory::_('Crypt')->decrypt($info, 'local')) !== null && JsonHelper::check($info_)) ||
(($info_ = PackageFactory::_('Crypt')->decrypt($info, 'local.legacy')) !== null && JsonHelper::check($info_)) ||
(($info_ = PackageFactory::_('Crypt')->decrypt($info, 'local.fof')) !== null && JsonHelper::check($info_)))
{
// 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 ($opened && ComponentbuilderHelper::checkJson($_info))
{
$info = json_decode($_info, true);
return array('owner' => ComponentbuilderHelper::getPackageOwnerDetailsDisplay($info, true), 'packages' => ComponentbuilderHelper::getPackageComponentsDetailsDisplay($info));
$info = json_decode($info_, true);
return [
'owner' => PackageFactory::_('Display.Details')->owner($info, true),
'packages' => PackageFactory::_('Display.Details')->components($info)
];
}
}
return array('error' => JText::_('COM_COMPONENTBUILDER_JCB_PACKAGE_INFO_PATH_DOES_NOT_WORK_WE_ADVICE_YOU_BNOT_TO_CONTINUEB_WITH_THE_IMPORT_OF_THE_SELECTED_PACKAGE'));
return [
'error' => Text::_('COM_COMPONENTBUILDER_JCB_PACKAGE_INFO_PATH_DOES_NOT_WORK_WE_ADVICE_YOU_BNOT_TO_CONTINUEB_WITH_THE_IMPORT_OF_THE_SELECTED_PACKAGE')
];
}
/**
@ -215,29 +199,29 @@ class ComponentbuilderModelAjax extends ListModel
protected function componentDetailsDisplay($object)
{
// set some vars
$image = (ComponentbuilderHelper::checkString($object->image)) ? '<img alt="Joomla Component Image" src="'. JURI::root() . $object->image . '" style="float: right;">': '';
$desc = (ComponentbuilderHelper::checkString($object->description)) ? $object->description : $object->short_description;
$placeholder = ($object->add_placeholders == 1) ? '<span class="btn btn-small btn-success"> ' . JText::_('COM_COMPONENTBUILDER_YES') . ' </span>' : '<span class="btn btn-small btn-danger"> ' .JText::_('COM_COMPONENTBUILDER_NO') . ' </span>' ;
$debug = ($object->debug_linenr == 1) ? '<span class="btn btn-small btn-success"> ' .JText::_('COM_COMPONENTBUILDER_YES') . '</span>' : ' <span class="btn btn-small btn-danger"> ' .JText::_('COM_COMPONENTBUILDER_NO') . ' </span>' ;
$image = (StringHelper::check($object->image)) ? '<img alt="Joomla Component Image" src="'. JURI::root() . $object->image . '" style="float: right;">': '';
$desc = (StringHelper::check($object->description)) ? $object->description : $object->short_description;
$placeholder = ($object->add_placeholders == 1) ? '<span class="btn btn-small btn-success"> ' . Text::_('COM_COMPONENTBUILDER_YES') . ' </span>' : '<span class="btn btn-small btn-danger"> ' .Text::_('COM_COMPONENTBUILDER_NO') . ' </span>' ;
$debug = ($object->debug_linenr == 1) ? '<span class="btn btn-small btn-success"> ' .Text::_('COM_COMPONENTBUILDER_YES') . '</span>' : ' <span class="btn btn-small btn-danger"> ' .Text::_('COM_COMPONENTBUILDER_NO') . ' </span>' ;
$html = array();
$html[] = '<h3>' . $object->name . ' (v' . $object->component_version . ')</h3>';
$html[] = '<p>' . $desc . $image . '</p>';
$html[] = '<ul>';
$html[] = '<li>' . JText::_('COM_COMPONENTBUILDER_COMPANY') . ': <b>' . $object->companyname . '</b></li>';
$html[] = '<li>' . JText::_('COM_COMPONENTBUILDER_AUTHOR') . ': <b>' . $object->author . '</b></li>';
$html[] = '<li>' . JText::_('COM_COMPONENTBUILDER_EMAIL') . ': <b>' . $object->email . '</b></li>';
$html[] = '<li>' . JText::_('COM_COMPONENTBUILDER_WEBSITE') . ': <b>' . $object->website . '</b></li>';
$html[] = '<li>' . Text::_('COM_COMPONENTBUILDER_COMPANY') . ': <b>' . $object->companyname . '</b></li>';
$html[] = '<li>' . Text::_('COM_COMPONENTBUILDER_AUTHOR') . ': <b>' . $object->author . '</b></li>';
$html[] = '<li>' . Text::_('COM_COMPONENTBUILDER_EMAIL') . ': <b>' . $object->email . '</b></li>';
$html[] = '<li>' . Text::_('COM_COMPONENTBUILDER_WEBSITE') . ': <b>' . $object->website . '</b></li>';
$html[] = '</ul>';
$html[] = '<h4>' . JText::_('COM_COMPONENTBUILDER_COMPONENT_GLOBAL_SETTINGS') . '</h4>';
$html[] = '<h4>' . Text::_('COM_COMPONENTBUILDER_COMPONENT_GLOBAL_SETTINGS') . '</h4>';
$html[] = '<p>';
$html[] = JText::_('COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS') . '<br />' . $placeholder . '<br />';
$html[] = JText::_('COM_COMPONENTBUILDER_DEBUG_LINE_NUMBERS') . '<br />' . $debug ;
$html[] = Text::_('COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS') . '<br />' . $placeholder . '<br />';
$html[] = Text::_('COM_COMPONENTBUILDER_DEBUG_LINE_NUMBERS') . '<br />' . $debug ;
$html[] = '</p>';
$html[] = '<h4>' . JText::_('COM_COMPONENTBUILDER_LICENSE') . '</h4>';
$html[] = '<h4>' . Text::_('COM_COMPONENTBUILDER_LICENSE') . '</h4>';
$html[] = '<p>' . $object->license . '</p>';
$html[] = '<h4>' . JText::_('COM_COMPONENTBUILDER_COPYRIGHT') . '</h4>';
$html[] = '<h4>' . Text::_('COM_COMPONENTBUILDER_COPYRIGHT') . '</h4>';
$html[] = '<p>' . $object->copyright . '<br /><br />';
$html[] = '<a href="index.php?option=com_componentbuilder&ref=compiler&view=joomla_components&task=joomla_component.edit&id=' . (int) $object->id . '" class="btn btn-small span12"><span class="icon-edit"></span> ' . JText::_('COM_COMPONENTBUILDER_EDIT') . ' ' .$object->system_name . '</a></p>';
$html[] = '<a href="index.php?option=com_componentbuilder&ref=compiler&view=joomla_components&task=joomla_component.edit&id=' . (int) $object->id . '" class="btn btn-small span12"><span class="icon-edit"></span> ' . Text::_('COM_COMPONENTBUILDER_EDIT') . ' ' .$object->system_name . '</a></p>';
// now return the diplay
return implode("\n", $html);
}
@ -247,7 +231,7 @@ class ComponentbuilderModelAjax extends ListModel
**/
public function getCronPath($type)
{
$result = array('error' => '<span style="color: red;">' . JText::_('COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED') . '</span>');
$result = array('error' => '<span style="color: red;">' . Text::_('COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED') . '</span>');
if ('backup' === $type)
{
$result['error'] = '<span style="color: red;">' . JText::sprintf('COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_FOR_S', $type) . '</span>';
@ -333,7 +317,7 @@ class ComponentbuilderModelAjax extends ListModel
return ['error' => $message];
}
return ['error' => JText::_('COM_COMPONENTBUILDER_THE_WIKI_CAN_ONLY_BE_LOADED_WHEN_YOUR_JCB_SYSTEM_HAS_INTERNET_CONNECTION')];
return ['error' => Text::_('COM_COMPONENTBUILDER_THE_WIKI_CAN_ONLY_BE_LOADED_WHEN_YOUR_JCB_SYSTEM_HAS_INTERNET_CONNECTION')];
}
public function getVersion($version = null)
@ -377,7 +361,7 @@ class ComponentbuilderModelAjax extends ListModel
// now check if this version is out dated
if ($current_version === $local_version)
{
return ['notice' => '<small><span style="color:green;"><span class="icon-shield"></span>' . JText::_('COM_COMPONENTBUILDER_UP_TO_DATE') . '</span></small>'];
return ['notice' => '<small><span style="color:green;"><span class="icon-shield"></span>' . Text::_('COM_COMPONENTBUILDER_UP_TO_DATE') . '</span></small>'];
}
else
{
@ -388,15 +372,15 @@ class ComponentbuilderModelAjax extends ListModel
($local_array[0] == $current_array[0] && $local_array[1] > $current_array[1]) ||
($local_array[0] == $current_array[0] && $local_array[1] == $current_array[1] && $local_array[2] > $current_array[2]))
{
return ['notice' => '<small><span style="color:#F7B033;"><span class="icon-wrench"></span>' . JText::_('COM_COMPONENTBUILDER_BETA_RELEASE') . '</span></small>'];
return ['notice' => '<small><span style="color:#F7B033;"><span class="icon-wrench"></span>' . Text::_('COM_COMPONENTBUILDER_BETA_RELEASE') . '</span></small>'];
}
else
{
// download link of the latest version
$download = "https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/" . $tags[0]->name . ".zip?access_token=" . $token;
return ['notice' => '<small><span style="color:red;"><span class="icon-warning-circle"></span>' . JText::_('COM_COMPONENTBUILDER_OUT_OF_DATE') . '!</span> <a style="color:green;" href="' .
$download . '" title="' . JText::_('COM_COMPONENTBUILDER_YOU_CAN_DIRECTLY_DOWNLOAD_THE_LATEST_UPDATE_OR_USE_THE_JOOMLA_UPDATE_AREA') . '">' . JText::_('COM_COMPONENTBUILDER_DOWNLOAD_UPDATE') . '!</a></small>'];
return ['notice' => '<small><span style="color:red;"><span class="icon-warning-circle"></span>' . Text::_('COM_COMPONENTBUILDER_OUT_OF_DATE') . '!</span> <a style="color:green;" href="' .
$download . '" title="' . Text::_('COM_COMPONENTBUILDER_YOU_CAN_DIRECTLY_DOWNLOAD_THE_LATEST_UPDATE_OR_USE_THE_JOOMLA_UPDATE_AREA') . '">' . Text::_('COM_COMPONENTBUILDER_DOWNLOAD_UPDATE') . '!</a></small>'];
}
}
}
@ -416,11 +400,12 @@ class ComponentbuilderModelAjax extends ListModel
if ($message)
{
return ['error' => $a . $message . $a_ . JText::_('COM_COMPONENTBUILDER_GET_TOKEN') . $_a];
return ['error' => $a . $message . $a_ . Text::_('COM_COMPONENTBUILDER_GET_TOKEN') . $_a];
}
return ['error' => $a . JText::_('COM_COMPONENTBUILDER_GET_TOKEN_FROM_VDM_TO_GET_UPDATE_NOTICE_AND_ADD_IT_TO_YOUR_GLOBAL_OPTIONS') . $a_ . JText::_('COM_COMPONENTBUILDER_GET_TOKEN') . $_a];
return ['error' => $a . Text::_('COM_COMPONENTBUILDER_GET_TOKEN_FROM_VDM_TO_GET_UPDATE_NOTICE_AND_ADD_IT_TO_YOUR_GLOBAL_OPTIONS') . $a_ . Text::_('COM_COMPONENTBUILDER_GET_TOKEN') . $_a];
}
// Used in joomla_module

View File

@ -18,7 +18,7 @@ use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
/**
/***
* Componentbuilder Import Base Database Model
*/
class ComponentbuilderModelImport extends BaseDatabaseModel

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,12 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Utilities\FileHelper;
use VDM\Joomla\Utilities\ArrayHelper as JCBArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\JsonHelper;
/**
* Joomla_components List Model
@ -112,14 +118,14 @@ class ComponentbuilderModelJoomla_components extends ListModel
}
// has any data been set for this component
if (ComponentbuilderHelper::checkArray($pks))
if (JCBArrayHelper::check($pks))
{
// load the linked stuff
$this->getLinkedToComponents($pks);
}
// has any data been set for this component
if (isset($this->smartBox['joomla_component']) && ComponentbuilderHelper::checkArray($this->smartBox['joomla_component']))
if (isset($this->smartBox['joomla_component']) && JCBArrayHelper::check($this->smartBox['joomla_component']))
{
// set the folder and move the files of each component to the folder
return $this->smartCloner();
@ -181,25 +187,22 @@ class ComponentbuilderModelJoomla_components extends ListModel
$this->packageName = 'JCB_smartPackage';
}
}
// set the package path
$this->packagePath = rtrim($this->backupPath, '/') . '/' . $this->packageName;
$this->zipPath = rtrim($this->zipPath, '/') . '/' . $this->packageName .'.zip';
if (JFolder::exists($this->packagePath))
if (FileHelper::exists($this->packagePath))
{
// remove if old folder is found
ComponentbuilderHelper::removeFolder($this->packagePath);
}
// create the folders
JFolder::create($this->packagePath);
// Get the basic encryption.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encryption object.
if ($basickey)
{
$basic = new FOFEncryptAes($basickey, 128);
}
// update $pks with returned IDs
$pks = array();
// start loading the components
$this->smartBox['joomla_component'] = array();
foreach ($items as $nr => &$item)
@ -211,8 +214,10 @@ class ComponentbuilderModelJoomla_components extends ListModel
unset($items[$nr]);
continue;
}
// make sure old fields are not exported any more
$this->removeOldComponentValues($item);
// build information data set
$this->info['name'][$item->id] = $item->name;
$this->info['short_description'][$item->id] = $item->short_description;
@ -223,14 +228,15 @@ class ComponentbuilderModelJoomla_components extends ListModel
$this->info['website'][$item->id] = $item->website;
$this->info['license'][$item->id] = $item->license;
$this->info['copyright'][$item->id] = $item->copyright;
// set the keys
if (isset($item->export_key) && ComponentbuilderHelper::checkString($item->export_key))
if (isset($item->export_key) && StringHelper::check($item->export_key))
{
// keep the key locked for exported data set
$export_key = $item->export_key;
if ($basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true)))
if (!is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true)))
{
$export_key = rtrim($basic->decryptString($item->export_key), "\0");
$export_key = PackageFactory::_('Crypt')->decrypt($item->export_key, 'basic');
}
// make sure we have a string
if (strlen($export_key) > 4 )
@ -238,27 +244,31 @@ class ComponentbuilderModelJoomla_components extends ListModel
$this->key[$item->id] = $export_key;
}
}
// get name of this item key_name
if (isset($item->system_name))
{
$keyName = ComponentbuilderHelper::safeString($item->system_name, 'cAmel');
$keyName = StringHelper::safe($item->system_name, 'cAmel');
}
else
{
$keyName = ComponentbuilderHelper::safeString($item->name_code);
$keyName = StringHelper::safe($item->name_code);
}
// set the export buy links
if (isset($item->export_buy_link) && ComponentbuilderHelper::checkString($item->export_buy_link))
if (isset($item->export_buy_link) && StringHelper::check($item->export_buy_link))
{
// set the export buy link
$this->info['export_buy_link'][$item->id] = $item->export_buy_link;
}
// set the export buy links
if (isset($item->joomla_source_link) && ComponentbuilderHelper::checkString($item->joomla_source_link))
if (isset($item->joomla_source_link) && StringHelper::check($item->joomla_source_link))
{
// set the source link
$this->info['joomla_source_link'][$item->id] = $item->joomla_source_link;
}
// component image
$this->moveIt(array($item->image), 'image');
// set the custom code ID's
@ -276,14 +286,14 @@ class ComponentbuilderModelJoomla_components extends ListModel
}
// has any data been set for this component
if (ComponentbuilderHelper::checkArray($pks))
if (JCBArrayHelper::check($pks))
{
// load the linked stuff
$this->getLinkedToComponents($pks);
}
// has any data been set for this component
if (isset($this->smartBox['joomla_component']) && ComponentbuilderHelper::checkArray($this->smartBox['joomla_component']))
if (isset($this->smartBox['joomla_component']) && JCBArrayHelper::check($this->smartBox['joomla_component']))
{
// set the folder and move the files of each component to the folder
return $this->smartExportBuilder();
@ -320,7 +330,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
$this->setData($table, $pks, $field);
}
// add fields conditions and relations
if (isset($this->smartIDs['admin_view']) && ComponentbuilderHelper::checkArray($this->smartIDs['admin_view']))
if (isset($this->smartIDs['admin_view']) && JCBArrayHelper::check($this->smartIDs['admin_view']))
{
$this->setData('admin_fields', array_values($this->smartIDs['admin_view']), 'admin_view');
$this->setData('admin_fields_conditions', array_values($this->smartIDs['admin_view']), 'admin_view');
@ -328,41 +338,41 @@ class ComponentbuilderModelJoomla_components extends ListModel
$this->setData('admin_custom_tabs', array_values($this->smartIDs['admin_view']), 'admin_view');
}
// add joomla module
if (isset($this->smartIDs['joomla_module']) && ComponentbuilderHelper::checkArray($this->smartIDs['joomla_module']))
if (isset($this->smartIDs['joomla_module']) && JCBArrayHelper::check($this->smartIDs['joomla_module']))
{
$this->setData('joomla_module', array_values($this->smartIDs['joomla_module']), 'id');
$this->setData('joomla_module_updates', array_values($this->smartIDs['joomla_module']), 'joomla_module');
$this->setData('joomla_module_files_folders_urls', array_values($this->smartIDs['joomla_module']), 'joomla_module');
}
// add joomla plugin
if (isset($this->smartIDs['joomla_plugin']) && ComponentbuilderHelper::checkArray($this->smartIDs['joomla_plugin']))
if (isset($this->smartIDs['joomla_plugin']) && JCBArrayHelper::check($this->smartIDs['joomla_plugin']))
{
$this->setData('joomla_plugin', array_values($this->smartIDs['joomla_plugin']), 'id');
$this->setData('joomla_plugin_updates', array_values($this->smartIDs['joomla_plugin']), 'joomla_plugin');
$this->setData('joomla_plugin_files_folders_urls', array_values($this->smartIDs['joomla_plugin']), 'joomla_plugin');
}
// add validation rules
if (isset($this->smartIDs['validation_rule']) && ComponentbuilderHelper::checkArray($this->smartIDs['validation_rule']))
if (isset($this->smartIDs['validation_rule']) && JCBArrayHelper::check($this->smartIDs['validation_rule']))
{
$this->setData('validation_rule', array_values($this->smartIDs['validation_rule']), 'name');
}
// add field types
if (isset($this->smartIDs['fieldtype']) && ComponentbuilderHelper::checkArray($this->smartIDs['fieldtype']))
if (isset($this->smartIDs['fieldtype']) && JCBArrayHelper::check($this->smartIDs['fieldtype']))
{
$this->setData('fieldtype', array_values($this->smartIDs['fieldtype']), 'id');
}
// add templates
if (isset($this->smartIDs['template']) && ComponentbuilderHelper::checkArray($this->smartIDs['template']))
if (isset($this->smartIDs['template']) && JCBArrayHelper::check($this->smartIDs['template']))
{
$this->setData('template', array_values($this->smartIDs['template']), 'id');
}
// add layouts
if (isset($this->smartIDs['layout']) && ComponentbuilderHelper::checkArray($this->smartIDs['layout']))
if (isset($this->smartIDs['layout']) && JCBArrayHelper::check($this->smartIDs['layout']))
{
$this->setData('layout', array_values($this->smartIDs['layout']), 'id');
}
// add dynamic get
if (isset($this->smartIDs['dynamic_get']) && ComponentbuilderHelper::checkArray($this->smartIDs['dynamic_get']))
if (isset($this->smartIDs['dynamic_get']) && JCBArrayHelper::check($this->smartIDs['dynamic_get']))
{
$this->setData('dynamic_get', array_values($this->smartIDs['dynamic_get']), 'id');
}
@ -370,49 +380,49 @@ class ComponentbuilderModelJoomla_components extends ListModel
if ('clone' !== $this->activeType)
{
// add class_property
if (isset($this->smartIDs['class_property']) && ComponentbuilderHelper::checkArray($this->smartIDs['class_property']))
if (isset($this->smartIDs['class_property']) && JCBArrayHelper::check($this->smartIDs['class_property']))
{
$this->setData('class_property', array_values($this->smartIDs['class_property']), 'id');
}
// add class_method
if (isset($this->smartIDs['class_method']) && ComponentbuilderHelper::checkArray($this->smartIDs['class_method']))
if (isset($this->smartIDs['class_method']) && JCBArrayHelper::check($this->smartIDs['class_method']))
{
$this->setData('class_method', array_values($this->smartIDs['class_method']), 'id');
}
// add joomla_plugin_group
if (isset($this->smartIDs['joomla_plugin_group']) && ComponentbuilderHelper::checkArray($this->smartIDs['joomla_plugin_group']))
if (isset($this->smartIDs['joomla_plugin_group']) && JCBArrayHelper::check($this->smartIDs['joomla_plugin_group']))
{
$this->setData('joomla_plugin_group', array_values($this->smartIDs['joomla_plugin_group']), 'id');
}
// add class_extends
if (isset($this->smartIDs['class_extends']) && ComponentbuilderHelper::checkArray($this->smartIDs['class_extends']))
if (isset($this->smartIDs['class_extends']) && JCBArrayHelper::check($this->smartIDs['class_extends']))
{
$this->setData('class_extends', array_values($this->smartIDs['class_extends']), 'id');
}
// add snippets
if (isset($this->smartIDs['snippet']) && ComponentbuilderHelper::checkArray($this->smartIDs['snippet']))
if (isset($this->smartIDs['snippet']) && JCBArrayHelper::check($this->smartIDs['snippet']))
{
$this->setData('snippet', array_values($this->smartIDs['snippet']), 'id');
}
// add custom code
if (isset($this->smartIDs['custom_code']) && ComponentbuilderHelper::checkArray($this->smartIDs['custom_code']))
if (isset($this->smartIDs['custom_code']) && JCBArrayHelper::check($this->smartIDs['custom_code']))
{
$this->setData('custom_code', array_values($this->smartIDs['custom_code']), 'id');
}
// add placeholder
if (isset($this->smartIDs['placeholder']) && ComponentbuilderHelper::checkArray($this->smartIDs['placeholder']))
if (isset($this->smartIDs['placeholder']) && JCBArrayHelper::check($this->smartIDs['placeholder']))
{
$this->setData('placeholder', array_values($this->smartIDs['placeholder']), 'id');
}
// add powers
if (isset($this->smartIDs['power']) && ComponentbuilderHelper::checkArray($this->smartIDs['power']))
if (isset($this->smartIDs['power']) && JCBArrayHelper::check($this->smartIDs['power']))
{
$this->setData('power', array_values($this->smartIDs['power']), 'guid');
}
// set limiter
$limit = 0;
// and add those custom codes found in custom codes
while (isset($this->smartIDs['custom_code']) && ComponentbuilderHelper::checkArray($this->smartIDs['custom_code']) && $limit < 100)
while (isset($this->smartIDs['custom_code']) && JCBArrayHelper::check($this->smartIDs['custom_code']) && $limit < 100)
{
$this->setData('custom_code', array_values($this->smartIDs['custom_code']), 'id');
// make sure we break
@ -429,15 +439,15 @@ class ComponentbuilderModelJoomla_components extends ListModel
protected function getComponents($pks)
{
// setup the query
if (ComponentbuilderHelper::checkArray($pks))
if (JCBArrayHelper::check($pks))
{
// Get the user object.
if (!ComponentbuilderHelper::checkObject($this->user))
if (!ObjectHelper::check($this->user))
{
$this->user = JFactory::getUser();
}
// Create a new query object.
if (!ComponentbuilderHelper::checkObject($this->_db))
if (!ObjectHelper::check($this->_db))
{
$this->_db = JFactory::getDBO();
}
@ -468,10 +478,10 @@ class ComponentbuilderModelJoomla_components extends ListModel
// load the items from db
$items = $this->_db->loadObjectList();
// check if we have items
if (ComponentbuilderHelper::checkArray($items))
if (JCBArrayHelper::check($items))
{
// set params
if (!ComponentbuilderHelper::checkObject($this->params))
if (!ObjectHelper::check($this->params))
{
$this->params = JComponentHelper::getParams('com_componentbuilder');
}
@ -516,30 +526,30 @@ class ComponentbuilderModelJoomla_components extends ListModel
$this->smartIDs[$table] = array();
}
// convert if value is in json
if (ComponentbuilderHelper::checkJson($value))
if (JsonHelper::check($value))
{
$value = json_decode($value, true);
}
// now update the fields
if (ComponentbuilderHelper::checkArray($value))
if (JCBArrayHelper::check($value))
{
foreach ($value as $id)
{
if ($int && (ComponentbuilderHelper::checkString($id) || is_numeric($id)) && 0 !== (int) $id)
if ($int && (StringHelper::check($id) || is_numeric($id)) && 0 !== (int) $id)
{
$this->smartIDs[$table][(int) $id] = (int) $id;
}
elseif (!$int && ComponentbuilderHelper::checkString($id))
elseif (!$int && StringHelper::check($id))
{
$this->smartIDs[$table][$id] = $this->_db->quote($id);
}
}
}
elseif ($int && (ComponentbuilderHelper::checkString($value) || is_numeric($value)) && 0 !== (int) $value)
elseif ($int && (StringHelper::check($value) || is_numeric($value)) && 0 !== (int) $value)
{
$this->smartIDs[$table][(int) $value] = (int) $value;
}
elseif (!$int && ComponentbuilderHelper::checkString($value))
elseif (!$int && StringHelper::check($value))
{
$this->smartIDs[$table][$value] = $this->_db->quote($value);
}
@ -555,12 +565,12 @@ class ComponentbuilderModelJoomla_components extends ListModel
// the ids bucket
$bucket = array();
// if json convert to array
if (ComponentbuilderHelper::checkJson($values))
if (JsonHelper::check($values))
{
$values = json_decode($values, true);
}
// check that the array has values
if (ComponentbuilderHelper::checkArray($values))
if (JCBArrayHelper::check($values))
{
// check if the key is an array (targeting subform)
if ('subform' === $type && $key)
@ -573,7 +583,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
{
$bucket[] = $value[$key];
}
elseif (ComponentbuilderHelper::checkString($value[$key]))
elseif (StringHelper::check($value[$key]))
{
if ('table' === $prep)
{
@ -587,7 +597,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
}
}
// only return if we set the ids
if (ComponentbuilderHelper::checkArray($bucket))
if (JCBArrayHelper::check($bucket))
{
// now set the values back
return array_unique($bucket);
@ -599,7 +609,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
$_key = explode('.', $key);
foreach ($values as $value)
{
if (isset($value[$_key[0]]) && ComponentbuilderHelper::checkArray($value[$_key[0]]))
if (isset($value[$_key[0]]) && JCBArrayHelper::check($value[$_key[0]]))
{
foreach ($value[$_key[0]] as $_value)
{
@ -607,7 +617,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
{
$bucket[] = $_value[$_key[1]];
}
elseif (ComponentbuilderHelper::checkString($_value[$_key[1]]))
elseif (StringHelper::check($_value[$_key[1]]))
{
if ('table' === $prep)
{
@ -622,7 +632,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
}
}
// only return if we set the ids
if (ComponentbuilderHelper::checkArray($bucket))
if (JCBArrayHelper::check($bucket))
{
// now set the values back
return array_unique($bucket);
@ -638,7 +648,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
{
return $value;
}
elseif (ComponentbuilderHelper::checkString($value))
elseif (StringHelper::check($value))
{
if ('table' === $prep)
{
@ -659,11 +669,11 @@ class ComponentbuilderModelJoomla_components extends ListModel
{
foreach ($values[$key] as $k => $val)
{
if (strpos($k, 'power_') !== false && ComponentbuilderHelper::checkArray($val))
if (strpos($k, 'power_') !== false && JCBArrayHelper::check($val))
{
foreach ($val as $v)
{
if (ComponentbuilderHelper::checkArray($v) && isset($v['power']))
if (JCBArrayHelper::check($v) && isset($v['power']))
{
$bucket[$v['power']] = $v['power'];
}
@ -671,7 +681,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
}
}
// only return if we set the ids
if (ComponentbuilderHelper::checkArray($bucket))
if (JCBArrayHelper::check($bucket))
{
// now return the values back
return array_values($bucket);
@ -690,7 +700,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
protected function setData($table, $values, $key, $string = false)
{
// lets check for json strings
if (ComponentbuilderHelper::checkJson($values))
if (JsonHelper::check($values))
{
$values = json_decode($values, true);
}
@ -701,7 +711,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
}
// make sure we have an array of values
if (!ComponentbuilderHelper::checkArray($values, true) || !ComponentbuilderHelper::checkString($table) || !ComponentbuilderHelper::checkString($key))
if (!JCBArrayHelper::check($values, true) || !StringHelper::check($table) || !StringHelper::check($key))
{
return false;
}
@ -752,7 +762,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
// reset the search array (only search for template/layouts)
$searchTLArray = array();
// check if we have items
if (ComponentbuilderHelper::checkArray($items))
if (JCBArrayHelper::check($items))
{
// set search array if site/custom admin view
if ('site_view' === $table || 'custom_admin_view' === $table)
@ -904,7 +914,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
if ('component_modules' === $table)
{
// we remove those modules not part of the export
if (isset($item->addjoomla_modules) && ComponentbuilderHelper::checkJson($item->addjoomla_modules))
if (isset($item->addjoomla_modules) && JsonHelper::check($item->addjoomla_modules))
{
$item->addjoomla_modules = array_filter(
json_decode($item->addjoomla_modules, true),
@ -925,7 +935,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
if ('component_plugins' === $table)
{
// we remove those plugins not part of the export
if (isset($item->addjoomla_plugins) && ComponentbuilderHelper::checkJson($item->addjoomla_plugins))
if (isset($item->addjoomla_plugins) && JsonHelper::check($item->addjoomla_plugins))
{
$item->addjoomla_plugins = array_filter(
json_decode($item->addjoomla_plugins, true),
@ -1001,17 +1011,17 @@ class ComponentbuilderModelJoomla_components extends ListModel
$fieldsSets[] = (int) $fields;
}
// get fields
if (ComponentbuilderHelper::checkArray($fieldsSets))
if (JCBArrayHelper::check($fieldsSets))
{
$this->setData('field', $fieldsSets, 'id');
}
}
// check if validation rule is found
$validationRule = ComponentbuilderHelper::getBetween(json_decode($item->xml), 'validate="', '"');
if (ComponentbuilderHelper::checkString($validationRule))
if (StringHelper::check($validationRule))
{
// make sure it is lowercase
$validationRule = ComponentbuilderHelper::safeString($validationRule);
$validationRule = StringHelper::safe($validationRule);
// get core validation rules
if ($coreValidationRules = ComponentbuilderHelper::getExistingValidationRuleNames(true))
{
@ -1025,7 +1035,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
}
}
// check if a search is required
if (isset($searchTLArray) && ComponentbuilderHelper::checkArray($searchTLArray)){
if (isset($searchTLArray) && JCBArrayHelper::check($searchTLArray)){
// add search array templates and layouts
foreach ($searchTLArray as $scripter => $add)
@ -1181,7 +1191,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
protected function smartCloner()
{
// check if data is set
if (isset($this->smartBox) && ComponentbuilderHelper::checkArray($this->smartBox))
if (isset($this->smartBox) && JCBArrayHelper::check($this->smartBox))
{
// get the import_joomla_components
$model = ComponentbuilderHelper::getModel('import_joomla_components');
@ -1190,7 +1200,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
// trigger the create new (clone) feature
$model->canmerge = 0;
// set some postfix
$model->postfix = ' ('.ComponentbuilderHelper::randomkey(2).')';
$model->postfix = ' ('.StringHelper::random(2).')';
// get App
$model->app = JFactory::getApplication();
// set user
@ -1239,10 +1249,11 @@ class ComponentbuilderModelJoomla_components extends ListModel
protected function smartExportBuilder()
{
// check if data is set
if (isset($this->smartBox) && ComponentbuilderHelper::checkArray($this->smartBox))
if (isset($this->smartBox) && JCBArrayHelper::check($this->smartBox))
{
// set db data
$data = serialize($this->smartBox);
// Set the key owner information
$this->info['source'] = array();
$this->info['source']['company'] = $this->params->get('export_company', null);
@ -1251,26 +1262,16 @@ class ComponentbuilderModelJoomla_components extends ListModel
$this->info['source']['website'] = $this->params->get('export_website', null);
$this->info['source']['license'] = $this->params->get('export_license', null);
$this->info['source']['copyright'] = $this->params->get('export_copyright', null);
// lock the data if set
if (ComponentbuilderHelper::checkArray($this->key))
if (JCBArrayHelper::check($this->key))
{
// lock the data
$this->key = md5(implode('', $this->key));
// 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 <https://phpseclib.com/docs/symmetric>
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;
}
// lock the data
$data = PackageFactory::_('Crypt')->encrypt($data, 'aes', $this->key);
// Set the key owner information
$this->info['getKeyFrom'] = array();
$this->info['getKeyFrom']['company'] = $this->info['source']['company'];
@ -1280,13 +1281,16 @@ class ComponentbuilderModelJoomla_components extends ListModel
$this->info['getKeyFrom']['license'] = $this->info['source']['license'];
$this->info['getKeyFrom']['copyright'] = $this->info['source']['copyright'];
// add buy link if only one link is set
if (isset($this->info['export_buy_link']) && ComponentbuilderHelper::checkArray($this->info['export_buy_link']) && count((array) $this->info['export_buy_link']) == 1)
if (isset($this->info['export_buy_link'])
&& JCBArrayHelper::check($this->info['export_buy_link'])
&& count((array) $this->info['export_buy_link']) == 1)
{
$this->info['getKeyFrom']['buy_link'] = array_values($this->info['export_buy_link'])[0];
}
else
{
// use global if more then one component is exported (since they now have one key), or if none has a buy link
// use global if more then one component is exported
// (since they now have one key), or if none has a buy link
$this->info['getKeyFrom']['buy_link'] = $this->params->get('export_buy_link', null);
}
// no remove the buy links
@ -1294,75 +1298,82 @@ class ComponentbuilderModelJoomla_components extends ListModel
// 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;
// Changed: 25th Feb. 2023 at v3.1.18
// $this->info['phpseclib'] = false;
// we started adding this at v3.1.18
$this->info['phpseclib3'] = true;
}
else
{
// we started adding this at v2.7.7
$this->info['key'] = false;
// we started adding this at v3.0.11 and v2.12.17
$this->info['phpseclib'] = false;
// $this->info['phpseclib'] = false;
// we started adding this at v3.1.18
$this->info['phpseclib3'] = false;
// base 64 encode the data
$data = base64_encode($data);
}
// set the path
$dbPath = $this->packagePath . '/db.vdm';
// write the db data to file in package
if (!ComponentbuilderHelper::writeFile($dbPath, wordwrap($data, 128, "\n", true)))
if (!FileHelper::write($dbPath, wordwrap($data, 128, "\n", true)))
{
return false;
}
// set info data
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael)
// lock the info data
$info = PackageFactory::_('Crypt')->encrypt(json_encode($this->info), 'local');
// set the path
$infoPath = $this->packagePath . '/info.vdm';
// write the info data to file in package
if (!FileHelper::write($infoPath, wordwrap($info, 128, "\n", true)))
{
// 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;
return false;
}
// lock all files
$this->lockFiles();
// remove old zip files with the same name
if (JFile::exists($this->zipPath))
{
// remove file if found
JFile::delete($this->zipPath);
}
// zip the folder
if (!ComponentbuilderHelper::zip($this->packagePath, $this->zipPath))
if (!FileHelper::zip($this->packagePath, $this->zipPath))
{
return false;
}
// move to remote server if needed
if (2 == $this->backupType)
{
if (!ComponentbuilderHelper::moveToServer($this->zipPath, $this->packageName.'.zip', $this->backupServer, null, 'joomla_component.export'))
if (!PackageFactory::_('Server')->legacyMove(
$this->zipPath, $this->packageName.'.zip',
$this->backupServer, null, 'joomla_component.export'
)
)
{
return false;
}
// remove the local file
JFile::delete($this->zipPath);
}
// remove the folder
if (!ComponentbuilderHelper::removeFolder($this->packagePath))
{
return false;
}
return true;
}
return false;
@ -1376,25 +1387,27 @@ class ComponentbuilderModelJoomla_components extends ListModel
protected function lockFiles()
{
// lock the data if set
if (ComponentbuilderHelper::checkString($this->key) && strlen($this->key) == 32)
if (StringHelper::check($this->key) && strlen($this->key) == 32)
{
// 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
$folders = array('images', 'custom', 'dynamic');
// loop the folders
foreach ($folders as $folder)
{
// the sub path
$subPath = $this->packagePath.'/'.$folder;
// go to the package sub folder if found
if (JFolder::exists($subPath))
if (FileHelper::exists($subPath))
{
$this->lock($subPath);
}
}
// change back to working dir
chdir($joomla);
}
@ -1409,16 +1422,21 @@ class ComponentbuilderModelJoomla_components extends ListModel
{
// we are changing the working directory to the tmp path (important)
chdir($tmpPath);
// get a list of files in the current directory tree (all)
$files = JFolder::files('.', '.', true, true);
// read in the file content
foreach ($files as $file)
{
// get file content
$content = FileHelper::getContent($file);
// write the encrypted string back to file
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
}
$content = PackageFactory::_('Crypt')->encrypt($content, 'eac', $this->key);
// store the encrypted file content in the same file
FileHelper::write($file, wordwrap($content, 128, "\n", true));
}
}
@ -1430,10 +1448,11 @@ class ComponentbuilderModelJoomla_components extends ListModel
protected function moveIt($paths, $type, $dynamic = false)
{
// make sure we have an array
if (!ComponentbuilderHelper::checkArray($paths))
if (!JCBArrayHelper::check($paths))
{
return false;
}
// set the name of the folder
if ('file' === $type || 'folder' === $type)
{
@ -1452,19 +1471,22 @@ class ComponentbuilderModelJoomla_components extends ListModel
{
return false;
}
// setup the type path
$tmpPath = str_replace('//', '/', $this->packagePath . '/' . $folderName);
// create type path if not set
if (!JFolder::exists($tmpPath))
if (!FileHelper::exists($tmpPath))
{
// create the folders if not found
JFolder::create($tmpPath);
}
// now move it
foreach ($paths as $item)
{
// make sure we have a string
if (ComponentbuilderHelper::checkString($item))
if (StringHelper::check($item))
{
// if the file type
if ('file' === $type)
@ -1487,14 +1509,16 @@ class ComponentbuilderModelJoomla_components extends ListModel
JFile::copy($customFilePath, $tmpFilePath);
}
}
// if the image type
if ('image' === $type)
{
$imageName = basename($item);
$imagePath = str_replace($imageName, '', $item);
$imageFolderPath = str_replace('//', '/', $this->packagePath.'/'. $imagePath);
// check if image folder exist
if (!JFolder::exists($imageFolderPath))
if (!FileHelper::exists($imageFolderPath))
{
// create the folders if not found
JFolder::create($imageFolderPath);
@ -1507,6 +1531,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
JFile::copy($customImagePath, $tmpImagePath);
}
}
// if the folder type
if ('folder' === $type)
{
@ -1521,7 +1546,8 @@ class ComponentbuilderModelJoomla_components extends ListModel
$tmpFolderPath = str_replace('//', '/', $tmpPath.'/'.$item);
$customFolderPath = str_replace('//', '/', $this->customPath.'/'.$item);
}
if (!JFolder::exists($tmpFolderPath) && JFolder::exists($customFolderPath))
if (!FileHelper::exists($tmpFolderPath) && FileHelper::exists($customFolderPath))
{
// move the folder to its place
JFolder::copy($customFolderPath, $tmpFolderPath,'',true);
@ -1574,14 +1600,14 @@ class ComponentbuilderModelJoomla_components extends ListModel
if (!isset($this->fieldTypes[$id]))
{
$properties = ComponentbuilderHelper::getVar('fieldtype', $id, 'id', 'properties');
if (ComponentbuilderHelper::checkJson($properties))
if (JsonHelper::check($properties))
{
$properties = json_decode($properties, true);
foreach ($properties as $property)
{
if ('type' === $property['name'])
{
if (isset($property['example']) && ComponentbuilderHelper::checkString($property['example']))
if (isset($property['example']) && StringHelper::check($property['example']))
{
$this->fieldTypes[$id] = $property['example'];
break;
@ -1592,7 +1618,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
// if not found
if (!isset($this->fieldTypes[$id]) && $name = ComponentbuilderHelper::getVar('fieldtype', $id, 'id', 'name'))
{
$this->fieldTypes[$id] = ComponentbuilderHelper::safeString($name);
$this->fieldTypes[$id] = StringHelper::safe($name);
}
}
// return the type
@ -1619,31 +1645,31 @@ class ComponentbuilderModelJoomla_components extends ListModel
$default = base64_decode($default);
}
// set the Template data
$temp1 = ComponentbuilderHelper::getAllBetween($default, "\$this->loadTemplate('","')");
$temp2 = ComponentbuilderHelper::getAllBetween($default, '$this->loadTemplate("','")');
$temp1 = GetHelper::allBetween($default, "\$this->loadTemplate('","')");
$temp2 = GetHelper::allBetween($default, '$this->loadTemplate("','")');
$templates = array();
$again = array();
if (ComponentbuilderHelper::checkArray($temp1) && ComponentbuilderHelper::checkArray($temp2))
if (JCBArrayHelper::check($temp1) && JCBArrayHelper::check($temp2))
{
$templates = array_merge($temp1,$temp2);
}
else
{
if (ComponentbuilderHelper::checkArray($temp1))
if (JCBArrayHelper::check($temp1))
{
$templates = $temp1;
}
elseif (ComponentbuilderHelper::checkArray($temp2))
elseif (JCBArrayHelper::check($temp2))
{
$templates = $temp2;
}
}
if (ComponentbuilderHelper::checkArray($templates))
if (JCBArrayHelper::check($templates))
{
foreach ($templates as $template)
{
$data = $this->getDataWithAlias($template, 'template');
if (ComponentbuilderHelper::checkArray($data))
if (JCBArrayHelper::check($data))
{
if (!isset($this->smartIDs['template']) || !isset($this->smartIDs['template'][$data['id']]))
{
@ -1656,29 +1682,29 @@ class ComponentbuilderModelJoomla_components extends ListModel
}
}
// set the layout data
$lay1 = ComponentbuilderHelper::getAllBetween($default, "JLayoutHelper::render('","',");
$lay2 = ComponentbuilderHelper::getAllBetween($default, 'JLayoutHelper::render("','",');
if (ComponentbuilderHelper::checkArray($lay1) && ComponentbuilderHelper::checkArray($lay2))
$lay1 = GetHelper::allBetween($default, "JLayoutHelper::render('","',");
$lay2 = GetHelper::allBetween($default, 'JLayoutHelper::render("','",');
if (JCBArrayHelper::check($lay1) && JCBArrayHelper::check($lay2))
{
$layouts = array_merge($lay1,$lay2);
}
else
{
if (ComponentbuilderHelper::checkArray($lay1))
if (JCBArrayHelper::check($lay1))
{
$layouts = $lay1;
}
elseif (ComponentbuilderHelper::checkArray($lay2))
elseif (JCBArrayHelper::check($lay2))
{
$layouts = $lay2;
}
}
if (isset($layouts) && ComponentbuilderHelper::checkArray($layouts))
if (isset($layouts) && JCBArrayHelper::check($layouts))
{
foreach ($layouts as $layout)
{
$data = $this->getDataWithAlias($layout, 'layout');
if (ComponentbuilderHelper::checkArray($data))
if (JCBArrayHelper::check($data))
{
if (!isset($this->smartIDs['layout']) || !isset($this->smartIDs['layout'][$data['id']]))
{
@ -1690,7 +1716,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
}
}
}
if (ComponentbuilderHelper::checkArray($again))
if (JCBArrayHelper::check($again))
{
foreach ($again as $get)
{
@ -1701,12 +1727,12 @@ class ComponentbuilderModelJoomla_components extends ListModel
if ($user)
{
// add templates
if (isset($this->smartIDs['template']) && ComponentbuilderHelper::checkArray($this->smartIDs['template']))
if (isset($this->smartIDs['template']) && JCBArrayHelper::check($this->smartIDs['template']))
{
$this->setData('template', array_values($this->smartIDs['template']), 'id');
}
// add layouts
if (isset($this->smartIDs['layout']) && ComponentbuilderHelper::checkArray($this->smartIDs['layout']))
if (isset($this->smartIDs['layout']) && JCBArrayHelper::check($this->smartIDs['layout']))
{
$this->setData('layout', array_values($this->smartIDs['layout']), 'id');
}
@ -1733,7 +1759,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
$rows = $this->_db->loadObjectList();
foreach ($rows as $row)
{
$k_ey = ComponentbuilderHelper::safeString($row->alias);
$k_ey = StringHelper::safe($row->alias);
$key = preg_replace("/[^A-Za-z]/", '', $k_ey);
$name = preg_replace("/[^A-Za-z]/", '', $n_ame);
if ($k_ey == $n_ame || $key == $name)
@ -1794,8 +1820,8 @@ class ComponentbuilderModelJoomla_components extends ListModel
if ('custom_code' === $type)
{
// search the value to see if it has custom code
$codeArray = ComponentbuilderHelper::getAllBetween($value, '[CUSTOMC' . 'ODE=',']');
if (ComponentbuilderHelper::checkArray($codeArray))
$codeArray = GetHelper::allBetween($value, '[CUSTOMC' . 'ODE=',']');
if (JCBArrayHelper::check($codeArray))
{
foreach ($codeArray as $func)
{
@ -1813,7 +1839,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
{
$this->setSmartIDs($func, $type);
}
elseif (ComponentbuilderHelper::checkString($func))
elseif (StringHelper::check($func))
{
if (($funcID = ComponentbuilderHelper::getVar($type, $func, 'function_name', 'id')) !== false && is_numeric($funcID))
{
@ -1831,12 +1857,12 @@ class ComponentbuilderModelJoomla_components extends ListModel
elseif ('placeholder' === $type)
{
// check if we already have the placeholder search array
if (!componentbuilderHelper::checkArray($this->placeholderM) && !componentbuilderHelper::checkArray($this->placeholderS))
if (!JCBArrayHelper::check($this->placeholderM) && !JCBArrayHelper::check($this->placeholderS))
{
$this->placeholderS = ComponentbuilderHelper::getVars($type, 1, 'published', 'target');
}
// only continue search if placeholders found
if (componentbuilderHelper::checkArray($this->placeholderS))
if (JCBArrayHelper::check($this->placeholderS))
{
foreach ($this->placeholderS as $remove => $placeholder)
{
@ -1899,7 +1925,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
{
$items = $this->_db->loadObjectList();
// check if we have items
if (ComponentbuilderHelper::checkArray($items))
if (JCBArrayHelper::check($items))
{
if (!isset($this->smartBox['language_translation']))
{
@ -1907,7 +1933,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
}
foreach ($items as $item)
{
if (!isset($this->smartBox['language_translation'][$item->id]) && ComponentbuilderHelper::checkJson($item->{$target}))
if (!isset($this->smartBox['language_translation'][$item->id]) && JsonHelper::check($item->{$target}))
{
$targets = json_decode($item->{$target}, true);
if (in_array($id, $targets))
@ -1940,11 +1966,11 @@ class ComponentbuilderModelJoomla_components extends ListModel
{
if (isset($item->system_name))
{
return ComponentbuilderHelper::safeString($item->system_name, 'cAmel');
return StringHelper::safe($item->system_name, 'cAmel');
}
else
{
return ComponentbuilderHelper::safeString($item->name_code);
return StringHelper::safe($item->name_code);
}
}
}
@ -2747,7 +2773,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_joomla_component");
if (ComponentbuilderHelper::checkArray($columns))
if (JCBArrayHelper::check($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);

File diff suppressed because one or more lines are too long

View File

@ -213,14 +213,14 @@ jQuery('<div id="loading"></div>')
</div>
<?php if ($hasOwner): ?>
<div class="well span6">
<?php echo ComponentbuilderHelper::getPackageOwnerDetailsDisplay($this->packageInfo); ?>
<?php echo \VDM\Joomla\Componentbuilder\Package\Factory::_('Display.Details')->owner($this->packageInfo); ?>
</div>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if (isset($this->packageInfo['name']) && ComponentbuilderHelper::checkArray($this->packageInfo['name'])) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'jcbImportTab', 'info', JText::sprintf('COM_COMPONENTBUILDER_S_BEING_IMPORTED', $comP)); ?>
<?php echo ComponentbuilderHelper::getPackageComponentsDetailsDisplay($this->packageInfo); ?>
<?php echo \VDM\Joomla\Componentbuilder\Package\Factory::_('Display.Details')->components($this->packageInfo); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="4" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>12th February, 2023</creationDate>
<creationDate>27th February, 2023</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://dev.vdm.io</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>3.1.17</version>
<version>3.1.19</version>
<description><![CDATA[
<h1>Component Builder (v.3.1.17)</h1>
<h1>Component Builder (v.3.1.19)</h1>
<div style="clear: both;"></div>
<p>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.

View File

@ -1115,10 +1115,10 @@
<element>pkg_component_builder</element>
<type>package</type>
<client>site</client>
<version>3.1.17</version>
<version>3.1.19</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.17.zip</downloadurl>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.19.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>

View File

@ -56,9 +56,6 @@ abstract class BaseConfig extends JoomlaRegistry
$this->input = $input ?: Factory::getApplication()->input;
$this->params = $params ?: Helper::getParams('com_componentbuilder');
// use underscore as the separator
$this->separator = '_';
// Instantiate the internal data object.
$this->data = new \stdClass();
}

View File

@ -31,6 +31,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Sqltweaking;
use VDM\Joomla\Componentbuilder\Compiler\Model\Adminviews;
use VDM\Joomla\Componentbuilder\Compiler\Model\Siteviews;
use VDM\Joomla\Componentbuilder\Compiler\Model\Customadminviews;
use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver;
use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlamodules;
use VDM\Joomla\Componentbuilder\Compiler\Model\Joomlaplugins;
use VDM\Joomla\Utilities\StringHelper;
@ -182,6 +183,14 @@ class Data
*/
protected Customadminviews $customadminviews;
/**
* The modelling Update Server
*
* @var Updateserver
* @since 3.2.0
*/
protected Updateserver $updateserver;
/**
* The modelling Joomla Modules
*
@ -226,6 +235,7 @@ class Data
* @param Adminviews|null $adminviews The modelling adminviews object.
* @param Siteviews|null $siteviews The modelling siteviews object.
* @param Customadminviews|null $customadminviews The modelling customadminviews object.
* @param Updateserver|null $updateserver The modelling update server object.
* @param Joomlamodules|null $modules The modelling modules object.
* @param Joomlaplugins|null $plugins The modelling plugins object.
* @param \JDatabaseDriver|null $db The database object.
@ -238,8 +248,8 @@ class Data
?Field $field = null, ?FieldName $fieldName = null, ?UniqueName $uniqueName = null,
?Filesfolders $filesFolders = null, ?Historycomponent $history = null, ?Whmcs $whmcs = null,
?Sqltweaking $sqltweaking = null, ?Adminviews $adminviews = null, ?Siteviews $siteviews = null,
?Customadminviews $customadminviews = null, ?Joomlamodules $modules = null,
?Joomlaplugins $plugins = null, ?\JDatabaseDriver $db = null)
?Customadminviews $customadminviews = null, ?Updateserver $updateserver = null,
?Joomlamodules $modules = null, ?Joomlaplugins $plugins = null, ?\JDatabaseDriver $db = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->event = $event ?: Compiler::_('Event');
@ -258,6 +268,7 @@ class Data
$this->adminviews = $adminviews ?: Compiler::_('Model.Adminviews');
$this->siteviews = $siteviews ?: Compiler::_('Model.Siteviews');
$this->customadminviews = $customadminviews ?: Compiler::_('Model.Customadminviews');
$this->updateserver = $updateserver ?: Compiler::_('Model.Updateserver');
$this->modules = $modules ?: Compiler::_('Model.Joomlamodules');
$this->plugins = $plugins ?: Compiler::_('Model.Joomlaplugins');
$this->db = $db ?: Factory::getDbo();
@ -397,10 +408,10 @@ class Data
$this->whmcs->set($component);
// set the footable switch
if ($component->addfootable)
if ($component->addfootable > 0)
{
// force add footable
$this->config->set('footable ', true);
$this->config->set('footable', true);
// add the version
$this->config->set('footable_version', (3 == $component->addfootable) ? 3 : 2);
}
@ -472,15 +483,7 @@ class Data
unset($component->addcontributors);
// set the version updates
$component->version_update = (isset($component->version_update)
&& JsonHelper::check($component->version_update))
? json_decode((string) $component->version_update, true) : null;
if (ArrayHelper::check($component->version_update))
{
$component->version_update = array_values(
$component->version_update
);
}
$this->updateserver->set($component);
// build the build date
if ($this->config->get('add_build_date', 1) == 3)
@ -569,11 +572,8 @@ class Data
{
foreach ($addScriptTypes as $scriptType)
{
if (isset(
$component->{'add_' . $scriptMethod . '_' . $scriptType}
)
&& $component->{'add_' . $scriptMethod . '_' . $scriptType}
== 1
if (isset($component->{'add_' . $scriptMethod . '_' . $scriptType})
&& $component->{'add_' . $scriptMethod . '_' . $scriptType} == 1
&& StringHelper::check(
$component->{$scriptMethod . '_' . $scriptType}
))
@ -795,14 +795,24 @@ class Data
// reset back to now lang
$this->config->lang_target = $nowLang;
// catch empty URL to update server TODO: we need to fix this in better way later
if ($component->add_update_server == 1 && $component->update_server_target !== 3
&& (
!StringHelper::check($component->update_server_url)
|| strpos($component->update_server_url, 'http') === false
))
{
// we fall back to other, since we can't work with an empty update server URL
$component->add_update_server = 0;
$component->update_server_target = 3;
}
// add the update/sales server FTP details if that is the expected protocol
$serverArray = array('update_server', 'sales_server');
foreach ($serverArray as $server)
{
if ($component->{'add_' . $server} == 1
&& is_numeric(
$component->{$server}
)
&& is_numeric($component->{$server})
&& $component->{$server} > 0)
{
// get the server protocol

View File

@ -192,6 +192,9 @@ class Structuresingle
// do README check
$README = $this->doReadmeCheck();
// do CHANGELOG check
$CHANGELOG = $this->doChangelogCheck();
// start moving
foreach ($this->settings->single() as $target => $details)
{
@ -208,6 +211,12 @@ class Structuresingle
continue;
}
// if not needed do not add
if ($details->naam === 'CHANGELOG.md' && !$CHANGELOG)
{
continue;
}
// set new name
$this->setNewName($details);
@ -264,12 +273,18 @@ class Structuresingle
*/
private function doReadmeCheck(): bool
{
if ($this->component->get('addreadme', false))
{
return true;
}
return (bool) $this->component->get('addreadme', false);
}
return false;
/**
* Check if changelog must be added
*
* @return bool
* @since 3.2.0
*/
private function doChangelogCheck(): bool
{
return (bool) $this->component->get('changelog', false);
}
/**

View File

@ -213,7 +213,7 @@ interface PlaceholderInterface
* @return string
* @since 3.2.0
*/
public function update(string $data, array &$placeholder, int $action = 1): string;
public function update(string $data, array $placeholder, int $action = 1): string;
/**
* Update the data with the active placeholders

View File

@ -813,50 +813,47 @@ class Data
$this->libraries->set($module->code_name, $module);
// add PHP in module install
$module->add_install_script = false;
$addScriptMethods = array('php_preflight',
$module->add_install_script = true;
$addScriptMethods = [
'php_script',
'php_preflight',
'php_postflight',
'php_method');
$addScriptTypes = array('install', 'update',
'uninstall');
'php_method'
];
$addScriptTypes = [
'install',
'update',
'uninstall'
];
// the next are php placeholders
$guiMapper['type'] = 'php';
foreach ($addScriptMethods as $scriptMethod)
{
foreach ($addScriptTypes as $scriptType)
{
if (isset(
$module->{'add_' . $scriptMethod . '_'
. $scriptType}
)
&& $module->{'add_' . $scriptMethod . '_'
. $scriptType} == 1
if (isset($module->{'add_' . $scriptMethod . '_' . $scriptType})
&& $module->{'add_' . $scriptMethod . '_' . $scriptType} == 1
&& StringHelper::check(
$module->{$scriptMethod . '_' . $scriptType}
))
{
// set GUI mapper field
$guiMapper['field'] = $scriptMethod . '_'
. $scriptType;
$guiMapper['field'] = $scriptMethod . '_' . $scriptType;
$module->{$scriptMethod . '_' . $scriptType} = $this->gui->set(
$this->placeholder->update_(
$this->customcode->update(
base64_decode(
(string) $module->{$scriptMethod . '_'
. $scriptType}
(string) $module->{$scriptMethod . '_' . $scriptType}
)
)
),
$guiMapper
);
$module->add_install_script = true;
}
else
{
unset($module->{$scriptMethod . '_' . $scriptType});
$module->{'add_' . $scriptMethod . '_'
. $scriptType}
= 0;
$module->{'add_' . $scriptMethod . '_' . $scriptType} = 0;
}
}
}

View File

@ -307,19 +307,17 @@ class Structure
// set install script if needed
if ($module->add_install_script)
{
$fileDetails = array('path' => $module->folder_path
. '/script.php',
'name' => 'script.php',
'zip' => 'script.php');
$fileDetails = [
'path' => $module->folder_path . '/script.php',
'name' => 'script.php',
'zip' => 'script.php'
];
$this->file->write(
$fileDetails['path'],
'<?php' . PHP_EOL . '// Script template' .
PHP_EOL . Placefix::_h('BOM') . PHP_EOL
.
PHP_EOL . '// No direct access to this file'
. PHP_EOL .
"defined('_JEXEC') or die('Restricted access');"
. PHP_EOL .
PHP_EOL . Placefix::_h('BOM') . PHP_EOL .
PHP_EOL . '// No direct access to this file' . PHP_EOL .
"defined('_JEXEC') or die('Restricted access');" . PHP_EOL .
Placefix::_h('INSTALLCLASS')
);
$this->files->appendArray($module->key, $fileDetails);
@ -331,10 +329,11 @@ class Structure
// set readme if found
if ($module->addreadme)
{
$fileDetails = array('path' => $module->folder_path
. '/README.md',
'name' => 'README.md',
'zip' => 'README.md');
$fileDetails = [
'path' => $module->folder_path . '/README.md',
'name' => 'README.md',
'zip' => 'README.md'
];
$this->file->write($fileDetails['path'], $module->readme);
$this->files->appendArray($module->key, $fileDetails);
@ -369,10 +368,11 @@ class Structure
$this->folder->create($module->folder_path . '/css');
// add the CSS file
$fileDetails = array('path' => $module->folder_path
. '/css/mod_admin.css',
'name' => 'mod_admin.css',
'zip' => 'mod_admin.css');
$fileDetails = [
'path' => $module->folder_path . '/css/mod_admin.css',
'name' => 'mod_admin.css',
'zip' => 'mod_admin.css'
];
$this->file->write(
$fileDetails['path'],
Placefix::_h('BOM') . PHP_EOL
@ -409,10 +409,11 @@ class Structure
$this->folder->create($module->folder_path . '/js');
// add the CSS file
$fileDetails = array('path' => $module->folder_path
. '/js/mod_admin.js',
'name' => 'mod_admin.js',
'zip' => 'mod_admin.js');
$fileDetails = [
'path' => $module->folder_path . '/js/mod_admin.js',
'name' => 'mod_admin.js',
'zip' => 'mod_admin.js'
];
$this->file->write(
$fileDetails['path'],
Placefix::_h('BOM') . PHP_EOL
@ -484,11 +485,11 @@ class Structure
foreach ($module->form_files as $file => $fields)
{
// set file details
$fileDetails = array('path' => $module->folder_path
. '/forms/' . $file . '.xml',
'name' => $file . '.xml',
'zip' => 'forms/' . $file
. '.xml');
$fileDetails = [
'path' => $module->folder_path . '/forms/' . $file . '.xml',
'name' => $file . '.xml',
'zip' => 'forms/' . $file . '.xml'
];
// build basic XML
$xml = '<?xml version="1.0" encoding="utf-8"?>';

View File

@ -735,49 +735,44 @@ class Data
$this->filesFolders->set($plugin);
// add PHP in plugin install
$plugin->add_install_script = false;
$addScriptMethods = array('php_preflight',
$plugin->add_install_script = true;
$addScriptMethods = [
'php_preflight',
'php_postflight',
'php_method');
$addScriptTypes = array('install', 'update',
'uninstall');
'php_method'
];
$addScriptTypes = [
'install',
'update',
'uninstall'
];
foreach ($addScriptMethods as $scriptMethod)
{
foreach ($addScriptTypes as $scriptType)
{
if (isset(
$plugin->{'add_' . $scriptMethod . '_'
. $scriptType}
)
&& $plugin->{'add_' . $scriptMethod . '_'
. $scriptType} == 1
if (isset( $plugin->{'add_' . $scriptMethod . '_' . $scriptType})
&& $plugin->{'add_' . $scriptMethod . '_' . $scriptType} == 1
&& StringHelper::check(
$plugin->{$scriptMethod . '_' . $scriptType}
))
{
// set GUI mapper field
$guiMapper['field'] = $scriptMethod . '_'
. $scriptType;
$plugin->{$scriptMethod . '_' . $scriptType}
= $this->gui->set(
$guiMapper['field'] = $scriptMethod . '_' . $scriptType;
$plugin->{$scriptMethod . '_' . $scriptType} = $this->gui->set(
$this->placeholder->update_(
$this->customcode->update(
base64_decode(
(string) $plugin->{$scriptMethod . '_'
. $scriptType}
(string) $plugin->{$scriptMethod . '_' . $scriptType}
)
)
),
$guiMapper
);
$plugin->add_install_script = true;
}
else
{
unset($plugin->{$scriptMethod . '_' . $scriptType});
$plugin->{'add_' . $scriptMethod . '_'
. $scriptType}
= 0;
$plugin->{'add_' . $scriptMethod . '_' . $scriptType} = 0;
}
}
}

View File

@ -228,19 +228,17 @@ class Structure
// set install script if needed
if ($plugin->add_install_script)
{
$fileDetails = array('path' => $plugin->folder_path
. '/script.php',
'name' => 'script.php',
'zip' => 'script.php');
$fileDetails = [
'path' => $plugin->folder_path . '/script.php',
'name' => 'script.php',
'zip' => 'script.php'
];
$this->file->write(
$fileDetails['path'],
'<?php' . PHP_EOL . '// Script template' .
PHP_EOL . Placefix::_h('BOM') . PHP_EOL
.
PHP_EOL . '// No direct access to this file'
. PHP_EOL .
"defined('_JEXEC') or die('Restricted access');"
. PHP_EOL .
PHP_EOL . Placefix::_h('BOM') . PHP_EOL .
PHP_EOL . '// No direct access to this file' . PHP_EOL .
"defined('_JEXEC') or die('Restricted access');" . PHP_EOL .
Placefix::_h('INSTALLCLASS')
);
$this->files->appendArray($plugin->key, $fileDetails);
@ -252,10 +250,11 @@ class Structure
// set readme if found
if ($plugin->addreadme)
{
$fileDetails = array('path' => $plugin->folder_path
. '/README.md',
'name' => 'README.md',
'zip' => 'README.md');
$fileDetails = [
'path' => $plugin->folder_path . '/README.md',
'name' => 'README.md',
'zip' => 'README.md'
];
$this->file->write($fileDetails['path'], $plugin->readme);
$this->files->appendArray($plugin->key, $fileDetails);
@ -287,11 +286,11 @@ class Structure
foreach ($plugin->form_files as $file => $fields)
{
// set file details
$fileDetails = array('path' => $plugin->folder_path
. '/forms/' . $file . '.xml',
'name' => $file . '.xml',
'zip' => 'forms/' . $file
. '.xml');
$fileDetails = [
'path' => $plugin->folder_path . '/forms/' . $file . '.xml',
'name' => $file . '.xml',
'zip' => 'forms/' . $file . '.xml'
];
// build basic XML
$xml = '<?xml version="1.0" encoding="utf-8"?>';

View File

@ -79,7 +79,7 @@ class Loader
$this->registry->
set('builder.footable_scripts.' . $target . '.' . $key, true);
$this->config->set('footable ', true);
$this->config->set('footable', true);
}
}

View File

@ -0,0 +1,102 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Registry;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Model Joomla Update Server Class
*
* @since 3.2.0
*/
class Updateserver
{
/**
* Compiler Registry Class
*
* @var Registry
* @since 3.2.0
*/
protected Registry $registry;
/**
* Constructor
*
* @param Registry|null $registry The compiler registry object.
*
* @since 3.2.0
*/
public function __construct(?Registry $registry = null)
{
$this->registry = $registry ?: Compiler::_('Registry');
}
/**
* Set version updates
*
* @param object $item The item data
*
* @return void
* @since 3.2.0
*/
public function set(object &$item)
{
// set the version updates
$item->version_update = (isset($item->version_update)
&& JsonHelper::check($item->version_update))
? json_decode((string) $item->version_update, true) : null;
if (ArrayHelper::check($item->version_update))
{
$item->version_update = array_values(
$item->version_update
);
// set the change log details
$this->changelog($item);
}
}
/**
* Set changelog values to registry
*
* @param array $updates The update data
*
* @return void
* @since 3.2.0
*/
protected function changelog(object &$item)
{
// set the version updates
foreach ($item->version_update as $update)
{
$bucket = [];
if (isset($update['change_log']) && StringHelper::check($update['change_log'])
&& isset($update['version']) && StringHelper::check($update['version']))
{
$bucket[] = '# v' . $update['version'] . PHP_EOL . PHP_EOL . $update['change_log'];
}
}
if (ArrayHelper::check($bucket))
{
$item->changelog = implode(PHP_EOL . PHP_EOL, $bucket);
}
}
}

View File

@ -368,7 +368,7 @@ class Placeholder implements PlaceholderInterface
* @return string
* @since 3.2.0
*/
public function update(string $data, array &$placeholder, int $action = 1): string
public function update(string $data, array $placeholder, int $action = 1): string
{
// make sure the placeholders is an array
if (!ArrayHelper::check($placeholder))

View File

@ -162,6 +162,7 @@ class Component implements ServiceProviderInterface
$container->get('Model.Adminviews'),
$container->get('Model.Siteviews'),
$container->get('Model.Customadminviews'),
$container->get('Model.Updateserver'),
$container->get('Model.Joomlamodules'),
$container->get('Model.Joomlaplugins')
);

View File

@ -52,6 +52,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Whmcs;
use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders;
use VDM\Joomla\Componentbuilder\Compiler\Model\Modifieddate;
use VDM\Joomla\Componentbuilder\Compiler\Model\Createdate;
use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver;
/**
@ -173,15 +174,18 @@ class Model implements ServiceProviderInterface
$container->alias(Whmcs::class, 'Model.Whmcs')
->share('Model.Whmcs', [$this, 'getModelWhmcs'], true);
$container->alias(Filesfolders::class, 'Model.Filesfolders')
->share('Model.Filesfolders', [$this, 'getModelFilesfolders'], true);
$container->alias(Modifieddate::class, 'Model.Modifieddate')
->share('Model.Modifieddate', [$this, 'getModifieddate'], true);
$container->alias(Createdate::class, 'Model.Createdate')
->share('Model.Createdate', [$this, 'getCreatedate'], true);
$container->alias(Updateserver::class, 'Model.Updateserver')
->share('Model.Updateserver', [$this, 'getUpdateserver'], true);
$container->alias(Filesfolders::class, 'Model.Filesfolders')
->share('Model.Filesfolders', [$this, 'getModelFilesfolders'], true);
$container->alias(ServerLoad::class, 'Model.Server.Load')
->share('Model.Server.Load', [$this, 'getServerLoad'], true);
}
@ -758,6 +762,21 @@ class Model implements ServiceProviderInterface
return new Createdate();
}
/**
* Get the update server Model
*
* @param Container $container The DI container.
*
* @return Updateserver
* @since 3.2.0
*/
public function getUpdateserver(Container $container): Updateserver
{
return new Updateserver(
$container->get('Registry')
);
}
/**
* Get the files folders Model
*

View File

@ -13,7 +13,11 @@ namespace VDM\Joomla\Componentbuilder;
use VDM\Joomla\Componentbuilder\Crypt\FOF;
use VDM\Joomla\Componentbuilder\Crypt\Aes;
use VDM\Joomla\Componentbuilder\Crypt\Aes\Legacy;
use VDM\Joomla\Componentbuilder\Crypt\Password;
use VDM\Joomla\Componentbuilder\Interfaces\Cryptinterface;
use VDM\Joomla\Utilities\StringHelper;
/**
@ -32,6 +36,22 @@ class Crypt
*/
protected FOF $fof;
/**
* The Crypt AES CBC class
*
* @var Aes
* @since 3.2.0
*/
protected Aes $aes;
/**
* The Crypt AES Legacy class
*
* @var Legacy
* @since 3.2.0
*/
protected Legacy $legacy;
/**
* The Password class
*
@ -46,7 +66,11 @@ class Crypt
* @var array
* @since 3.2.0
*/
protected array $options = ['basic' => true, 'medium' => true];
protected array $options = [
'basic' => 'fof',
'medium' => 'fof',
'local' => 'aes'
];
/**
* Active passwords
@ -54,19 +78,23 @@ class Crypt
* @var array
* @since 3.2.0
*/
protected array $passwords = ['basic' => null, 'medium' => null];
protected array $passwords = [];
/**
* Constructor
*
* @param FOF $fof The FOF class
* @param Aes $aes The AES CBC class
* @param Legacy $legacy The AES Legacy class
* @param Password $password The Password class
*
* @since 3.2.0
*/
public function __construct(FOF $fof, Password $password)
public function __construct(FOF $fof, Aes $aes, Legacy $legacy, Password $password)
{
$this->fof = $fof;
$this->aes = $aes;
$this->legacy = $legacy;
$this->password = $password;
}
@ -74,18 +102,19 @@ class Crypt
* Encrypt a string as needed
*
* @param string $string The string to encrypt
* @param string $method The encryption method to use
* @param string|null $default The default password
* @param string $method The encryption method to use
* @param string|null $password The password
*
* @return string
* @since 3.2.0
**/
public function encrypt(string $string, string $method,
?string $default = null): string
?string $password = null): string
{
if (($password = $this->getPassword($method, $default)) !== null)
if (($password = $this->getPassword($method, $password)) !== null
&& ($name = $this->getClassName($method)) !== null)
{
return $this->fof->encrypt($string, $password);
return $this->{$name}->encrypt($string, $password);
}
return $string;
@ -104,49 +133,152 @@ class Crypt
public function decrypt(string $string, string $method,
?string $default = null): string
{
if (($password = $this->getPassword($method, $default)) !== null)
if (($password = $this->getPassword($method, $default)) !== null
&& ($name = $this->getClassName($method)) !== null)
{
return $this->fof->decrypt($string, $password);
return $this->{$name}->decrypt($string, $password);
}
return $string;
}
/**
* Check if a decryption method exist and is supported
*
* @param string $method The encryption method to find
*
* @return bool true it it exist
* Check if a decryption method exist and is supported
*
* @param string $method The encryption method to find
*
* @return bool true if it exist
* @since 3.2.0
**/
**/
public function exist(string $method): bool
{
return $this->options[$method] ?? false;
return is_string($this->getClassName($method)) ?? false;
}
/**
* Get crypto class name to use
*
* @param string $method The encryption method to find
*
* @return string|null The crypto class name
* @since 3.2.0
**/
private function getClassName(string $method): ?string
{
if (($name = $this->getClassNameFromRegistry($method)) !== null)
{
return $name;
}
return $this->getClassNameFromOptions($method);
}
/**
* Get the crypto class name from the registry
*
* @param string $method The encryption method to use
*
* @return string|null The crypto class name, or null if not found
* @since 3.2.0
**/
private function getClassNameFromRegistry(string $method): ?string
{
$name = $this->name($method);
if (isset($this->{$name}) && $this->{$name} instanceof Cryptinterface)
{
return $name;
}
return null;
}
/**
* Get the crypto class name for the given encryption method and options
*
* @param string $method The encryption method to use
*
* @return string|null The crypto class name, or null if not found
* @since 3.2.0
**/
private function getClassNameFromOptions(string $method): ?string
{
$key = $this->getPasswordKey($method);
if (isset($this->options[$key]))
{
$name = $this->options[$key];
if (isset($this->{$name}) && $this->{$name} instanceof Cryptinterface)
{
return $name;
}
}
return null;
}
/**
* Get the password
*
* @param string $method The encryption method to find
* @param string|null $default The default password
* @param string $method The encryption method to find
* @param string|null $password The password
*
* @return string|null the password or null
* @since 3.2.0
**/
protected function getPassword(string $method, ?string $default = null): ?string
private function getPassword(string $method, ?string $password = null): ?string
{
if ($this->exist($method))
if (StringHelper::check($password))
{
if (empty($this->passwords[$method]))
{
$this->passwords[$method] = $this->password->get($method, $default);
}
return $this->passwords[$method];
return $password;
}
return null;
// get password key name
$key = $this->getPasswordKey($method);
if (empty($this->passwords[$key]))
{
$this->passwords[$key] = $this->password->get($key);
}
return $this->passwords[$key];
}
/**
* Get the key
*
* @param string $method The encryption method to find
*
* @return string the password key name
* @since 3.2.0
**/
private function getPasswordKey(string $method): string
{
if (($pos = strpos($method, '.')) !== false)
{
return substr($method, 0, $pos);
}
return $method;
}
/**
* Get the class name
*
* @param string $method The encryption method to find
*
* @return string the class name
* @since 3.2.0
**/
private function name(string $method): string
{
if (($pos = strpos($method, '.')) !== false)
{
return substr($method, $pos + 1);
}
return $method;
}
}

View File

@ -0,0 +1,131 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Crypt;
use phpseclib3\Crypt\AES as BASEAES;
use VDM\Joomla\Componentbuilder\Crypt\Random;
use VDM\Joomla\Componentbuilder\Interfaces\Cryptinterface;
/**
* Class for Aes Encryption
*
* @since 3.2.0
*/
class Aes implements Cryptinterface
{
/**
* The Aes class
*
* @var BASEAES
* @since 3.2.0
*/
protected BASEAES $aes;
/**
* The Random class
*
* @var Random
* @since 3.2.0
*/
protected Random $random;
/**
* The block size
*
* @var int
* @since 3.2.0
*/
protected int $size = 256;
/**
* Constructor
*
* @param BASEAES $aes The Aes class
* @param Random $random The Random class
*
* @since 3.2.0
*/
public function __construct(BASEAES $aes, Random $random)
{
$this->aes = $aes;
$this->random = $random;
// we set the length once
$this->aes->setKeyLength($this->size);
// enable padding
$this->aes->enablePadding();
}
/**
* Encrypt a string as needed
*
* @param string $string The string to encrypt
* @param string $key The encryption key
*
* @return string
* @since 3.2.0
**/
public function encrypt(string $string, string $key): string
{
// we get the IV length
$iv_length = (int) $this->aes->getBlockLength() >> 3;
// get the IV value
$iv = $this->random::string($iv_length);
// Load the IV
$this->aes->setIV($iv);
// set the password
$this->aes->setPassword($key, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt');
// encrypt the string, and base 64 encode the result
return base64_encode($iv . $this->aes->encrypt($string));
}
/**
* Decrypt a string as needed
*
* @param string $string The string to decrypt
* @param string $key The decryption key
*
* @return string
* @since 3.2.0
**/
public function decrypt(string $string, string $key): string
{
// we get the IV length
$iv_length = (int) $this->aes->getBlockLength() >> 3;
// remove base 64 encoding
$string = base64_decode($string);
// get the IV
$iv = substr($string, 0, $iv_length);
// remove the IV
$string = substr($string, $iv_length);
// set the IV
$this->aes->setIV($iv);
// set the password
$this->aes->setPassword($key, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt');
return $this->aes->decrypt($string);
}
}

View File

@ -0,0 +1,117 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Crypt\Aes;
use phpseclib3\Crypt\AES as BASEAES;
use VDM\Joomla\Componentbuilder\Interfaces\Cryptinterface;
/**
* Legacy Class for Aes Encryption
*
* @since 3.2.0
*/
class Legacy implements Cryptinterface
{
/**
* The Aes class
*
* @var BASEAES
* @since 3.2.0
*/
protected BASEAES $aes;
/**
* The block size
*
* @var int
* @since 3.2.0
*/
protected int $size = 128;
/**
* Constructor
*
* @param BASEAES $aes The Aes class
*
* @since 3.2.0
*/
public function __construct(BASEAES $aes)
{
$this->aes = $aes;
// we set the length once
$this->aes->setKeyLength($this->size);
// enable padding
$this->aes->enablePadding();
}
/**
* Encrypt a string as needed
*
* @param string $string The string to encrypt
* @param string $key The encryption key
*
* @return string
* @since 3.2.0
**/
public function encrypt(string $string, string $key): string
{
// we get the IV length
$iv_length = (int) $this->aes->getBlockLength() >> 3;
// get the IV value
$iv = str_repeat("\0", $iv_length);
// Load the IV
$this->aes->setIV($iv);
// set the password
$this->aes->setPassword($key, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt');
// encrypt the string, and base 64 encode the result
return base64_encode($this->aes->encrypt($string));
}
/**
* Decrypt a string as needed
*
* @param string $string The string to decrypt
* @param string $key The decryption key
*
* @return string
* @since 3.2.0
**/
public function decrypt(string $string, string $key): string
{
// remove base 64 encoding
$string = base64_decode($string);
// we get the IV length
$iv_length = (int) $this->aes->getBlockLength() >> 3;
// get the IV value
$iv = str_repeat("\0", $iv_length);
// Load the IV
$this->aes->setIV($iv);
// set the password
$this->aes->setPassword($key, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt');
return $this->aes->decrypt($string);
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -12,6 +12,7 @@
namespace VDM\Joomla\Componentbuilder\Crypt;
use Joomla\CMS\Language\Text;
use VDM\Joomla\Utilities\Component\Helper;
@ -34,13 +35,34 @@ class Password
*/
public function get(string $type, ?string $default = null): ?string
{
if (($password = Helper::_('getCryptKey', [$type, $default])) !== null)
// we have a local key for JCB only use
if ('local' === $type)
{
return $this->local();
}
elseif (($password = Helper::_('getCryptKey', [$type, $default])) !== null)
{
return $password;
}
return $default;
}
/**
* Get the local password
*
* @return string
* @since 3.2.0
*/
private function local(): string
{
return base64_decode(
Text::sprintf(
'COM_COMPONENTBUILDER_VJRZDESSMHBTRWFIFTYTWVZEROAESFLVVXJTMTHREEJTWOIXM',
'QzdmV', '9kQ'
)
);
}
}

View File

@ -0,0 +1,281 @@
<?php
/**
* @package FrameworkOnFramework
* @subpackage encrypt
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author.
*/
namespace VDM\Joomla\Componentbuilder\Package\Display;
use Joomla\CMS\Language\Text;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
/**
* Package Display Details Class
*
* @since 3.2.0
*/
class Details
{
/**
* The Owner details template
*
* @var array
* @since 3.2.0
*/
private array $owner = [
'company' => 'COM_COMPONENTBUILDER_DTCOMPANYDTDDSDD',
'owner' => 'COM_COMPONENTBUILDER_DTOWNERDTDDSDD',
'email' => 'COM_COMPONENTBUILDER_DTEMAILDTDDSDD',
'website' => 'COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD',
'license' => 'COM_COMPONENTBUILDER_DTLICENSEDTDDSDD',
'copyright' => 'COM_COMPONENTBUILDER_DTCOPYRIGHTDTDDSDD'
];
/**
* The Component details template
*
* @var array
* @since 3.2.0
*/
private array $component = [
'ul' => [
'companyname' => 'COM_COMPONENTBUILDER_ICOMPANYI_BSB',
'author' => 'COM_COMPONENTBUILDER_IAUTHORI_BSB',
'email' => 'COM_COMPONENTBUILDER_IEMAILI_BSB',
'website' => 'COM_COMPONENTBUILDER_IWEBSITEI_BSB',
],
'other' => [
'license' => 'COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERLICENSEHFOURPSP',
'copyright' => 'COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERCOPYRIGHTHFOURPSP'
]
];
/**
* get the JCB package owner details display
*
* @param array $info The package info object
* @param bool $trust The trust switch
*
* @return string
* @since 3.2.0
**/
public function owner(array $info, $trust = false): string
{
$hasOwner = false;
$ownerDetails = '<h2 class="module-title nav-header">' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '</h2>';
$ownerDetails .= '<dl class="uk-description-list-horizontal">';
// load the list items
foreach ($this->owner as $key => $dd)
{
if ($value = $this->getInfoValue($key, $info))
{
$ownerDetails .= Text::sprintf($dd, $value);
// check if we have a owner/source name
if (('owner' === $key || 'company' === $key) && !$hasOwner)
{
$hasOwner = true;
$owner = $value;
}
}
}
$ownerDetails .= '</dl>';
// provide some details to how the user can get a key
if ($hasOwner && isset($info['getKeyFrom']['buy_link']) && StringHelper::check($info['getKeyFrom']['buy_link']))
{
$ownerDetails .= '<hr />';
$ownerDetails .= Text::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROMB_A_SSA', 'class="btn btn-primary" href="' . $info['getKeyFrom']['buy_link'] . '" target="_blank" title="get a key from ' . $owner . '"', $owner);
}
// add more custom links
elseif ($hasOwner && isset($info['getKeyFrom']['buy_links']) && ArrayHelper::check($info['getKeyFrom']['buy_links']))
{
$buttons = array();
foreach ($info['getKeyFrom']['buy_links'] as $keyName => $link)
{
$buttons[] = Text::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROM_SB_FOR_A_SSA', $owner, 'class="btn btn-primary" href="' . $link . '" target="_blank" title="get a key from ' . $owner . '"', $keyName);
}
$ownerDetails .= '<hr />';
$ownerDetails .= implode('<br />', $buttons);
}
// return the owner details
if (!$hasOwner)
{
$ownerDetails = '<h2>' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND') . '</h2>';
if (!$trust)
{
$ownerDetails .= '<p style="color: #922924;">' . Text::_('COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE') . '</p>';
}
}
return '<div>'.$ownerDetails.'</div>';
}
/**
* Check if info details has owner values set
*
* @param array $info The package info object
*
* @return bool
* @since 3.2.0
**/
public function hasOwner(array &$info): bool
{
if ($this->getInfoValue('owner', $info) || $this->getInfoValue('company', $info))
{
return true;
}
return false;
}
/**
* get the JCB package components details display
*
* @param array $info The package info object
*
* @return string
* @since 3.2.0
**/
public function components(array &$info): string
{
// check if these components need a key
$needKey = $this->hasKey($info);
if (isset($info['name']) && ArrayHelper::check($info['name']))
{
$cAmount = count((array) $info['name']);
$class2 = ($cAmount == 1) ? 'span12' : 'span6';
$counter = 1;
$display = array();
foreach ($info['name'] as $key => $value)
{
// set the name
$name = $value . ' v' . $info['component_version'][$key];
if ($cAmount > 1 && $counter == 3)
{
$display[] = '</div>';
$counter = 1;
}
if ($cAmount > 1 && $counter == 1)
{
$display[] = '<div>';
}
$display[] = '<div class="well well-small ' . $class2 . '">';
$display[] = '<h3>';
$display[] = $name;
if ($needKey)
{
$display[] = ' - <em>' . Text::sprintf('COM_COMPONENTBUILDER_PAIDLOCKED') . '</em>';
}
else
{
$display[] = ' - <em>' . Text::sprintf('COM_COMPONENTBUILDER_FREEOPEN') . '</em>';
}
$display[] = '</h3><h4>';
$display[] = $info['short_description'][$key];
$display[] = '</h4>';
$display[] = '<ul class="uk-list uk-list-striped">';
// load the list items
foreach ($this->component['ul'] as $li => $value)
{
if (isset($info[$li]) && isset($info[$li][$key]))
{
$display[] = '<li>'.Text::sprintf($value, $info[$li][$key]).'</li>';
}
}
$display[] = '</ul>';
// if we have a source link we add it
if (isset($info['joomla_source_link']) && ArrayHelper::check($info['joomla_source_link']) && isset($info['joomla_source_link'][$key]) && StringHelper::check($info['joomla_source_link'][$key]))
{
$display[] = '<a class="uk-button uk-button-mini uk-width-1-1 uk-margin-small-bottom" href="' .
$info['joomla_source_link'][$key] . '" target="_blank" title="' . Text::_('COM_COMPONENTBUILDER_SOURCE_CODE_FOR_JOOMLA_COMPONENT') . ' ('. $name . ')">' . Text::_('COM_COMPONENTBUILDER_SOURCE_CODE') . '</a>';
}
// load other
foreach ($this->component['other'] as $other => $value)
{
if (isset($info[$other]) && isset($info[$other][$key]))
{
$display[] = Text::sprintf($value, $info[$other][$key]);
}
}
$display[] = '</div>';
$counter++;
}
// close the div if needed
if ($cAmount > 1)
{
$display[] = '</div>';
}
return implode(PHP_EOL, $display);
}
return '<div>' . Text::_('COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE') . '</div>';
}
/**
* get the value from INFO array
*
* @param string $key The value key
* @param array $info The package info object
*
* @return string|null
* @since 3.2.0
**/
private function getInfoValue(string $key, array &$info): ?string
{
$source = (isset($info['source']) && isset($info['source'][$key])) ? 'source' : ((isset($info['getKeyFrom']) && isset($info['getKeyFrom'][$key])) ? 'getKeyFrom' : null);
if ($source && StringHelper::check($info[$source][$key]))
{
return $info[$source][$key];
}
return null;
}
/**
* Check if the JCB package has a key
*
* @param array $info The package info object
*
* @return bool
* @since 3.2.0
**/
private function hasKey(array &$info): bool
{
// check the package key status
if (!isset($info['key']))
{
if (isset($info['getKeyFrom']) && isset($info['getKeyFrom']['owner']))
{
// has a key
$info['key'] = true;
}
else
{
// does not have a key
$info['key'] = false;
}
}
return (bool) $info['key'];
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -16,6 +16,7 @@ use Joomla\DI\Container;
use VDM\Joomla\Componentbuilder\Service\Crypt;
use VDM\Joomla\Componentbuilder\Package\Service\Database;
use VDM\Joomla\Componentbuilder\Service\Server;
use VDM\Joomla\Componentbuilder\Package\Service\Display;
use VDM\Joomla\Componentbuilder\Interfaces\FactoryInterface;
@ -74,7 +75,8 @@ abstract class Factory implements FactoryInterface
return (new Container())
->registerServiceProvider(new Database())
->registerServiceProvider(new Crypt())
->registerServiceProvider(new Server());
->registerServiceProvider(new Server())
->registerServiceProvider(new Display());
}
}

View File

@ -0,0 +1,55 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Package\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use VDM\Joomla\Componentbuilder\Package\Display\Details;
/**
* Display Service Provider
*
* @since 3.2.0
*/
class Display implements ServiceProviderInterface
{
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.0
*/
public function register(Container $container)
{
$container->alias(Details::class, 'Display.Details')
->share('Display.Details', [$this, 'getDetails'], true);
}
/**
* Get the Display Details
*
* @param Container $container The DI container.
*
* @return Details
* @since 3.2.0
*/
public function getDetails(Container $container): Details
{
return new Details();
}
}

View File

@ -15,6 +15,7 @@ namespace VDM\Joomla\Componentbuilder\Server;
use Joomla\CMS\Client\FtpClient;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Componentbuilder\Interfaces\Serverinterface;
@ -39,7 +40,7 @@ class Ftp implements Serverinterface
* @var object
* @since 3.2.0
**/
protected object $details;
protected ?object $details = null;
/**
* set the server details
@ -51,8 +52,15 @@ class Ftp implements Serverinterface
**/
public function set(object $details): Ftp
{
// set the details
$this->details = $details;
// we need to make sure the if the details changed to get a new server client
if (!ObjectHelper::equal($details, $this->details))
{
// set the details
$this->details = $details;
// reset the client if it was set before
$this->client = null;
}
return $this;
}

View File

@ -16,6 +16,7 @@ use phpseclib3\Net\SFTP as SftpClient;
use VDM\Joomla\Componentbuilder\Crypt\KeyLoader;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\FileHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Componentbuilder\Interfaces\Serverinterface;
@ -48,7 +49,7 @@ class Sftp implements Serverinterface
* @var object
* @since 3.2.0
**/
protected object $details;
protected ?object $details = null;
/**
* Constructor
@ -72,8 +73,15 @@ class Sftp implements Serverinterface
**/
public function set(object $details): Sftp
{
// set the details
$this->details = $details;
// we need to make sure the if the details changed to get a new server client
if (!ObjectHelper::equal($details, $this->details))
{
// set the details
$this->details = $details;
// reset the client if it was set before
$this->client = null;
}
return $this;
}

View File

@ -14,14 +14,14 @@ namespace VDM\Joomla\Componentbuilder\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use phpseclib3\Crypt\AES;
use phpseclib3\Crypt\Rijndael;
use phpseclib3\Crypt\DES;
use phpseclib3\Crypt\AES as BASEAES;
use VDM\Joomla\Componentbuilder\Crypt as Crypto;
use VDM\Joomla\Componentbuilder\Crypt\KeyLoader;
use VDM\Joomla\Componentbuilder\Crypt\Random;
use VDM\Joomla\Componentbuilder\Crypt\Password;
use VDM\Joomla\Componentbuilder\Crypt\FOF;
use VDM\Joomla\Componentbuilder\Crypt\Aes;
use VDM\Joomla\Componentbuilder\Crypt\Aes\Legacy;
/**
@ -50,45 +50,20 @@ class Crypt implements ServiceProviderInterface
$container->alias(Password::class, 'Crypt.Password')
->share('Crypt.Password', [$this, 'getPassword'], true);
$container->alias(FOF::class, 'Crypt.FOF')
->share('Crypt.FOF', [$this, 'getFOF'], true);
$container->alias(KeyLoader::class, 'Crypt.Key')
->share('Crypt.Key', [$this, 'getKeyLoader'], true);
$container->alias(AES::class, 'Crypt.AES')
->share('Crypt.AES', [$this, 'getAesCBC'], true)
->share('Crypt.AES.CBC', [$this, 'getAesCBC'], true)
->share('Crypt.AES.CTR', [$this, 'getAesCTR'], true)
->share('Crypt.AES.ECB', [$this, 'getAesECB'], true)
->share('Crypt.AES.CBC3', [$this, 'getAesCBC3'], true)
->share('Crypt.AES.CFB', [$this, 'getAesCFB'], true)
->share('Crypt.AES.CFB8', [$this, 'getAesCFB8'], true)
->share('Crypt.AES.OFB', [$this, 'getAesOFB'], true)
->share('Crypt.AES.GCM', [$this, 'getAesGCM'], true);
$container->alias(BASEAES::class, 'Crypt.AESCBC')
->share('Crypt.AESCBC', [$this, 'getBASEAESCBC'], false);
$container->alias(Rijndael::class, 'Crypt.Rijndael')
->share('Crypt.Rijndael', [$this, 'getRijndaelCBC'], true)
->share('Crypt.Rijndael.CBC', [$this, 'getRijndaelCBC'], true)
->share('Crypt.Rijndael.CTR', [$this, 'getRijndaelCTR'], true)
->share('Crypt.Rijndael.ECB', [$this, 'getRijndaelECB'], true)
->share('Crypt.Rijndael.CBC3', [$this, 'getRijndaelCBC3'], true)
->share('Crypt.Rijndael.CFB', [$this, 'getRijndaelCFB'], true)
->share('Crypt.Rijndael.CFB8', [$this, 'getRijndaelCFB8'], true)
->share('Crypt.Rijndael.OFB', [$this, 'getRijndaelOFB'], true)
->share('Crypt.Rijndael.GCM', [$this, 'getRijndaelGCM'], true);
$container->alias(FOF::class, 'Crypt.FOF')
->share('Crypt.FOF', [$this, 'getFOF'], true);
$container->alias(DES::class, 'Crypt.DES')
->share('Crypt.DES', [$this, 'getDesCBC'], true)
->share('Crypt.DES.CBC', [$this, 'getDesCBC'], true)
->share('Crypt.DES.CTR', [$this, 'getDesCTR'], true)
->share('Crypt.DES.ECB', [$this, 'getDesECB'], true)
->share('Crypt.DES.CBC3', [$this, 'getDesCBC3'], true)
->share('Crypt.DES.CFB', [$this, 'getDesCFB'], true)
->share('Crypt.DES.CFB8', [$this, 'getDesCFB8'], true)
->share('Crypt.DES.OFB', [$this, 'getDesOFB'], true)
->share('Crypt.DES.GCM', [$this, 'getDesGCM'], true)
->share('Crypt.DES.STREAM', [$this, 'getDesSTREAM'], true);
$container->alias(Aes::class, 'Crypt.AES.CBC')
->share('Crypt.AES.CBC', [$this, 'getAesCBC'], true);
$container->alias(Legacy::class, 'Crypt.AES.LEGACY')
->share('Crypt.AES.LEGACY', [$this, 'getAesLEGACY'], true);
}
/**
@ -103,6 +78,8 @@ class Crypt implements ServiceProviderInterface
{
return new Crypto(
$container->get('Crypt.FOF'),
$container->get('Crypt.AES.CBC'),
$container->get('Crypt.AES.LEGACY'),
$container->get('Crypt.Password')
);
}
@ -133,22 +110,6 @@ class Crypt implements ServiceProviderInterface
return new Random();
}
/**
* Get the FOF AES Cyper with CBC mode
*
* @param Container $container The DI container.
*
* @return FOF
* @since 3.2.0
*/
public function getFOF(Container $container): FOF
{
return new FOF(
$container->get('Crypt.AES.CBC'),
$container->get('Crypt.Random')
);
}
/**
* Get the KeyLoader class
*
@ -167,324 +128,59 @@ class Crypt implements ServiceProviderInterface
*
* @param Container $container The DI container.
*
* @return AES
* @return BASEAES
* @since 3.2.0
*/
public function getAesCBC(Container $container): AES
public function getBASEAESCBC(Container $container): BASEAES
{
return new AES('cbc');
return new BASEAES('cbc');
}
/**
* Get the AES Cyper with CTR mode
* Get the Wrapper AES Cyper with CBC mode
*
* @param Container $container The DI container.
*
* @return AES
* @return Aes
* @since 3.2.0
*/
public function getAesCTR(Container $container): AES
public function getAesCBC(Container $container): Aes
{
return new AES('ctr');
return new Aes(
$container->get('Crypt.AESCBC'),
$container->get('Crypt.Random')
);
}
/**
* Get the AES Cyper with ECB mode
* Get the Wrapper AES Legacy Cyper with CBC mode
*
* @param Container $container The DI container.
*
* @return AES
* @return Legacy
* @since 3.2.0
*/
public function getAesECB(Container $container): AES
public function getAesLEGACY(Container $container): Legacy
{
return new AES('ecb');
return new Legacy(
$container->get('Crypt.AESCBC')
);
}
/**
* Get the AES Cyper with CBC3 mode
* Get the FOF AES Cyper with CBC mode
*
* @param Container $container The DI container.
*
* @return AES
* @return FOF
* @since 3.2.0
*/
public function getAesCBC3(Container $container): AES
public function getFOF(Container $container): FOF
{
return new AES('cbc3');
}
/**
* Get the AES Cyper with CFB mode
*
* @param Container $container The DI container.
*
* @return AES
* @since 3.2.0
*/
public function getAesCFB(Container $container): AES
{
return new AES('cfb');
}
/**
* Get the AES Cyper with CFB8 mode
*
* @param Container $container The DI container.
*
* @return AES
* @since 3.2.0
*/
public function getAesCFB8(Container $container): AES
{
return new AES('cfb8');
}
/**
* Get the AES Cyper with OFB mode
*
* @param Container $container The DI container.
*
* @return AES
* @since 3.2.0
*/
public function getAesOFB(Container $container): AES
{
return new AES('ofb');
}
/**
* Get the AES Cyper with GCM mode
*
* @param Container $container The DI container.
*
* @return AES
* @since 3.2.0
*/
public function getAesGCM(Container $container): AES
{
return new AES('gcm');
}
/**
* Get the Rijndael Cyper with CBC mode
*
* @param Container $container The DI container.
*
* @return Rijndael
* @since 3.2.0
*/
public function getRijndaelCBC(Container $container): Rijndael
{
return new Rijndael('cbc');
}
/**
* Get the Rijndael Cyper with CTR mode
*
* @param Container $container The DI container.
*
* @return Rijndael
* @since 3.2.0
*/
public function getRijndaelCTR(Container $container): Rijndael
{
return new Rijndael('ctr');
}
/**
* Get the Rijndael Cyper with ECB mode
*
* @param Container $container The DI container.
*
* @return Rijndael
* @since 3.2.0
*/
public function getRijndaelECB(Container $container): Rijndael
{
return new Rijndael('ecb');
}
/**
* Get the Rijndael Cyper with CBC3 mode
*
* @param Container $container The DI container.
*
* @return Rijndael
* @since 3.2.0
*/
public function getRijndaelCBC3(Container $container): Rijndael
{
return new Rijndael('cbc3');
}
/**
* Get the Rijndael Cyper with CFB mode
*
* @param Container $container The DI container.
*
* @return Rijndael
* @since 3.2.0
*/
public function getRijndaelCFB(Container $container): Rijndael
{
return new Rijndael('cfb');
}
/**
* Get the Rijndael Cyper with CFB8 mode
*
* @param Container $container The DI container.
*
* @return Rijndael
* @since 3.2.0
*/
public function getRijndaelCFB8(Container $container): Rijndael
{
return new Rijndael('cfb8');
}
/**
* Get the Rijndael Cyper with OFB mode
*
* @param Container $container The DI container.
*
* @return Rijndael
* @since 3.2.0
*/
public function getRijndaelOFB(Container $container): Rijndael
{
return new Rijndael('ofb');
}
/**
* Get the Rijndael Cyper with GCM mode
*
* @param Container $container The DI container.
*
* @return Rijndael
* @since 3.2.0
*/
public function getRijndaelGCM(Container $container): Rijndael
{
return new Rijndael('gcm');
}
/**
* Get the DES Cyper with CBC mode
*
* @param Container $container The DI container.
*
* @return DES
* @since 3.2.0
*/
public function getDesCBC(Container $container): DES
{
return new DES('cbc');
}
/**
* Get the DES Cyper with CTR mode
*
* @param Container $container The DI container.
*
* @return DES
* @since 3.2.0
*/
public function getDesCTR(Container $container): DES
{
return new DES('ctr');
}
/**
* Get the DES Cyper with ECB mode
*
* @param Container $container The DI container.
*
* @return DES
* @since 3.2.0
*/
public function getDesECB(Container $container): DES
{
return new DES('ecb');
}
/**
* Get the DES Cyper with CBC3 mode
*
* @param Container $container The DI container.
*
* @return DES
* @since 3.2.0
*/
public function getDesCBC3(Container $container): DES
{
return new DES('cbc3');
}
/**
* Get the DES Cyper with CFB mode
*
* @param Container $container The DI container.
*
* @return DES
* @since 3.2.0
*/
public function getDesCFB(Container $container): DES
{
return new DES('cfb');
}
/**
* Get the DES Cyper with CFB8 mode
*
* @param Container $container The DI container.
*
* @return DES
* @since 3.2.0
*/
public function getDesCFB8(Container $container): DES
{
return new DES('cfb8');
}
/**
* Get the DES Cyper with OFB mode
*
* @param Container $container The DI container.
*
* @return DES
* @since 3.2.0
*/
public function getDesOFB(Container $container): DES
{
return new DES('ofb');
}
/**
* Get the DES Cyper with GCM mode
*
* @param Container $container The DI container.
*
* @return DES
* @since 3.2.0
*/
public function getDesGCM(Container $container): DES
{
return new DES('gcm');
}
/**
* Get the DES Cyper with STREAM mode
*
* @param Container $container The DI container.
*
* @return DES
* @since 3.2.0
*/
public function getDesSTREAM(Container $container): DES
{
return new DES('stream');
return new FOF(
$container->get('Crypt.AESCBC'),
$container->get('Crypt.Random')
);
}
}

View File

@ -37,6 +37,42 @@ abstract class ObjectHelper
return false;
}
/**
* Compare two objects for equality based on their property values.
*
* Note that this method works only for simple objects that don't
* contain any nested objects or resource references. If you need
* to compare more complex objects, you may need to use a
* more advanced method such as serialization or reflection.
*
* @param object|null $obj1 The first object to compare.
* @param object|null $obj2 The second object to compare.
*
* @return bool True if the objects have the same key-value pairs and false otherwise.
*/
public static function equal(?object $obj1, ?object $obj2): bool
{
// if any is null we return false as that means there is a none object
// we are not comparing null but objects
// but we allow null as some objects while
// not instantiate are still null
if (is_null($obj1) || is_null($obj2))
{
return false;
}
// Convert the objects to arrays of their property values using get_object_vars.
$array1 = get_object_vars($obj1);
$array2 = get_object_vars($obj2);
// Compare the arrays using array_diff_assoc to detect any differences.
$diff1 = array_diff_assoc($array1, $array2);
$diff2 = array_diff_assoc($array2, $array1);
// If the arrays have the same key-value pairs, they will have no differences, so return true.
return empty($diff1) && empty($diff2);
}
}

View File

@ -392,11 +392,12 @@ abstract class StringHelper
/**
* Random Key
*
* @input int $size The size of the random string
*
* @returns a string
*
* @since 3.0.9
*/
public static function random($size): string
public static function random(int $size): string
{
$bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
$key = [];

View File

@ -2590,11 +2590,11 @@ abstract class SymmetricKey
$length = ord($text[strlen($text) - 1]);
if (!$length) {
// temp fix for FOFEncryptAes conversions
// Added by Llewellyn van der Merwe <joomla@vdm.io>
return rtrim($text, "\0");
// temp fix for FOFEncryptAes conversions
// Added by Llewellyn van der Merwe <joomla@vdm.io>
return rtrim($text);
} elseif ($length > $this->block_size) {
throw new BadDecryptionException("The ciphertext has an invalid padding length ($length) compared to the block size ({$this->block_size})");
throw new BadDecryptionException("The ciphertext has an invalid padding length ($length) compared to the block size ({$this->block_size})");
}
return substr($text, 0, -$length);

View File

@ -9422,7 +9422,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="https://dev.vdm.io" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 3.1.17 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 3.1.19 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already.
if (!isset($db))

View File

@ -287,8 +287,8 @@ class ComponentbuilderControllerApi extends FormController
{
$textNotice = array();
$keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
$keyNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '</p>';
$textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $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_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') . '<br />';
// set the package owner info
if ((isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner'])))
{

View File

@ -90,6 +90,8 @@ COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCES
COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT="Since the owner details are displayed during import process before adding the key, this way if the user/dev does not have the key they can see where to get it."
COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE="Sorry this placeholder is already in use!"
COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER="Sorry this placeholder is already in use in the compiler!"
COM_COMPONENTBUILDER_SOURCE_CODE="source code"
COM_COMPONENTBUILDER_SOURCE_CODE_FOR_JOOMLA_COMPONENT="Source Code for Joomla Component"
COM_COMPONENTBUILDER_S_WE_DETECTED_A_CHANGE_IN_BEXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_CHANGE_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL="%s, we detected a change in <b>EXTERNALCODE</b>, but you do not have permission to allow this change so <b>%s</b> was removed from the compilation. Please contact your system administrator for more info!<br /><small>(admin access required)</small>"
COM_COMPONENTBUILDER_S_WE_DETECTED_BNEW_EXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_NEW_CODESTRING_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOU_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL="%s, we detected <b>NEW EXTERNALCODE</b>, but you do not have permission to allow this new code/string so <b>%s</b> was removed from the compilation. Please contact you system administrator for more info!<br /><small>(admin access required)</small>"
COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB="That means anyone who has this package can install it into JCB. To add an export key simply open the component, go to the tab called <b>settings</b>, bottom right there is a field called <b>Export Key</b>."
@ -128,9 +130,10 @@ COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."
COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="To change the package owner defaults. Open the <b>JCB Global Options</b>, go to the <b>Company</b> tab and add the correct company details there."
COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="To change the package owner defaults. Open the JCB Global Options, go to the Company tab and add the correct company details there."
COM_COMPONENTBUILDER_TRANSLATOR_MODULE_NOT_READYBR_THIS_AREA_IS_STILL_UNDER_PRODUCTION_HOPEFULLY_WITH_NEXT_UPDATE="Translator Module not ready!<br />This area is still under production, hopefully with next update."
COM_COMPONENTBUILDER_VJRZDESSMHBTRWFIFTYTWVZEROAESFLVVXJTMTHREEJTWOIXM="VjRzdE%ssMHBtRW50TWV0aE%sFlvVXJTM3J2IXM="
COM_COMPONENTBUILDER_WEBSITE_S="Website: %s"
COM_COMPONENTBUILDER_WE_FOUND_DYNAMIC_CODE_BALL_IN_ONE_LINEB_AND_IGNORED_IT_PLEASE_REVIEW_S_FOR_MORE_DETAILS="We found dynamic code <b>all in one line</b>, and ignored it! Please review (%s) for more details!"
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 <a href="http://random-ize.com/how-long-to-hack-pass/" target="_blank" title="How long to hack pass">700 000 000 000 000 000 000 000 000 000 000</a> years to crack theoretically. Unless they have this key above, so do keep it safe."
COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 256 bit encryption using the above 32 character key."
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="You do not have permission to access the server details (<b>%s - denied</b>), please contact your system administrator for more info."
COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS="You should add the correct owner details."
COM_COMPONENTBUILDER__HAS_BEEN_CHECKED_OUT_BY_S="% has been checked out by %s"