Updates PHPSecLib. Fixed connection failure to remote server. Adds overriding of back-folder and git-folder on component level.

This commit is contained in:
Llewellyn van der Merwe 2023-10-24 09:46:36 +02:00
parent ae9451292f
commit 3c91a5cdbb
Signed by: Llewellyn
GPG Key ID: A9201372263741E7
66 changed files with 1941 additions and 1327 deletions

View File

@ -1,3 +1,9 @@
# v3.1.28
- Updates PHPSecLib.
- Fixed connection failure to remote server.
- Adds overriding of back-folder and git-folder on component level.
# v3.1.27
- Adds better remote repository management for the super power features.

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.27) 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.28) 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)
@ -144,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*: 20th October, 2023
+ *Version*: 3.1.27
+ *Last Build*: 24th October, 2023
+ *Version*: 3.1.28
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **634936**
+ *Line count*: **635155**
+ *Field count*: **2047**
+ *File count*: **4750**
+ *Folder count*: **448**
+ *File count*: **4731**
+ *Folder count*: **436**
> 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:joomla@vdm.io)

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.27) 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.28) 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)
@ -144,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*: 20th October, 2023
+ *Version*: 3.1.27
+ *Last Build*: 24th October, 2023
+ *Version*: 3.1.28
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **634936**
+ *Line count*: **635155**
+ *Field count*: **2047**
+ *File count*: **4750**
+ *Folder count*: **448**
+ *File count*: **4731**
+ *Folder count*: **436**
> 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:joomla@vdm.io)

View File

@ -90,15 +90,26 @@ class Compiler extends Infusion
// set some folder paths in relation to distribution
if (CFactory::_('Config')->backup)
{
$this->backupPath = $this->params->get(
$this->backupPath = $this->params->get(
'backup_folder_path', $this->tempPath
);
// see if component has overriding options set
if (CFactory::_('Component')->get('add_backup_folder_path', 0) == 1)
{
$this->backupPath = CFactory::_('Component')->get('backup_folder_path', $this->backupPath);
}
$this->dynamicIntegration = true;
}
// set local repos switch
if (CFactory::_('Config')->repository)
{
$this->repoPath = $this->params->get('git_folder_path', null);
// see if component has overriding options set
if (CFactory::_('Component')->get('add_git_folder_path', 0) == 1)
{
$this->repoPath = CFactory::_('Component')->get('git_folder_path', $this->repoPath);
}
}
// remove site folder if not needed (TODO add check if custom script was moved to site folder then we must do a more complex cleanup here)
if (CFactory::_('Config')->remove_site_folder && CFactory::_('Config')->remove_site_edit_folder)
@ -733,6 +744,7 @@ class Compiler extends Infusion
{
// move the component update server to host
if (CFactory::_('Component')->get('add_update_server', 0) == 1
&& CFactory::_('Component')->get('update_server_target', 0) == 1
&& isset($this->updateServerFileName)
&& $this->dynamicIntegration)
{
@ -982,7 +994,14 @@ class Compiler extends Infusion
// remove old data
CFactory::_('Utilities.Folder')->remove($repoFullPath, CFactory::_('Component')->get('toignore'));
// set the new data
Folder::copy(CFactory::_('Utilities.Paths')->component_path, $repoFullPath, '', true);
try {
Folder::copy(CFactory::_('Utilities.Paths')->component_path, $repoFullPath, '', true);
} catch (\RuntimeException $e) {
$this->app->enqueueMessage(
JText::_('We where was unable to transfer the component to the git repository:') . ' ' . $e->getMessage()
, 'Error'
);
}
// Trigger Event: jcb_ce_onAfterUpdateRepo
CFactory::_('Event')->trigger(
'jcb_ce_onAfterUpdateRepo',
@ -1015,9 +1034,16 @@ class Compiler extends Infusion
$repoFullPath, CFactory::_('Component')->get('toignore')
);
// set the new data
Folder::copy(
$module->folder_path, $repoFullPath, '', true
);
try {
Folder::copy(
$module->folder_path, $repoFullPath, '', true
);
} catch (\RuntimeException $e) {
$this->app->enqueueMessage(
JText::sprintf('We where was unable to transfer the (%s) module to the git repository:', $module->name) . ' ' . $e->getMessage()
, 'Error'
);
}
// Trigger Event: jcb_ce_onAfterUpdateRepo
CFactory::_('Event')->trigger(
'jcb_ce_onAfterUpdateRepo',
@ -1052,9 +1078,16 @@ class Compiler extends Infusion
$repoFullPath, CFactory::_('Component')->get('toignore')
);
// set the new data
Folder::copy(
$plugin->folder_path, $repoFullPath, '', true
);
try {
Folder::copy(
$plugin->folder_path, $repoFullPath, '', true
);
} catch (\RuntimeException $e) {
$this->app->enqueueMessage(
JText::sprintf('We where was unable to transfer the (%s) plugin to the git repository:', $plugin->name) . ' ' . $e->getMessage()
, 'Error'
);
}
// Trigger Event: jcb_ce_onAfterUpdateRepo
CFactory::_('Event')->trigger(
'jcb_ce_onAfterUpdateRepo',
@ -1088,7 +1121,8 @@ class Compiler extends Infusion
);
//create the zip file
if (FileHelper::zip(
CFactory::_('Utilities.Paths')->component_path, $this->filepath['component']
CFactory::_('Utilities.Paths')->component_path,
$this->filepath['component']
))
{
// now move to backup if zip was made and backup is required
@ -1096,18 +1130,26 @@ class Compiler extends Infusion
{
// Trigger Event: jcb_ce_onBeforeBackupZip
CFactory::_('Event')->trigger(
'jcb_ce_onBeforeBackupZip', array(&$component_context,
&$this->filepath['component'],
&$this->tempPath,
&$this->backupPath,
&$this->componentData)
);
'jcb_ce_onBeforeBackupZip',[
&$component_context,
&$this->filepath['component'],
&$this->tempPath,
&$this->backupPath,
&$this->componentData
]);
// copy the zip to backup path
File::copy(
$this->filepath['component'],
$this->backupPath . '/' . CFactory::_('Utilities.Paths')->component_backup_name
. '.zip'
);
try {
File::copy(
$this->filepath['component'],
$this->backupPath . '/' . CFactory::_('Utilities.Paths')->component_backup_name
. '.zip'
);
} catch (\RuntimeException $e) {
$this->app->enqueueMessage(
JText::_('We where was unable to transfer the component ZIP file to the backup folder:') . ' ' . $e->getMessage()
, 'Error'
);
}
}
// move to sales server host
if (CFactory::_('Component')->get('add_sales_server', 0) == 1
@ -1205,13 +1247,19 @@ class Compiler extends Infusion
&$module)
);
// copy the zip to backup path
File::copy(
$this->filepath['modules'][$module->id],
$this->backupPath . '/' . $module->zip_name
. '.zip'
);
try {
File::copy(
$this->filepath['modules'][$module->id],
$this->backupPath . '/' . $module->zip_name
. '.zip'
);
} catch (\RuntimeException $e) {
$this->app->enqueueMessage(
JText::sprintf('We where was unable to transfer the (%s) module zip file to the backup folder:', $module->name) . ' ' . $e->getMessage()
, 'Error'
);
}
}
// move to sales server host
if ($module->add_sales_server == 1)
{
@ -1307,11 +1355,18 @@ class Compiler extends Infusion
&$plugin)
);
// copy the zip to backup path
File::copy(
$this->filepath['plugins'][$plugin->id],
$this->backupPath . '/' . $plugin->zip_name
. '.zip'
);
try {
File::copy(
$this->filepath['plugins'][$plugin->id],
$this->backupPath . '/' . $plugin->zip_name
. '.zip'
);
} catch (\RuntimeException $e) {
$this->app->enqueueMessage(
JText::sprintf('We where was unable to transfer the (%s) plugin zip file to the backup folder:', $plugin->name) . ' ' . $e->getMessage()
, 'Error'
);
}
}
// move to sales server host

View File

@ -1156,7 +1156,7 @@ class Get
// Utilities GetHelper
CFactory::_('Power')->get('db87c339-5bb6-4291-a7ef-2c48ea1b06bc', 1);
// Utilities Json Helper
CFactory::_('Power')->get(' 4b225c51-d293-48e4-b3f6-5136cf5c3f18', 1);
CFactory::_('Power')->get('4b225c51-d293-48e4-b3f6-5136cf5c3f18', 1);
// Utilities FormHelper
CFactory::_('Power')->get('1198aecf-84c6-45d2-aea8-d531aa4afdfa', 1);

View File

@ -1181,7 +1181,7 @@ class Interpretation extends Fields
$update_['version'] = CFactory::_('Component')->get('old_component_version');
// setup SQL
$update_['mysql'] = trim(
implode(PHP_EOL . PHP_EOL, CFactory::_('Compiler.Builder.Update.Mysql')->active)
implode(PHP_EOL . PHP_EOL, CFactory::_('Compiler.Builder.Update.Mysql')->allActive())
);
// setup URL
if (isset($this->lastupdateURL))
@ -1248,7 +1248,7 @@ class Interpretation extends Fields
{
$searchMySQL = preg_replace('/\s+/', '', (string) $update['mysql']);
// add the updates to the SQL only if not found
foreach (CFactory::_('Compiler.Builder.Update.Mysql')->active as $search => $query)
foreach (CFactory::_('Compiler.Builder.Update.Mysql')->allActive() as $search => $query)
{
if (strpos($searchMySQL, $search) === false)
{

View File

@ -5481,6 +5481,8 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDREADME_LABEL="Add README"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDUIKIT_DESCRIPTION="Select the version of Uikit you would like to use."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDUIKIT_LABEL="Add Uikit"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_ADMIN_EVENT_LABEL="Add Global Admin Event"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_BACKUP_FOLDER_PATH_DESCRIPTION="Would you like to override the global backup folder path for this component?"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_BACKUP_FOLDER_PATH_LABEL="Backup Folder Path"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_BOTH_V2_AMP_V3="Add Both v2 & v3"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_CSS_ADMIN_LABEL="Add CSS (admin)"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_CSS_SITE_LABEL="Add CSS (site)"
@ -5488,6 +5490,8 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_EMAIL_HELPER_DESCRIPTION="Adding the e
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_EMAIL_HELPER_LABEL="Add Email Helper"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_FOOTABLE_V2="Add FooTable V2"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_FOOTABLE_V3="Add FooTable V3"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_GIT_FOLDER_PATH_DESCRIPTION="Would you like to override the global git folder path for this component?"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_GIT_FOLDER_PATH_LABEL="Git Folder Path"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_JAVASCRIPT_LABEL="Add Javascript"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_DESCRIPTION="Add the option to use the whmcs license add-on in the component."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_LABEL="Add WHMCS<br /><small>(license add-on)</small>"
@ -5522,6 +5526,10 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_MESSAGE="Error! Please add author n
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACK="Back"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_BUTTON_ACCESS="Joomla Component Backup Button Access"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_BUTTON_ACCESS_DESC="Allows the users in this group to access the backup button."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_FOLDER_PATH_DESCRIPTION="Here you can set the path to the backup folder."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_FOLDER_PATH_HINT="/home/user/backup"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_FOLDER_PATH_LABEL="Backup Folder Path"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_FOLDER_PATH_MESSAGE="Error! Please add folder path here."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BOM_DESCRIPTION="Select the file that should be used for licensing all files (files found in: administrator/components/com_componentbuilder/compiler)"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BOM_LABEL="Licensing Template"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BOTH="Both"
@ -5609,6 +5617,11 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_KEY_HINT="Export Key Here"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_KEY_LABEL="Export Key<br /><small>(encrypted field)</small>"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_KEY_MESSAGE="Error! Please add export key here."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_FRONT="Front"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GIT_FOLDER_PATH_DESCRIPTION="Here you can set the path to the git folder."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GIT_FOLDER_PATH_HINT="/home/user/git"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GIT_FOLDER_PATH_LABEL="Git Folder Path"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GIT_FOLDER_PATH_MESSAGE="Error! Please add folder path here."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GLOBAL="Global"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GUID_DESCRIPTION="Globally Unique Identifier"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GUID_HINT="Auto Generated"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GUID_LABEL="GUID"
@ -5661,6 +5674,8 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ADD_CONFIG_DESCRIPTION="You can add c
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ADD_CONFIG_LABEL="Adding Custom Config Fields"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ADD_CUSTOM_MENUS_DESCRIPTION="You can add custom menus to the component here. The normal Menus are already being added so only add custom Menus that you would like to use for custom scripts.<span id='jform_button_add_custom_menus'></span>"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ADD_CUSTOM_MENUS_LABEL="Adding Custom Menus"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BACKUP_FOLDER_PATH_DESCRIPTION="You component, and all other linked extensions will be placed as zip files inside this folder."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BACKUP_FOLDER_PATH_LABEL="Adding a backup folder export option"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BOTTON_COMPONENT_DASHBOARD_DESCRIPTION="<p>The default dashboard has all the icons of the views you have selected as <b>Dashboard (add record)</b> or <b>Dashboard (list of records)</b>, to expand it you can add more tabs.</p><span id='jform_button_component_dashboard'></span>"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BOTTON_COMPONENT_DASHBOARD_LABEL="Default Dashboard Option"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BUILDCOMP_DYNAMIC_MYSQL_DESCRIPTION="You can dynamically build the components back-end views and fields by adding a mySql table dump, that has all the tables, or some more tables with its columns and data types. A very basic and generic set of fields and tables will be created, and added to the existing fields and tables of this component."
@ -5674,6 +5689,8 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_DISPLAY_COMPONENT_CUSTOM_ADMIN_VIEWS_
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_DISPLAY_COMPONENT_SITE_VIEWS_DESCRIPTION="<h4>Linked Site Views <span id='header_component_site_views_buttons'></span></h4><div id='display_component_site_views' >Display of the site views will load here!</div>"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_DYNAMIC_DASHBOARD_DESCRIPTION="The dynamic dashboard is basically the option of taking an <b>Admin View</b> or <b>Custom Admin View</b> that is already linked to this component, and making it the dashboard."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_DYNAMIC_DASHBOARD_LABEL="Dynamic Dashboard Option"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_GIT_FOLDER_PATH_DESCRIPTION="You must set the folder where the component and all linked extensions should be deployed for git. You will have to still do your git commit and other git commands yourself. Each extension will create their own folder inside this git folder."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_GIT_FOLDER_PATH_LABEL="Adding a git path to your component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_MOVED_VIEWS_DESCRIPTION="We have moved the views in to their own tabs for your convenience.<span id='jform_button_create_edit_views'></span>"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_MOVED_VIEWS_LABEL="To add views, please open the corresponding tab."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_MYSQL_TWEAK_OPTIONS_DESCRIPTION="In each admin view you can add data from a MySQL Table (this is done in the admin view MySQL tab). Here you can limit that data in relation to this component. This feature is useful when an admin view with demo data is used in more then one component, and you would like to exclude some demo data without creating a new admin view.<span id='jform_button_mysql_tweak_options'></span>"
@ -5703,6 +5720,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOT_REQUIRED="Not Required"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NUMBER_LABEL="Number"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ORDERING_LABEL="Ordering"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_OTHER="Other"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_OVERRIDE="Override"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PERMISSION="Permissions"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT_DESCRIPTION="PHP script for the global helper admin event method."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT_LABEL="Global Helper Admin Event (method)"
@ -7302,10 +7320,13 @@ COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR="Link to the contributor"
COM_COMPONENTBUILDER_LIST_FIELD="List Field"
COM_COMPONENTBUILDER_LIST_VIEW="List View"
COM_COMPONENTBUILDER_LOADING="loading"
COM_COMPONENTBUILDER_LOADING_THE_PRIVATE_KEY_FILE_FAILED="Loading the private key file failed"
COM_COMPONENTBUILDER_LOADING_THE_PRIVATE_KEY_TEXT_FAILED="Loading the private key text failed"
COM_COMPONENTBUILDER_LOCAL="Local"
COM_COMPONENTBUILDER_LOCAL_GET="Local (get)"
COM_COMPONENTBUILDER_LOCAL_POWERS_REPOSITORY_PATH="Local Powers Repository Path"
COM_COMPONENTBUILDER_LOCAL_SNIPPET="Local snippet"
COM_COMPONENTBUILDER_LOGIN_FAILED="Login failed"
COM_COMPONENTBUILDER_MAIN_MENU="Main Menu"
COM_COMPONENTBUILDER_MAKE_A_DIFFERENCE_WITH_JCB="Make a Difference with JCB"
COM_COMPONENTBUILDER_MANUAL="Manual"
@ -7324,6 +7345,7 @@ COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)"
COM_COMPONENTBUILDER_MODULE="Module"
COM_COMPONENTBUILDER_MODULES="Modules"
COM_COMPONENTBUILDER_MOVE="Move"
COM_COMPONENTBUILDER_MOVING_OF_THE_S_FAILED="Moving of the %s failed"
COM_COMPONENTBUILDER_NAME="Name"
COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)"
COM_COMPONENTBUILDER_NAME_DESC="Name (Desc)"

View File

@ -34,7 +34,13 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
'note_update_server_note_other',
'update_server',
'add_sales_server',
'sales_server'
'sales_server',
'add_backup_folder_path',
'note_backup_folder_path',
'backup_folder_path',
'add_git_folder_path',
'note_git_folder_path',
'git_folder_path'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();

File diff suppressed because it is too large Load Diff

View File

@ -107,7 +107,13 @@ class ComponentbuilderModelJoomla_component extends AdminModel
'note_update_server_note_other',
'update_server',
'add_sales_server',
'sales_server'
'sales_server',
'add_backup_folder_path',
'note_backup_folder_path',
'backup_folder_path',
'add_git_folder_path',
'note_git_folder_path',
'git_folder_path'
),
'right' => array(
'translation_tool',
@ -118,15 +124,6 @@ class ComponentbuilderModelJoomla_component extends AdminModel
'crowdin_account_api_key'
)
),
'readme' => array(
'left' => array(
'addreadme',
'readme'
),
'right' => array(
'note_readme'
)
),
'dash_install' => array(
'left' => array(
'dashboard_type'
@ -158,6 +155,15 @@ class ComponentbuilderModelJoomla_component extends AdminModel
'assets_table_fix'
)
),
'readme' => array(
'left' => array(
'addreadme',
'readme'
),
'right' => array(
'note_readme'
)
),
'dynamic_build_beta' => array(
'fullwidth' => array(
'note_buildcomp_dynamic_mysql',
@ -348,24 +354,6 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$item->metadata = $registry->toArray();
}
if (!empty($item->php_helper_both))
{
// base64 Decode php_helper_both.
$item->php_helper_both = base64_decode($item->php_helper_both);
}
if (!empty($item->php_method_uninstall))
{
// base64 Decode php_method_uninstall.
$item->php_method_uninstall = base64_decode($item->php_method_uninstall);
}
if (!empty($item->php_preflight_install))
{
// base64 Decode php_preflight_install.
$item->php_preflight_install = base64_decode($item->php_preflight_install);
}
if (!empty($item->css_admin))
{
// base64 Decode css_admin.
@ -396,6 +384,24 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$item->sql_uninstall = base64_decode($item->sql_uninstall);
}
if (!empty($item->php_preflight_install))
{
// base64 Decode php_preflight_install.
$item->php_preflight_install = base64_decode($item->php_preflight_install);
}
if (!empty($item->php_method_uninstall))
{
// base64 Decode php_method_uninstall.
$item->php_method_uninstall = base64_decode($item->php_method_uninstall);
}
if (!empty($item->buildcompsql))
{
// base64 Decode buildcompsql.
$item->buildcompsql = base64_decode($item->buildcompsql);
}
if (!empty($item->php_helper_admin))
{
// base64 Decode php_helper_admin.
@ -438,35 +444,35 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$item->sql = base64_decode($item->sql);
}
if (!empty($item->buildcompsql))
{
// base64 Decode buildcompsql.
$item->buildcompsql = base64_decode($item->buildcompsql);
}
if (!empty($item->readme))
{
// base64 Decode readme.
$item->readme = base64_decode($item->readme);
}
if (!empty($item->php_helper_both))
{
// base64 Decode php_helper_both.
$item->php_helper_both = base64_decode($item->php_helper_both);
}
// Get the basic encryption.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encryption object.
$basic = new AES($basickey);
if (!empty($item->whmcs_key) && $basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true)))
{
// basic decrypt data whmcs_key.
$item->whmcs_key = rtrim($basic->decryptString($item->whmcs_key), "\0");
}
if (!empty($item->crowdin_username) && $basickey && !is_numeric($item->crowdin_username) && $item->crowdin_username === base64_encode(base64_decode($item->crowdin_username, true)))
{
// basic decrypt data crowdin_username.
$item->crowdin_username = rtrim($basic->decryptString($item->crowdin_username), "\0");
}
if (!empty($item->whmcs_key) && $basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true)))
{
// basic decrypt data whmcs_key.
$item->whmcs_key = rtrim($basic->decryptString($item->whmcs_key), "\0");
}
if (!empty($item->export_key) && $basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true)))
{
// basic decrypt data export_key.
@ -1415,24 +1421,6 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$data['addcontributors'] = '';
}
// Set the php_helper_both string to base64 string.
if (isset($data['php_helper_both']))
{
$data['php_helper_both'] = base64_encode($data['php_helper_both']);
}
// Set the php_method_uninstall string to base64 string.
if (isset($data['php_method_uninstall']))
{
$data['php_method_uninstall'] = base64_encode($data['php_method_uninstall']);
}
// Set the php_preflight_install string to base64 string.
if (isset($data['php_preflight_install']))
{
$data['php_preflight_install'] = base64_encode($data['php_preflight_install']);
}
// Set the css_admin string to base64 string.
if (isset($data['css_admin']))
{
@ -1463,6 +1451,24 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$data['sql_uninstall'] = base64_encode($data['sql_uninstall']);
}
// Set the php_preflight_install string to base64 string.
if (isset($data['php_preflight_install']))
{
$data['php_preflight_install'] = base64_encode($data['php_preflight_install']);
}
// Set the php_method_uninstall string to base64 string.
if (isset($data['php_method_uninstall']))
{
$data['php_method_uninstall'] = base64_encode($data['php_method_uninstall']);
}
// Set the buildcompsql string to base64 string.
if (isset($data['buildcompsql']))
{
$data['buildcompsql'] = base64_encode($data['buildcompsql']);
}
// Set the php_helper_admin string to base64 string.
if (isset($data['php_helper_admin']))
{
@ -1505,35 +1511,35 @@ class ComponentbuilderModelJoomla_component extends AdminModel
$data['sql'] = base64_encode($data['sql']);
}
// Set the buildcompsql string to base64 string.
if (isset($data['buildcompsql']))
{
$data['buildcompsql'] = base64_encode($data['buildcompsql']);
}
// Set the readme string to base64 string.
if (isset($data['readme']))
{
$data['readme'] = base64_encode($data['readme']);
}
// Set the php_helper_both string to base64 string.
if (isset($data['php_helper_both']))
{
$data['php_helper_both'] = base64_encode($data['php_helper_both']);
}
// Get the basic encryption key.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encryption object
$basic = new AES($basickey);
// Encrypt data whmcs_key.
if (isset($data['whmcs_key']) && $basickey)
{
$data['whmcs_key'] = $basic->encryptString($data['whmcs_key']);
}
// Encrypt data crowdin_username.
if (isset($data['crowdin_username']) && $basickey)
{
$data['crowdin_username'] = $basic->encryptString($data['crowdin_username']);
}
// Encrypt data whmcs_key.
if (isset($data['whmcs_key']) && $basickey)
{
$data['whmcs_key'] = $basic->encryptString($data['whmcs_key']);
}
// Encrypt data export_key.
if (isset($data['export_key']) && $basickey)
{

View File

@ -2687,33 +2687,38 @@ class ComponentbuilderModelJoomla_components extends ListModel
continue;
}
// decode php_helper_both
$item->php_helper_both = base64_decode($item->php_helper_both);
// decode php_method_uninstall
$item->php_method_uninstall = base64_decode($item->php_method_uninstall);
// decode php_preflight_install
$item->php_preflight_install = base64_decode($item->php_preflight_install);
// decode css_admin
$item->css_admin = base64_decode($item->css_admin);
// decode php_admin_event
$item->php_admin_event = base64_decode($item->php_admin_event);
// decode php_site_event
$item->php_site_event = base64_decode($item->php_site_event);
if ($basickey && !is_numeric($item->crowdin_username) && $item->crowdin_username === base64_encode(base64_decode($item->crowdin_username, true)))
{
// decrypt crowdin_username
$item->crowdin_username = $basic->decryptString($item->crowdin_username);
}
// decode php_postflight_install
$item->php_postflight_install = base64_decode($item->php_postflight_install);
// decode sql_uninstall
$item->sql_uninstall = base64_decode($item->sql_uninstall);
// decode php_preflight_install
$item->php_preflight_install = base64_decode($item->php_preflight_install);
// decode php_method_uninstall
$item->php_method_uninstall = base64_decode($item->php_method_uninstall);
// decode buildcompsql
$item->buildcompsql = base64_decode($item->buildcompsql);
// decode php_helper_admin
$item->php_helper_admin = base64_decode($item->php_helper_admin);
// decode php_helper_site
$item->php_helper_site = base64_decode($item->php_helper_site);
// decode javascript
$item->javascript = base64_decode($item->javascript);
if ($basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true)))
{
// decrypt whmcs_key
$item->whmcs_key = $basic->decryptString($item->whmcs_key);
}
// decode php_helper_site
$item->php_helper_site = base64_decode($item->php_helper_site);
// decode javascript
$item->javascript = base64_decode($item->javascript);
// decode css_site
$item->css_site = base64_decode($item->css_site);
// decode php_preflight_update
@ -2722,13 +2727,6 @@ class ComponentbuilderModelJoomla_components extends ListModel
$item->php_postflight_update = base64_decode($item->php_postflight_update);
// decode sql
$item->sql = base64_decode($item->sql);
if ($basickey && !is_numeric($item->crowdin_username) && $item->crowdin_username === base64_encode(base64_decode($item->crowdin_username, true)))
{
// decrypt crowdin_username
$item->crowdin_username = $basic->decryptString($item->crowdin_username);
}
// decode buildcompsql
$item->buildcompsql = base64_decode($item->buildcompsql);
if ($basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true)))
{
// decrypt export_key
@ -2746,6 +2744,8 @@ class ComponentbuilderModelJoomla_components extends ListModel
// decrypt crowdin_account_api_key
$item->crowdin_account_api_key = $basic->decryptString($item->crowdin_account_api_key);
}
// decode php_helper_both
$item->php_helper_both = base64_decode($item->php_helper_both);
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);

View File

@ -2,9 +2,11 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
`add_admin_event` TINYINT(1) NOT NULL DEFAULT 0,
`add_backup_folder_path` TINYINT(1) NOT NULL DEFAULT 0,
`add_css_admin` TINYINT(1) NOT NULL DEFAULT 0,
`add_css_site` TINYINT(1) NOT NULL DEFAULT 0,
`add_email_helper` TINYINT(1) NOT NULL DEFAULT 0,
`add_git_folder_path` TINYINT(1) NOT NULL DEFAULT 0,
`add_javascript` TINYINT(1) NOT NULL DEFAULT 0,
`add_license` TINYINT(1) NOT NULL DEFAULT 0,
`add_menu_prefix` CHAR(1) NOT NULL DEFAULT '',
@ -29,6 +31,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` (
`adduikit` TINYINT(1) NOT NULL DEFAULT 0,
`assets_table_fix` TINYINT(1) NOT NULL DEFAULT 3,
`author` VARCHAR(255) NOT NULL DEFAULT '',
`backup_folder_path` VARCHAR(255) NOT NULL DEFAULT '',
`bom` CHAR(64) NOT NULL DEFAULT '',
`buildcomp` TINYINT(1) NOT NULL DEFAULT 0,
`buildcompsql` MEDIUMTEXT NOT NULL,
@ -51,6 +54,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` (
`emptycontributors` TINYINT(1) NOT NULL DEFAULT 0,
`export_buy_link` VARCHAR(255) NOT NULL DEFAULT '',
`export_key` TEXT NOT NULL,
`git_folder_path` VARCHAR(255) NOT NULL DEFAULT '',
`guid` VARCHAR(36) NOT NULL DEFAULT '',
`image` CHAR(64) NOT NULL DEFAULT '',
`javascript` TEXT NOT NULL,
@ -105,18 +109,17 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` (
PRIMARY KEY (`id`),
KEY `idx_system_name` (`system_name`),
KEY `idx_name_code` (`name_code`),
KEY `idx_mvc_versiondate` (`mvc_versiondate`),
KEY `idx_remove_line_breaks` (`remove_line_breaks`),
KEY `idx_add_placeholders` (`add_placeholders`),
KEY `idx_debug_linenr` (`debug_linenr`),
KEY `idx_mvc_versiondate` (`mvc_versiondate`),
KEY `idx_add_placeholders` (`add_placeholders`),
KEY `idx_add_sales_server` (`add_sales_server`),
KEY `idx_translation_tool` (`translation_tool`),
KEY `idx_add_license` (`add_license`),
KEY `idx_license_type` (`license_type`),
KEY `idx_add_email_helper` (`add_email_helper`),
KEY `idx_addreadme` (`addreadme`),
KEY `idx_add_sales_server` (`add_sales_server`),
KEY `idx_add_powers` (`add_powers`),
KEY `idx_translation_tool` (`translation_tool`),
KEY `idx_add_php_helper_both` (`add_php_helper_both`),
KEY `idx_add_backup_folder_path` (`add_backup_folder_path`),
KEY `idx_add_php_helper_admin` (`add_php_helper_admin`),
KEY `idx_add_admin_event` (`add_admin_event`),
KEY `idx_add_php_helper_site` (`add_php_helper_site`),
@ -137,10 +140,13 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` (
KEY `idx_emptycontributors` (`emptycontributors`),
KEY `idx_add_update_server` (`add_update_server`),
KEY `idx_update_server_target` (`update_server_target`),
KEY `idx_add_git_folder_path` (`add_git_folder_path`),
KEY `idx_creatuserhelper` (`creatuserhelper`),
KEY `idx_adduikit` (`adduikit`),
KEY `idx_guid` (`guid`),
KEY `idx_addfootable` (`addfootable`),
KEY `idx_add_email_helper` (`add_email_helper`),
KEY `idx_add_php_helper_both` (`add_php_helper_both`),
KEY `idx_guid` (`guid`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_createdby` (`created_by`),

View File

@ -0,0 +1,7 @@
ALTER TABLE `#__componentbuilder_joomla_component` ADD `add_backup_folder_path` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_admin_event`;
ALTER TABLE `#__componentbuilder_joomla_component` ADD `add_git_folder_path` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_email_helper`;
ALTER TABLE `#__componentbuilder_joomla_component` ADD `backup_folder_path` VARCHAR(255) NOT NULL DEFAULT '' AFTER `author`;
ALTER TABLE `#__componentbuilder_joomla_component` ADD `git_folder_path` VARCHAR(255) NOT NULL DEFAULT '' AFTER `export_key`;

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>20th October, 2023</creationDate>
<creationDate>24th October, 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.27</version>
<version>3.1.28</version>
<description><![CDATA[
<h1>Component Builder (v.3.1.27)</h1>
<h1>Component Builder (v.3.1.28)</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

@ -1217,4 +1217,22 @@
<maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>pkg_component_builder</element>
<type>package</type>
<client>site</client>
<version>3.1.28</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.28.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>

View File

@ -48,6 +48,22 @@ abstract class Api
*/
protected Response $response;
/**
* The Url string
*
* @var string|null
* @since 3.2.0
*/
protected ?string $url = null;
/**
* The token string
*
* @var string|null
* @since 3.2.0
*/
protected ?string $token = null;
/**
* Constructor.
*
@ -67,14 +83,31 @@ abstract class Api
/**
* Load/Reload API.
*
* @param string|null $url The url.
* @param token|null $token The token.
* @param string|null $url The url.
* @param token|null $token The token.
* @param bool $backup The backup swapping switch.
*
* @return void
* @since 3.2.0
**/
public function load_(?string $url = null, ?string $token = null)
public function load_(?string $url = null, ?string $token = null, bool $backup = true): void
{
// we keep the old values
// so we can reset after our call
// for the rest of the container
if ($backup)
{
if ($url !== null)
{
$this->url = $this->uri->getUrl();
}
if ($token !== null)
{
$this->token = $this->http->getToken();
}
}
if ($url !== null)
{
$this->uri->setUrl($url);
@ -86,6 +119,27 @@ abstract class Api
}
}
/**
* Reset to previous toke, url it set
*
* @return void
* @since 3.2.0
**/
public function reset_(): void
{
if ($this->url !== null)
{
$this->uri->setUrl($this->url);
$this->url = null;
}
if ($this->token !== null)
{
$this->http->setToken($this->token);
$this->token = null;
}
}
/**
* Get the API url
*

View File

@ -23,6 +23,14 @@ use Joomla\Registry\Registry;
*/
final class Http extends JoomlaHttp
{
/**
* The token
*
* @var string
* @since 3.2.0
*/
protected string $_token_; // to avoid collusions (but allow swapping)
/**
* Constructor.
*
@ -45,6 +53,7 @@ final class Http extends JoomlaHttp
if (is_string($token))
{
$config['headers']['Authorization'] = 'token ' . $token;
$this->_token_ = $token;
}
$options = new Registry($config);
@ -60,7 +69,7 @@ final class Http extends JoomlaHttp
*
* @since 3.2.0
**/
public function setToken(string $token)
public function setToken(string $token): void
{
// get the current headers
$headers = (array) $this->getOption('headers', [
@ -70,8 +79,20 @@ final class Http extends JoomlaHttp
// add the token
$headers['Authorization'] = 'token ' . $token;
$this->_token_ = $token;
$this->setOption('headers', $headers);
}
/**
* Get the Token.
*
* @return string|null
* @since 3.2.0
**/
public function getToken(): ?string
{
return $this->_token_ ?? null;
}
}

View File

@ -110,6 +110,17 @@ final class Uri
$this->url = $url;
}
/**
* Get the URL of the API
*
* @return string|null
* @since 3.2.0
**/
public function getUrl(): ?string
{
return $this->url ?? null;
}
/**
* Set the endpoint of the API
*

View File

@ -12,6 +12,9 @@
namespace VDM\Joomla\Componentbuilder\Server;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Application\CMSApplication;
use phpseclib3\Net\SFTP as SftpClient;
use VDM\Joomla\Componentbuilder\Crypt\KeyLoader;
use VDM\Joomla\Utilities\StringHelper;
@ -51,16 +54,26 @@ class Sftp implements Serverinterface
**/
protected ?object $details = null;
/**
* Application object.
*
* @var CMSApplication
* @since 3.2.0
**/
protected CMSApplication $app;
/**
* Constructor
*
* @param KeyLoader $key The key loader object.
* @param CMSApplication|null $app The app object.
*
* @since 3.2.0
*/
public function __construct(KeyLoader $key)
public function __construct(KeyLoader $key, ?CMSApplication $app = null)
{
$this->key = $key;
$this->app = $app ?: Factory::getApplication();
}
/**
@ -106,10 +119,21 @@ class Sftp implements Serverinterface
StringHelper::check($this->details->path) &&
$this->details->path !== '/')
{
$path = '/' . trim((string) $this->details->path, '/');
$path = trim((string) $this->details->path);
$path = '/' . trim($path, '/') . '/';
}
return $this->client->put($path . '/' . $fileName, $data);
try
{
return $this->client->put($path . trim($fileName), $data);
}
catch(\Exception $e)
{
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_MOVING_OF_THE_S_FAILED', $fileName) . ': ' . $e->getMessage(),
'Error'
);
}
}
return false;
@ -147,24 +171,23 @@ class Sftp implements Serverinterface
isset($this->details->username) && StringHelper::check($this->details->username))
{
// insure the port is set
$port = (isset($this->details->port) && is_numeric($this->details->port) && $this->details->port > 0)
? (int) $this->details->port : 22;
$port = (int)($this->details->port ?? 22);
// open the connection
$sftp = new SftpClient($this->details->host, $port);
// set the passphrase if it exist
$passphrase = $this->details->secret ?? null;
$passphrase = (isset($this->details->secret) && StringHelper::check(trim($this->details->secret))) ? trim($this->details->secret) : false;
// set the password if it exist
$password = $this->details->password ?? null;
$password = (isset($this->details->password) && StringHelper::check(trim($this->details->password))) ? trim($this->details->password) : false;
// now login based on authentication type
$key = null;
switch($this->details->authentication)
{
case 1: // password
$key = $this->details->password ?? null;
$key = $password ?? null;
$password = null;
break;
case 2: // private key file
@ -172,28 +195,77 @@ class Sftp implements Serverinterface
if (isset($this->details->private) && StringHelper::check($this->details->private) &&
($private_key = FileHelper::getContent($this->details->private, null)) !== null)
{
$key = $this->key::load($private_key, $passphrase);
try
{
$key = $this->key::load(trim($private_key), $passphrase);
}
catch(\Exception $e)
{
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_LOADING_THE_PRIVATE_KEY_FILE_FAILED') . ': ' . $e->getMessage(),
'Error'
);
$key = null;
}
}
break;
case 4: // private key field
case 5: // both password and private key field
if (isset($this->details->private_key) && StringHelper::check($this->details->private_key))
{
$key = $this->key::load($this->details->private_key, $passphrase);
try
{
$key = $this->key::load(trim($this->details->private_key), $passphrase);
}
catch(\Exception $e)
{
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_LOADING_THE_PRIVATE_KEY_TEXT_FAILED') . ': ' . $e->getMessage(),
'Error'
);
$key = null;
}
}
break;
}
// remove any null bites from the username
$this->details->username = trim($this->details->username);
// login
if ((!empty($key) && !empty($password) && $sftp->login($this->details->username, $key, $password)) ||
(!empty($key) && $sftp->login($this->details->username, $key)))
if (!empty($key) && !empty($password))
{
return $sftp;
try
{
$sftp->login($this->details->username, $key, $password);
return $sftp;
}
catch(\Exception $e)
{
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_LOGIN_FAILED') . ': ' . $e->getMessage(),
'Error'
);
}
}
elseif (!empty($key))
{
try
{
$sftp->login($this->details->username, $key);
return $sftp;
}
catch(\Exception $e)
{
$this->app->enqueueMessage(
Text::_('COM_COMPONENTBUILDER_LOGIN_FAILED') . ': ' . $e->getMessage(),
'Error'
);
}
}
}
return null;
}
}
}

View File

@ -67,51 +67,6 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Details',
],
'php_helper_both' => [
'name' => 'php_helper_both',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'created' => [
'name' => 'created',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATED_LABEL',
'type' => 'calendar',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'publishing',
],
'crowdin_project_identifier' => [
'name' => 'crowdin_project_identifier',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_PROJECT_IDENTIFIER_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Dynamic Integration',
],
'php_method_uninstall' => [
'name' => 'php_method_uninstall',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'php_preflight_install' => [
'name' => 'php_preflight_install',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'css_admin' => [
'name' => 'css_admin',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_ADMIN_LABEL',
@ -121,33 +76,6 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'mvc_versiondate' => [
'name' => 'mvc_versiondate',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_LABEL',
</