Adding SFTP protocol #232

Merged
Llewellyn merged 8 commits from staging into master 2018-02-19 14:14:29 +00:00
28 changed files with 642 additions and 723 deletions
Showing only changes of commit c3156642b2 - Show all commits

View File

@ -130,9 +130,9 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.6.15
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **181503**
+ *Field count*: **1641**
+ *File count*: **1167**
+ *Line count*: **181318**
+ *Field count*: **1639**
+ *File count*: **1166**
+ *Folder count*: **188**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).

View File

@ -130,9 +130,9 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.6.15
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **181503**
+ *Field count*: **1641**
+ *File count*: **1167**
+ *Line count*: **181318**
+ *Field count*: **1639**
+ *File count*: **1166**
+ *Folder count*: **188**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).

View File

@ -318,17 +318,35 @@ class Compiler extends Infusion
// make sure we have the correct file
if (JFile::exists($xml_update_server_path) && isset($this->componentData->update_server))
{
// Get the basic encription.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encription object.
$basic = new FOFEncryptAes($basickey, 128);
if (!empty($this->componentData->update_server) && $basickey && !is_numeric($this->componentData->update_server) && $this->componentData->update_server === base64_encode(base64_decode($this->componentData->update_server, true)))
// use FTP
if ($this->componentData->update_server_protocol == 1)
{
// basic decript data update_server.
$this->componentData->update_server = rtrim($basic->decryptString($this->componentData->update_server), "\0");
// Get the basic encription.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encription object.
$basic = new FOFEncryptAes($basickey, 128);
if (!empty($this->componentData->update_server) && $basickey && !is_numeric($this->componentData->update_server) && $this->componentData->update_server === base64_encode(base64_decode($this->componentData->update_server, true)))
{
// basic decript data update_server.
$this->componentData->update_server = rtrim($basic->decryptString($this->componentData->update_server), "\0");
}
// now move the file
$this->moveFileToFtpServer($xml_update_server_path, $this->componentData->update_server);
}
// use SFTP
elseif ($this->componentData->update_server_protocol == 2)
{
if ($sftp = ComponentbuilderHelper::getSftp((int) $this->componentData->update_server))
{
// now move the file
if (!$sftp->put($sftp->remote_server_path . $this->updateServerFileName . '.xml', ComponentbuilderHelper::getFileContents($xml_update_server_path, null)))
{
$this->app->enqueueMessage(JText::sprintf('The <b>%s</b> file could not be moved to <b>%s</b> path on <b>%s</b> server.', $this->updateServerFileName . '.xml', $sftp->remote_server_path, $sftp->remote_server_name), 'Error');
}
// remove the local file
JFile::delete($xml_update_server_path);
}
}
// now move the file
$this->moveFileToFtpServer($xml_update_server_path, $this->componentData->update_server);
}
}
}
@ -499,17 +517,33 @@ class Compiler extends Infusion
// make sure we have the correct file
if (isset($this->componentData->sales_server))
{
// Get the basic encription.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encription object.
$basic = new FOFEncryptAes($basickey, 128);
if (!empty($this->componentData->sales_server) && $basickey && !is_numeric($this->componentData->sales_server) && $this->componentData->sales_server === base64_encode(base64_decode($this->componentData->sales_server, true)))
// use FTP
if ($this->componentData->sales_server_protocol == 1)
{
// basic decript data update_server.
$this->componentData->sales_server = rtrim($basic->decryptString($this->componentData->sales_server), "\0");
// Get the basic encription.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encription object.
$basic = new FOFEncryptAes($basickey, 128);
if (!empty($this->componentData->sales_server) && $basickey && !is_numeric($this->componentData->sales_server) && $this->componentData->sales_server === base64_encode(base64_decode($this->componentData->sales_server, true)))
{
// basic decript data sales_server.
$this->componentData->sales_server = rtrim($basic->decryptString($this->componentData->sales_server), "\0");
}
// now move the file
$this->moveFileToFtpServer($this->filepath, $this->componentData->sales_server, $this->componentSalesName . '.zip', false);
}
// use SFTP
elseif ($this->componentData->sales_server_protocol == 2)
{
if ($sftp = ComponentbuilderHelper::getSftp((int) $this->componentData->sales_server))
{
// now move the file
if (!$sftp->put($sftp->remote_server_path . $this->componentFolderName . '.zip', ComponentbuilderHelper::getFileContents($this->filepath, null)))
{
$this->app->enqueueMessage(JText::sprintf('The <b>%s</b> file could not be moved to <b>%s</b> path on <b>%s</b> server.', $this->componentFolderName . '.zip', $sftp->remote_server_path, $sftp->remote_server_name), 'Error');
}
}
}
// now move the file
$this->moveFileToFtpServer($this->filepath, $this->componentData->sales_server, $this->componentSalesName . '.zip', false);
}
}
// remove the component folder since we are done

View File

@ -1152,24 +1152,26 @@ class Get
// reset back to nowlang
$this->lang = $nowLang;
// add the update server details
if ($component->add_update_server == 1 && is_numeric($component->update_server) && $component->update_server > 0)
// add the update/sales server FTP details if that is the expected protocol
$serverArray = array('update_server','sales_server');
foreach($serverArray as $server)
{
$component->update_server = ComponentbuilderHelper::getVar('server', (int) $component->update_server, 'id', 'signature');
}
else
{
$component->update_server = 0;
}
// add the sales server details
if ($component->add_sales_server == 1 && is_numeric($component->sales_server) && $component->sales_server > 0)
{
$component->sales_server = ComponentbuilderHelper::getVar('server', (int) $component->sales_server, 'id', 'signature');
}
else
{
$component->sales_server = 0;
$component->add_sales_server = 0;
if ($component->{'add_'.$server} == 1 && is_numeric($component->{$server}) && $component->{$server} > 0)
{
// get the server protocol
$component->{$server.'_protocol'} = ComponentbuilderHelper::getVar('server', (int) $component->{$server}, 'id', 'protocol');
// load the FTP
if (1 == $component->{$server.'_protocol'})
{
$component->{$server} = ComponentbuilderHelper::getVar('server', (int) $component->{$server}, 'id', 'signature');
}
}
else
{
$component->{$server} = 0;
$component->{'add_'.$server} = 0;
$component->{$server.'_protocol'} = 0;
}
}
// set the ignore folders for repo if found
if (isset($component->toignore) && ComponentbuilderHelper::checkString($component->toignore))

View File

@ -1943,6 +1943,160 @@ abstract class ComponentbuilderHelper
return $none;
}
/**
* Load the Composer Vendors
**/
public static function composerAutoload()
{
// load the autoloader
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/vendor/autoload.php';
}
/**
* the SFTP object
**/
protected static $sftp = array();
/**
* get the sftp object
*
* @param int $serverID The server local id to use
*
* @return object on success with sftp power
**/
public static function getSftp($serverID)
{
// check if it was already set
if (!self::checkObject(self::$sftp[$serverID]))
{
// check if we have a server with that id
if ($server = self::getServerDetails($serverID, 2))
{
// make sure we have the composer classes loaded
self::composerAutoload();
// insure the port is set
$server->port = (isset($server->port) && is_int($server->port) && $server->port > 0) ? $server->port : 22;
// open the connection
self::$sftp[$serverID] = new phpseclib\Net\SFTP($server->host, $server->port);
// now login based on authentication type
switch($server->authentication)
{
case 1: // password
// now login
if (!self::$sftp[$serverID]->login($server->username, $server->password))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_AND_PASSWORD_ARE_CORRECT', $server->name), 'Error');
return false;
}
break;
case 2: // private key file
$rsa = new phpseclib\Crypt\RSA();
// check if we have a passprase
if (self::checkString($server->secret))
{
$rsa->setPassword($server->secret);
}
// now load the key file
if (!$rsa->loadKey(self::getFileContents($server->private, null)))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error');
return false;
}
// now login
if (!self::$sftp[$serverID]->login($server->username, $rsa))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_AND_PRIVATE_KEY_FILE_ARE_CORRECT', $server->name), 'Error');
return false;
}
break;
case 3: // both password and private key file
$rsa = new phpseclib\Crypt\RSA();
// check if we have a passphrase
if (self::checkString($server->secret))
{
$rsa->setPassword($server->secret);
}
// now load the key file
if (!$rsa->loadKey(self::getFileContents($server->private, null)))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error');
return false;
}
// now login
if (!self::$sftp[$serverID]->login($server->username, $server->password, $rsa))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_PASSWORD_AND_PRIVATE_KEY_FILE_ARE_CORRECT', $server->name), 'Error');
return false;
}
break;
}
// set some defaults
self::$sftp[$serverID]->remote_server_name = $server->name;
self::$sftp[$serverID]->remote_server_path = (self::checkString($server->path) && $server->path !== '/') ? $server->path : '';
}
else
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BSB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error');
return false;
}
}
// return the sftp object
return self::$sftp[$serverID];
}
/**
* get the server details
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
*
* @return array on success with sftp server details
**/
protected static function getServerDetails($serverID, $protocol = 2)
{
if (is_int($serverID) && is_int($serverID))
{
// Get a db connection
$db = JFactory::getDbo();
// start the query
$query = $db->getQuery(true);
// select based to protocal
if (2 == $protocol)
{
$query->select($db->quoteName(array('name','authentication','username','host','password','path','port','private','secret')));
}
else
{
$query->select($db->quoteName(array('name','signature')));
}
$query->from($db->quoteName('#__componentbuilder_server'));
$query->where($db->quoteName('id') . ' = ' . (int) $serverID);
$query->where($db->quoteName('protocol') . ' = ' . (int) $protocol);
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$server = $db->loadObject();
// Get the basic encryption.
$basickey = self::getCryptKey('basic');
// Get the encryption object.
$basic = new FOFEncryptAes($basickey, 128);
// unlock the needed fields
foreach($server as $name => $value)
{
if ($name !== 'name' && !empty($server->{$name}) && $basickey && !is_numeric($server->{$name}) && $server->{$name} === base64_encode(base64_decode($server->{$name}, true)))
{
// basic decrypt of data
$server->{$name} = rtrim($basic->decryptString($server->{$name}), "\0");
}
}
// return the server details
return $server;
}
}
return false;
}
/**
* Load the Component xml manifest.
**/

9
admin/helpers/vendor/.htaccess vendored Normal file
View File

@ -0,0 +1,9 @@
# Apache 2.4+
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Apache 2.0-2.2
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>

View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitd317c2705193f17bc1491bacb879ddc5::getLoader();
return ComposerAutoloaderInite1af6c9ee1d0c9dfa4a8dcea26b35570::getLoader();

View File

@ -6,4 +6,28 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'phpseclib\\Crypt\\AES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/AES.php',
'phpseclib\\Crypt\\Base' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Base.php',
'phpseclib\\Crypt\\Blowfish' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php',
'phpseclib\\Crypt\\DES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/DES.php',
'phpseclib\\Crypt\\Hash' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Hash.php',
'phpseclib\\Crypt\\RC2' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/RC2.php',
'phpseclib\\Crypt\\RC4' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/RC4.php',
'phpseclib\\Crypt\\RSA' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/RSA.php',
'phpseclib\\Crypt\\Random' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Random.php',
'phpseclib\\Crypt\\Rijndael' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php',
'phpseclib\\Crypt\\TripleDES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php',
'phpseclib\\Crypt\\Twofish' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php',
'phpseclib\\File\\ANSI' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ANSI.php',
'phpseclib\\File\\ASN1' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ASN1.php',
'phpseclib\\File\\ASN1\\Element' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ASN1/Element.php',
'phpseclib\\File\\X509' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/X509.php',
'phpseclib\\Math\\BigInteger' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Math/BigInteger.php',
'phpseclib\\Net\\SCP' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SCP.php',
'phpseclib\\Net\\SFTP' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SFTP.php',
'phpseclib\\Net\\SFTP\\Stream' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php',
'phpseclib\\Net\\SSH1' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SSH1.php',
'phpseclib\\Net\\SSH2' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SSH2.php',
'phpseclib\\System\\SSH\\Agent' => $vendorDir . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php',
'phpseclib\\System\\SSH\\Agent\\Identity' => $vendorDir . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php',
);

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitd317c2705193f17bc1491bacb879ddc5
class ComposerAutoloaderInite1af6c9ee1d0c9dfa4a8dcea26b35570
{
private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInitd317c2705193f17bc1491bacb879ddc5
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitd317c2705193f17bc1491bacb879ddc5', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInite1af6c9ee1d0c9dfa4a8dcea26b35570', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitd317c2705193f17bc1491bacb879ddc5', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInite1af6c9ee1d0c9dfa4a8dcea26b35570', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitd317c2705193f17bc1491bacb879ddc5::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInite1af6c9ee1d0c9dfa4a8dcea26b35570::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@ -48,19 +48,19 @@ class ComposerAutoloaderInitd317c2705193f17bc1491bacb879ddc5
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitd317c2705193f17bc1491bacb879ddc5::$files;
$includeFiles = Composer\Autoload\ComposerStaticInite1af6c9ee1d0c9dfa4a8dcea26b35570::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequired317c2705193f17bc1491bacb879ddc5($fileIdentifier, $file);
composerRequiree1af6c9ee1d0c9dfa4a8dcea26b35570($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequired317c2705193f17bc1491bacb879ddc5($fileIdentifier, $file)
function composerRequiree1af6c9ee1d0c9dfa4a8dcea26b35570($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitd317c2705193f17bc1491bacb879ddc5
class ComposerStaticInite1af6c9ee1d0c9dfa4a8dcea26b35570
{
public static $files = array (
'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
@ -24,11 +24,39 @@ class ComposerStaticInitd317c2705193f17bc1491bacb879ddc5
),
);
public static $classMap = array (
'phpseclib\\Crypt\\AES' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/AES.php',
'phpseclib\\Crypt\\Base' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Base.php',
'phpseclib\\Crypt\\Blowfish' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php',
'phpseclib\\Crypt\\DES' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/DES.php',
'phpseclib\\Crypt\\Hash' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Hash.php',
'phpseclib\\Crypt\\RC2' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/RC2.php',
'phpseclib\\Crypt\\RC4' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/RC4.php',
'phpseclib\\Crypt\\RSA' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/RSA.php',
'phpseclib\\Crypt\\Random' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Random.php',
'phpseclib\\Crypt\\Rijndael' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php',
'phpseclib\\Crypt\\TripleDES' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php',
'phpseclib\\Crypt\\Twofish' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php',
'phpseclib\\File\\ANSI' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/ANSI.php',
'phpseclib\\File\\ASN1' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/ASN1.php',
'phpseclib\\File\\ASN1\\Element' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/ASN1/Element.php',
'phpseclib\\File\\X509' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/X509.php',
'phpseclib\\Math\\BigInteger' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Math/BigInteger.php',
'phpseclib\\Net\\SCP' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SCP.php',
'phpseclib\\Net\\SFTP' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SFTP.php',
'phpseclib\\Net\\SFTP\\Stream' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php',
'phpseclib\\Net\\SSH1' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SSH1.php',
'phpseclib\\Net\\SSH2' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SSH2.php',
'phpseclib\\System\\SSH\\Agent' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php',
'phpseclib\\System\\SSH\\Agent\\Identity' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitd317c2705193f17bc1491bacb879ddc5::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitd317c2705193f17bc1491bacb879ddc5::$prefixDirsPsr4;
$loader->prefixLengthsPsr4 = ComposerStaticInite1af6c9ee1d0c9dfa4a8dcea26b35570::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInite1af6c9ee1d0c9dfa4a8dcea26b35570::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInite1af6c9ee1d0c9dfa4a8dcea26b35570::$classMap;
}, null, ClassLoader::class);
}

8
admin/helpers/vendor/web.config vendored Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<configuration>
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</configuration>

View File

@ -5237,8 +5237,9 @@ COM_COMPONENTBUILDER_SERVERS_N_ITEMS_UNPUBLISHED_1="%s Server unpublished."
COM_COMPONENTBUILDER_SERVERS_SUBMENU="Servers Submenu"
COM_COMPONENTBUILDER_SERVERS_SUBMENU_DESC="Allows the users in this group to update the submenu of the server"
COM_COMPONENTBUILDER_SERVER_AUTHENTICATION="Authentication"
COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_DESCRIPTION="Select the authentication type to use with ssh."
COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_DESCRIPTION="Select the authentication type to use with SFTP."
COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_LABEL="Authentication Type"
COM_COMPONENTBUILDER_SERVER_BOTH="Both"
COM_COMPONENTBUILDER_SERVER_CREATED_BY_DESC="The user that created this Server."
COM_COMPONENTBUILDER_SERVER_CREATED_BY_LABEL="Created By"
COM_COMPONENTBUILDER_SERVER_CREATED_DATE_DESC="The date this Server was created."
@ -5248,9 +5249,9 @@ COM_COMPONENTBUILDER_SERVER_EDIT="Editing the Server"
COM_COMPONENTBUILDER_SERVER_ERROR_UNIQUE_ALIAS="Another Server has the same alias."
COM_COMPONENTBUILDER_SERVER_FTP="FTP"
COM_COMPONENTBUILDER_SERVER_HOST="Host"
COM_COMPONENTBUILDER_SERVER_HOST_DESCRIPTION="Add the server host name here"
COM_COMPONENTBUILDER_SERVER_HOST_DESCRIPTION="Add the server host name/IP here"
COM_COMPONENTBUILDER_SERVER_HOST_HINT="yourhost.com"
COM_COMPONENTBUILDER_SERVER_HOST_LABEL="Host<br /><small>(basic encryption)</small>"
COM_COMPONENTBUILDER_SERVER_HOST_LABEL="Host/IP<br /><small>(basic encryption)</small>"
COM_COMPONENTBUILDER_SERVER_HOST_MESSAGE="Error! Please add server host name here."
COM_COMPONENTBUILDER_SERVER_ID="Id"
COM_COMPONENTBUILDER_SERVER_LINKED_COMPONENTS="Linked Components"
@ -5266,8 +5267,8 @@ COM_COMPONENTBUILDER_SERVER_NAME_MESSAGE="Error! Please add name here."
COM_COMPONENTBUILDER_SERVER_NEW="A New Server"
COM_COMPONENTBUILDER_SERVER_NOTE_FTP_SIGNATURE_DESCRIPTION="Add your FTP signature in the given field.<br /><b>Here are the details of the signature:</b><br />&nbsp;&nbsp;&nbsp;string $host = '127.0.0.1'<br />&nbsp;&nbsp;&nbsp;string $port = '21'<br />&nbsp;&nbsp;&nbsp;array $options = array()<br />&nbsp;&nbsp;&nbsp;string $user = null<br />&nbsp;&nbsp;&nbsp;string $pass = null<br />&nbsp;&nbsp;&nbsp;OPTIONS = Array with any of these options:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type=>[FTP_AUTOASCII|FTP_ASCII|FTP_BINARY]<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeout=>(int)<br /><b>Here is an example signature:</b><br /><code>host=HOSTNAME&port=PORT_INT&options[type]=FTP_BINARY&options[timeout]=15&username=user@name.com&password=password</code>"
COM_COMPONENTBUILDER_SERVER_NOTE_FTP_SIGNATURE_LABEL="The FTP Signature Details"
COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_DESCRIPTION="<b>Do not use this feature if you do not know exactly what you are doing!</b> SSH is a cryptographic network protocol for operating network services securely over an unsecured network, but if not used correctly it can cause a major breach in security."
COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_LABEL="The SSH Security Cautions!"
COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_DESCRIPTION="<b>Do not use this feature if you do not know exactly what you are doing!</b> Secure File Transfer Protocol (SFTP) is a secure version of File Transfer Protocol (FTP), which facilitates data access and data transfer over a Secure Shell (SSH) data stream. It is part of the SSH Protocol. This term is also known as SSH File Transfer Protocol. Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network, but if not used correctly it can cause a major breach in security."
COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_LABEL="The SFTP Security Cautions!"
COM_COMPONENTBUILDER_SERVER_NOT_REQUIRED="Not Required"
COM_COMPONENTBUILDER_SERVER_ORDERING_LABEL="Ordering"
COM_COMPONENTBUILDER_SERVER_PASSWORD="Password"
@ -5287,29 +5288,24 @@ COM_COMPONENTBUILDER_SERVER_PORT_MESSAGE="Error! Please add port number here."
COM_COMPONENTBUILDER_SERVER_PRIVATE="Private"
COM_COMPONENTBUILDER_SERVER_PRIVATE_DESCRIPTION="Set the path to the private key."
COM_COMPONENTBUILDER_SERVER_PRIVATE_HINT="/home/username/.ssh/id_rsa"
COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY="Private Key"
COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_FILE="Private Key File"
COM_COMPONENTBUILDER_SERVER_PRIVATE_LABEL="Private Key Path<br /><small>(basic encryption)</small>"
COM_COMPONENTBUILDER_SERVER_PRIVATE_MESSAGE="Error! Please add private key path."
COM_COMPONENTBUILDER_SERVER_PROTOCOL="Protocol"
COM_COMPONENTBUILDER_SERVER_PROTOCOL_DESCRIPTION="Select the protocol used to connect to this server."
COM_COMPONENTBUILDER_SERVER_PROTOCOL_LABEL="Protocol"
COM_COMPONENTBUILDER_SERVER_PUBLIC="Public"
COM_COMPONENTBUILDER_SERVER_PUBLIC_DESCRIPTION="Set the path to the public key."
COM_COMPONENTBUILDER_SERVER_PUBLIC_HINT="/home/username/.ssh/id_rsa.pub"
COM_COMPONENTBUILDER_SERVER_PUBLIC_LABEL="Public Key Path<br /><small>(basic encryption)</small>"
COM_COMPONENTBUILDER_SERVER_PUBLIC_MESSAGE="Error! Please add public key path."
COM_COMPONENTBUILDER_SERVER_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_SERVER_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Server to customise the alias."
COM_COMPONENTBUILDER_SERVER_SECRET="Secret"
COM_COMPONENTBUILDER_SERVER_SECRET_DESCRIPTION="If private key file is encrypted (which it should be), the passphrase must be provided."
COM_COMPONENTBUILDER_SERVER_SECRET_LABEL="Passphrase<br /><small>(basic encryption)</small>"
COM_COMPONENTBUILDER_SERVER_SELECT_AN_OPTION="Select an option"
COM_COMPONENTBUILDER_SERVER_SFTP="SFTP"
COM_COMPONENTBUILDER_SERVER_SIGNATURE="Signature"
COM_COMPONENTBUILDER_SERVER_SIGNATURE_DESCRIPTION="The FTP login details needed. If the basic key was not set when you created this FTP signature, then add the basic key, come back here and save this FTP signature again to ensure that it gets encrypted."
COM_COMPONENTBUILDER_SERVER_SIGNATURE_HINT="host=HOSTNAME&port=PORT_INT&options[type]=FTP_BINARY&options[timeout]=15&username=user@name.com&password=password"
COM_COMPONENTBUILDER_SERVER_SIGNATURE_LABEL="FTP Server (Signature)<br /><small>(encrypted field)</small><br /><small><i>This field is only encrypted if your basic key in the JCB global settings is set.</i></small>"
COM_COMPONENTBUILDER_SERVER_SIGNATURE_MESSAGE="Error! Please add some text here."
COM_COMPONENTBUILDER_SERVER_SSH="SSH"
COM_COMPONENTBUILDER_SERVER_STATUS="Status"
COM_COMPONENTBUILDER_SERVER_USERNAME="Username"
COM_COMPONENTBUILDER_SERVER_USERNAME_DESCRIPTION="Enter the username."
@ -6150,12 +6146,17 @@ COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES="The component updates"
COM_COMPONENTBUILDER_THE_KEY_OF_THIS_PACKAGE="The key of this package."
COM_COMPONENTBUILDER_THE_LIBRARY_CONFIG_FIELDS="The library config fields"
COM_COMPONENTBUILDER_THE_LIBRARY_FILES_FOLDERS_URLS="The library files, folders & URLs"
COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_AND_PASSWORD_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your username and password are correct!"
COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_AND_PRIVATE_KEY_FILE_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your username and private key file are correct!"
COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_PASSWORD_AND_PRIVATE_KEY_FILE_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your username, password and private key file are correct!"
COM_COMPONENTBUILDER_THE_NAME_OF_THIS_LIBRARY_BSB_CAN_NOT_BE_CHANGED_TO_BSB_OR_THINGS_WILL_BREAK="The name of this library (<b>%s</b>) can not be changed to <b>%s</b> or things will break."
COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING="The notice board is loading"
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: <code>%s</code>"
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for <b>%s</b> server!"
COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading"
COM_COMPONENTBUILDER_THE_SEARCH_FOR_THE_SNIPPETS_ARE_CASE_SENSITIVE_SO_IF_YOU_CHANGED_THE_LOCAL_BNAMESB_OF_EITHER_OR_THE_BSNIPPET_LIBRARY_OR_SNIPPET_TYPESB_IN_ANY_SMALL_WAY_THE_SYSTEM_WILL_NOT_BE_ABLE_TO_CONNECT_YOUR_LOCAL_SNIPPETS_WITH_THOSE_IN_THE_COMMUNITY_REPOSITORY_SO_WE_STRONGLY_ADVICE_TO_BKEEP_TO_THE_COMMUNITY_NAMINGB_TO_AVOID_MISMATCHING_THAT_WILL_IN_TURN_CAUSE_DUPLICATION_SO_IF_YOU_CHANGED_ANY_NAMES_JUST_CHANGE_THEM_BACK_AND_ALL_WILL_AGAIN_WORK_AS_EXPECTED="The search for the snippets are case sensitive so if you changed the local <b>names</b> of either or the <b>snippet, library or snippet types</b> in any small way, the system will not be able to connect your local snippets with those in the community repository. So we strongly advice to <b>keep to the community naming</b> to avoid mismatching, that will in turn cause duplication. So if you changed any names, just change them back and all will again work as expected."
COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BSB_COULD_NOT_BE_RETRIEVED="The server details for <b>(%s)</b> could not be retrieved!"
COM_COMPONENTBUILDER_THE_SNIPPETS_WERE_SUCCESSFULLY_EXPORTED="The Snippets Were Successfully Exported!"
COM_COMPONENTBUILDER_THE_SNIPPET_WAS_SUCCESSFULLY_EXPORTED="The Snippet Was Successfully Exported!"
COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING="The wiki is loading"

View File

@ -33,7 +33,6 @@ $fields = $displayData->get('fields') ?: array(
'authentication',
'password',
'private',
'public',
'secret'
);

View File

@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
$items = $displayData->waplinked_components;
$items = $displayData->wanlinked_components;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";

View File

@ -23,12 +23,12 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvwazwaq_required = false;
jform_vvvvwbawar_required = false;
jform_vvvvwbbwas_required = false;
jform_vvvvwbcwat_required = false;
jform_vvvvwbdwau_required = false;
jform_vvvvwbewav_required = false;
jform_vvvvwazwao_required = false;
jform_vvvvwbawap_required = false;
jform_vvvvwbbwaq_required = false;
jform_vvvvwbcwar_required = false;
jform_vvvvwbdwas_required = false;
jform_vvvvwbewat_required = false;
// Initial Script
jQuery(document).ready(function()
@ -59,26 +59,26 @@ function vvvvwaz(location_vvvvwaz)
if (location_vvvvwaz == 1)
{
jQuery('#jform_admin_view').closest('.control-group').show();
if (jform_vvvvwazwaq_required)
if (jform_vvvvwazwao_required)
{
updateFieldRequired('admin_view',0);
jQuery('#jform_admin_view').prop('required','required');
jQuery('#jform_admin_view').attr('aria-required',true);
jQuery('#jform_admin_view').addClass('required');
jform_vvvvwazwaq_required = false;
jform_vvvvwazwao_required = false;
}
}
else
{
jQuery('#jform_admin_view').closest('.control-group').hide();
if (!jform_vvvvwazwaq_required)
if (!jform_vvvvwazwao_required)
{
updateFieldRequired('admin_view',1);
jQuery('#jform_admin_view').removeAttr('required');
jQuery('#jform_admin_view').removeAttr('aria-required');
jQuery('#jform_admin_view').removeClass('required');
jform_vvvvwazwaq_required = true;
jform_vvvvwazwao_required = true;
}
}
}
@ -90,26 +90,26 @@ function vvvvwba(location_vvvvwba)
if (location_vvvvwba == 2)
{
jQuery('#jform_site_view').closest('.control-group').show();
if (jform_vvvvwbawar_required)
if (jform_vvvvwbawap_required)
{
updateFieldRequired('site_view',0);
jQuery('#jform_site_view').prop('required','required');
jQuery('#jform_site_view').attr('aria-required',true);
jQuery('#jform_site_view').addClass('required');
jform_vvvvwbawar_required = false;
jform_vvvvwbawap_required = false;
}
}
else
{
jQuery('#jform_site_view').closest('.control-group').hide();
if (!jform_vvvvwbawar_required)
if (!jform_vvvvwbawap_required)
{
updateFieldRequired('site_view',1);
jQuery('#jform_site_view').removeAttr('required');
jQuery('#jform_site_view').removeAttr('aria-required');
jQuery('#jform_site_view').removeClass('required');
jform_vvvvwbawar_required = true;
jform_vvvvwbawap_required = true;
}
}
}
@ -134,26 +134,26 @@ function vvvvwbb(type_vvvvwbb)
if (type)
{
jQuery('#jform_url').closest('.control-group').show();
if (jform_vvvvwbbwas_required)
if (jform_vvvvwbbwaq_required)
{
updateFieldRequired('url',0);
jQuery('#jform_url').prop('required','required');
jQuery('#jform_url').attr('aria-required',true);
jQuery('#jform_url').addClass('required');
jform_vvvvwbbwas_required = false;
jform_vvvvwbbwaq_required = false;
}
}
else
{
jQuery('#jform_url').closest('.control-group').hide();
if (!jform_vvvvwbbwas_required)
if (!jform_vvvvwbbwaq_required)
{
updateFieldRequired('url',1);
jQuery('#jform_url').removeAttr('required');
jQuery('#jform_url').removeAttr('aria-required');
jQuery('#jform_url').removeClass('required');
jform_vvvvwbbwas_required = true;
jform_vvvvwbbwaq_required = true;
}
}
}
@ -189,26 +189,26 @@ function vvvvwbc(type_vvvvwbc)
if (type)
{
jQuery('#jform_article').closest('.control-group').show();
if (jform_vvvvwbcwat_required)
if (jform_vvvvwbcwar_required)
{
updateFieldRequired('article',0);
jQuery('#jform_article').prop('required','required');
jQuery('#jform_article').attr('aria-required',true);
jQuery('#jform_article').addClass('required');
jform_vvvvwbcwat_required = false;
jform_vvvvwbcwar_required = false;
}
}
else
{
jQuery('#jform_article').closest('.control-group').hide();
if (!jform_vvvvwbcwat_required)
if (!jform_vvvvwbcwar_required)
{
updateFieldRequired('article',1);
jQuery('#jform_article').removeAttr('required');
jQuery('#jform_article').removeAttr('aria-required');
jQuery('#jform_article').removeClass('required');
jform_vvvvwbcwat_required = true;
jform_vvvvwbcwar_required = true;
}
}
}
@ -244,26 +244,26 @@ function vvvvwbd(type_vvvvwbd)
if (type)
{
jQuery('#jform_content-lbl').closest('.control-group').show();
if (jform_vvvvwbdwau_required)
if (jform_vvvvwbdwas_required)
{
updateFieldRequired('content',0);
jQuery('#jform_content').prop('required','required');
jQuery('#jform_content').attr('aria-required',true);
jQuery('#jform_content').addClass('required');
jform_vvvvwbdwau_required = false;
jform_vvvvwbdwas_required = false;
}
}
else
{
jQuery('#jform_content-lbl').closest('.control-group').hide();
if (!jform_vvvvwbdwau_required)
if (!jform_vvvvwbdwas_required)
{
updateFieldRequired('content',1);
jQuery('#jform_content').removeAttr('required');
jQuery('#jform_content').removeAttr('aria-required');
jQuery('#jform_content').removeClass('required');
jform_vvvvwbdwau_required = true;
jform_vvvvwbdwas_required = true;
}
}
}
@ -286,26 +286,26 @@ function vvvvwbe(target_vvvvwbe)
if (target_vvvvwbe == 1)
{
jQuery('#jform_groups').closest('.control-group').show();
if (jform_vvvvwbewav_required)
if (jform_vvvvwbewat_required)
{
updateFieldRequired('groups',0);
jQuery('#jform_groups').prop('required','required');
jQuery('#jform_groups').attr('aria-required',true);
jQuery('#jform_groups').addClass('required');
jform_vvvvwbewav_required = false;
jform_vvvvwbewat_required = false;
}
}
else
{
jQuery('#jform_groups').closest('.control-group').hide();
if (!jform_vvvvwbewav_required)
if (!jform_vvvvwbewat_required)
{
updateFieldRequired('groups',1);
jQuery('#jform_groups').removeAttr('required');
jQuery('#jform_groups').removeAttr('aria-required');
jQuery('#jform_groups').removeClass('required');
jform_vvvvwbewav_required = true;
jform_vvvvwbewat_required = true;
}
}
}

View File

@ -31,9 +31,7 @@ jform_vvvvwatwai_required = false;
jform_vvvvwauwaj_required = false;
jform_vvvvwavwak_required = false;
jform_vvvvwaxwal_required = false;
jform_vvvvwaxwam_required = false;
jform_vvvvwaywan_required = false;
jform_vvvvwaywao_required = false;
jform_vvvvwaywam_required = false;
// Initial Script
jQuery(document).ready(function()
@ -45,14 +43,14 @@ jQuery(document).ready(function()
vvvvwau(protocol_vvvvwau);
var protocol_vvvvwav = jQuery("#jform_protocol").val();
var authentication_vvvvwav = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvwav = jQuery("#jform_authentication").val();
vvvvwav(protocol_vvvvwav,authentication_vvvvwav);
var protocol_vvvvwax = jQuery("#jform_protocol").val();
var authentication_vvvvwax = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvwax = jQuery("#jform_authentication").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
var authentication_vvvvway = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvway = jQuery("#jform_authentication").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
});
@ -318,7 +316,7 @@ function protocol_vvvvwav_SomeFunc(protocol_vvvvwav)
function authentication_vvvvwav_SomeFunc(authentication_vvvvwav)
{
// set the function logic
if (authentication_vvvvwav == 1)
if (authentication_vvvvwav == 1 || authentication_vvvvwav == 3)
{
return true;
}
@ -366,16 +364,6 @@ function vvvvwax(protocol_vvvvwax,authentication_vvvvwax)
jform_vvvvwaxwal_required = false;
}
jQuery('#jform_public').closest('.control-group').show();
if (jform_vvvvwaxwam_required)
{
updateFieldRequired('public',0);
jQuery('#jform_public').prop('required','required');
jQuery('#jform_public').attr('aria-required',true);
jQuery('#jform_public').addClass('required');
jform_vvvvwaxwam_required = false;
}
jQuery('#jform_secret').closest('.control-group').show();
}
else
@ -389,15 +377,6 @@ function vvvvwax(protocol_vvvvwax,authentication_vvvvwax)
jQuery('#jform_private').removeClass('required');
jform_vvvvwaxwal_required = true;
}
jQuery('#jform_public').closest('.control-group').hide();
if (!jform_vvvvwaxwam_required)
{
updateFieldRequired('public',1);
jQuery('#jform_public').removeAttr('required');
jQuery('#jform_public').removeAttr('aria-required');
jQuery('#jform_public').removeClass('required');
jform_vvvvwaxwam_required = true;
}
jQuery('#jform_secret').closest('.control-group').hide();
}
}
@ -417,7 +396,7 @@ function protocol_vvvvwax_SomeFunc(protocol_vvvvwax)
function authentication_vvvvwax_SomeFunc(authentication_vvvvwax)
{
// set the function logic
if (authentication_vvvvwax == 2)
if (authentication_vvvvwax == 2 || authentication_vvvvwax == 3)
{
return true;
}
@ -456,23 +435,13 @@ function vvvvway(authentication_vvvvway,protocol_vvvvway)
if (authentication && protocol)
{
jQuery('#jform_private').closest('.control-group').show();
if (jform_vvvvwaywan_required)
if (jform_vvvvwaywam_required)
{
updateFieldRequired('private',0);
jQuery('#jform_private').prop('required','required');
jQuery('#jform_private').attr('aria-required',true);
jQuery('#jform_private').addClass('required');
jform_vvvvwaywan_required = false;
}
jQuery('#jform_public').closest('.control-group').show();
if (jform_vvvvwaywao_required)
{
updateFieldRequired('public',0);
jQuery('#jform_public').prop('required','required');
jQuery('#jform_public').attr('aria-required',true);
jQuery('#jform_public').addClass('required');
jform_vvvvwaywao_required = false;
jform_vvvvwaywam_required = false;
}
jQuery('#jform_secret').closest('.control-group').show();
@ -480,22 +449,13 @@ function vvvvway(authentication_vvvvway,protocol_vvvvway)
else
{
jQuery('#jform_private').closest('.control-group').hide();
if (!jform_vvvvwaywan_required)
if (!jform_vvvvwaywam_required)
{
updateFieldRequired('private',1);
jQuery('#jform_private').removeAttr('required');
jQuery('#jform_private').removeAttr('aria-required');
jQuery('#jform_private').removeClass('required');
jform_vvvvwaywan_required = true;
}
jQuery('#jform_public').closest('.control-group').hide();
if (!jform_vvvvwaywao_required)
{
updateFieldRequired('public',1);
jQuery('#jform_public').removeAttr('required');
jQuery('#jform_public').removeAttr('aria-required');
jQuery('#jform_public').removeClass('required');
jform_vvvvwaywao_required = true;
jform_vvvvwaywam_required = true;
}
jQuery('#jform_secret').closest('.control-group').hide();
}
@ -505,7 +465,7 @@ function vvvvway(authentication_vvvvway,protocol_vvvvway)
function authentication_vvvvway_SomeFunc(authentication_vvvvway)
{
// set the function logic
if (authentication_vvvvway == 2)
if (authentication_vvvvway == 2 || authentication_vvvvway == 3)
{
return true;
}

View File

@ -105,8 +105,20 @@
<!-- Option Set.-->
<option value="">COM_COMPONENTBUILDER_SERVER_SELECT_AN_OPTION</option>
<option value="1">COM_COMPONENTBUILDER_SERVER_FTP</option>
<option value="2">COM_COMPONENTBUILDER_SERVER_SSH</option>
<option value="2">COM_COMPONENTBUILDER_SERVER_SFTP</option>
</field>
<!-- Host Field. Type: Text. (joomla)-->
<field type="text"
name="host"
label="COM_COMPONENTBUILDER_SERVER_HOST_LABEL"
size="40"
maxlength="150"
description="COM_COMPONENTBUILDER_SERVER_HOST_DESCRIPTION"
class="text_area"
required="true"
filter="STRING"
message="COM_COMPONENTBUILDER_SERVER_HOST_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_HOST_HINT" />
<!-- Note_ftp_signature Field. Type: Note. A None Database Field. (joomla)-->
<field type="note"
name="note_ftp_signature"
@ -114,6 +126,27 @@
description="COM_COMPONENTBUILDER_SERVER_NOTE_FTP_SIGNATURE_DESCRIPTION"
heading="h4"
class="alert alert-success note_ftp_signature" />
<!-- Note_ssh_security Field. Type: Note. A None Database Field. (joomla)-->
<field type="note"
name="note_ssh_security"
label="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_LABEL"
description="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_DESCRIPTION"
heading="h4"
class="alert alert-info note_ssh_security" />
<!-- Port Field. Type: Text. (joomla)-->
<field type="text"
name="port"
label="COM_COMPONENTBUILDER_SERVER_PORT_LABEL"
size="10"
maxlength="50"
default="22"
description="COM_COMPONENTBUILDER_SERVER_PORT_DESCRIPTION"
class="text_area"
required="true"
filter="INT"
message="COM_COMPONENTBUILDER_SERVER_PORT_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PORT_HINT"
onchange="if(!jQuery(this).val().match(/^\d+$/)){jQuery(this).val('')};" />
<!-- Path Field. Type: Text. (joomla)-->
<field type="text"
name="path"
@ -128,48 +161,6 @@
filter="PATH"
message="COM_COMPONENTBUILDER_SERVER_PATH_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PATH_HINT" />
<!-- Port Field. Type: Text. (joomla)-->
<field type="text"
name="port"
label="COM_COMPONENTBUILDER_SERVER_PORT_LABEL"
size="10"
maxlength="50"
description="COM_COMPONENTBUILDER_SERVER_PORT_DESCRIPTION"
class="text_area"
required="true"
filter="INT"
message="COM_COMPONENTBUILDER_SERVER_PORT_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PORT_HINT"
onchange="if(!jQuery(this).val().match(/^\d+$/)){jQuery(this).val('')};" />
<!-- Authentication Field. Type: Radio. (joomla)-->
<field type="radio"
name="authentication"
label="COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_LABEL"
description="COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- Option Set.-->
<option value="1">COM_COMPONENTBUILDER_SERVER_PASSWORD</option>
<option value="2">COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY</option>
</field>
<!-- Note_ssh_security Field. Type: Note. A None Database Field. (joomla)-->
<field type="note"
name="note_ssh_security"
label="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_LABEL"
description="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_DESCRIPTION"
heading="h4"
class="alert alert-info note_ssh_security" />
<!-- Password Field. Type: Password. (joomla)-->
<field type="password"
name="password"
label="COM_COMPONENTBUILDER_SERVER_PASSWORD_LABEL"
size="60"
description="COM_COMPONENTBUILDER_SERVER_PASSWORD_DESCRIPTION"
message="Error! Please add the password here."
class="text_area"
required="true"
filter="raw" />
<!-- Secret Field. Type: Password. (joomla)-->
<field type="password"
name="secret"
@ -179,18 +170,21 @@
message="Error! Please add the passphrase here."
class="text_area"
filter="raw" />
<!-- Host Field. Type: Text. (joomla)-->
<field type="text"
name="host"
label="COM_COMPONENTBUILDER_SERVER_HOST_LABEL"
size="40"
maxlength="150"
description="COM_COMPONENTBUILDER_SERVER_HOST_DESCRIPTION"
class="text_area"
required="true"
filter="STRING"
message="COM_COMPONENTBUILDER_SERVER_HOST_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_HOST_HINT" />
<!-- Authentication Field. Type: List. (joomla)-->
<field type="list"
name="authentication"
label="COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_LABEL"
description="COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_DESCRIPTION"
class="list_class"
multiple="false"
filter="INT"
required="true">
<!-- Option Set.-->
<option value="">COM_COMPONENTBUILDER_SERVER_SELECT_AN_OPTION</option>
<option value="1">COM_COMPONENTBUILDER_SERVER_PASSWORD</option>
<option value="2">COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_FILE</option>
<option value="3">COM_COMPONENTBUILDER_SERVER_BOTH</option>
</field>
<!-- Signature Field. Type: Text. (joomla)-->
<field type="text"
name="signature"
@ -204,6 +198,20 @@
message="COM_COMPONENTBUILDER_SERVER_SIGNATURE_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_SIGNATURE_HINT"
autocomplete="off" />
<!-- Password Field. Type: Password. (joomla)-->
<field type="password"
name="password"
label="COM_COMPONENTBUILDER_SERVER_PASSWORD_LABEL"
size="60"
description="COM_COMPONENTBUILDER_SERVER_PASSWORD_DESCRIPTION"
message="Error! Please add the password here."
class="text_area"
required="true"
filter="raw" />
<!-- Not_required Field. Type: Hidden. (joomla)-->
<field type="hidden"
name="not_required"
default="[]" />
<!-- Username Field. Type: Text. (joomla)-->
<field type="text"
name="username"
@ -216,10 +224,6 @@
filter="STRING"
message="COM_COMPONENTBUILDER_SERVER_USERNAME_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_USERNAME_HINT" />
<!-- Not_required Field. Type: Hidden. (joomla)-->
<field type="hidden"
name="not_required"
default="[]" />
<!-- Private Field. Type: Text. (joomla)-->
<field type="text"
name="private"
@ -234,20 +238,6 @@
filter="PATH"
message="COM_COMPONENTBUILDER_SERVER_PRIVATE_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PRIVATE_HINT" />
<!-- Public Field. Type: Text. (joomla)-->
<field type="text"
name="public"
label="COM_COMPONENTBUILDER_SERVER_PUBLIC_LABEL"
size="50"
maxlength="150"
description="COM_COMPONENTBUILDER_SERVER_PUBLIC_DESCRIPTION"
class="text_area"
readonly="false"
disabled="false"
required="true"
filter="PATH"
message="COM_COMPONENTBUILDER_SERVER_PUBLIC_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PUBLIC_HINT" />
</fieldset>
<!-- Access Control Fields. -->

View File

@ -100,10 +100,10 @@ class ComponentbuilderModelServer extends JModelAdmin
// Get the encryption object.
$basic = new FOFEncryptAes($basickey, 128);
if (!empty($item->path) && $basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true)))
if (!empty($item->host) && $basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true)))
{
// basic decrypt data path.
$item->path = rtrim($basic->decryptString($item->path), "\0");
// basic decrypt data host.
$item->host = rtrim($basic->decryptString($item->host), "\0");
}
if (!empty($item->port) && $basickey && !is_numeric($item->port) && $item->port === base64_encode(base64_decode($item->port, true)))
@ -112,10 +112,10 @@ class ComponentbuilderModelServer extends JModelAdmin
$item->port = rtrim($basic->decryptString($item->port), "\0");
}
if (!empty($item->password) && $basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
if (!empty($item->path) && $basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true)))
{
// basic decrypt data password.
$item->password = rtrim($basic->decryptString($item->password), "\0");
// basic decrypt data path.
$item->path = rtrim($basic->decryptString($item->path), "\0");
}
if (!empty($item->secret) && $basickey && !is_numeric($item->secret) && $item->secret === base64_encode(base64_decode($item->secret, true)))
@ -124,18 +124,18 @@ class ComponentbuilderModelServer extends JModelAdmin
$item->secret = rtrim($basic->decryptString($item->secret), "\0");
}
if (!empty($item->host) && $basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true)))
{
// basic decrypt data host.
$item->host = rtrim($basic->decryptString($item->host), "\0");
}
if (!empty($item->signature) && $basickey && !is_numeric($item->signature) && $item->signature === base64_encode(base64_decode($item->signature, true)))
{
// basic decrypt data signature.
$item->signature = rtrim($basic->decryptString($item->signature), "\0");
}
if (!empty($item->password) && $basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
{
// basic decrypt data password.
$item->password = rtrim($basic->decryptString($item->password), "\0");
}
if (!empty($item->username) && $basickey && !is_numeric($item->username) && $item->username === base64_encode(base64_decode($item->username, true)))
{
// basic decrypt data username.
@ -146,12 +146,6 @@ class ComponentbuilderModelServer extends JModelAdmin
{
// basic decrypt data private.
$item->private = rtrim($basic->decryptString($item->private), "\0");
}
if (!empty($item->public) && $basickey && !is_numeric($item->public) && $item->public === base64_encode(base64_decode($item->public, true)))
{
// basic decrypt data public.
$item->public = rtrim($basic->decryptString($item->public), "\0");
}
if (!empty($item->id))
@ -170,7 +164,7 @@ class ComponentbuilderModelServer extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getWaplinked_components()
public function getWanlinked_components()
{
// Get the user object.
$user = JFactory::getUser();
@ -966,10 +960,10 @@ class ComponentbuilderModelServer extends JModelAdmin
// Get the encryption object
$basic = new FOFEncryptAes($basickey, 128);
// Encrypt data path.
if (isset($data['path']) && $basickey)
// Encrypt data host.
if (isset($data['host']) && $basickey)
{
$data['path'] = $basic->encryptString($data['path']);
$data['host'] = $basic->encryptString($data['host']);
}
// Encrypt data port.
@ -978,10 +972,10 @@ class ComponentbuilderModelServer extends JModelAdmin
$data['port'] = $basic->encryptString($data['port']);
}
// Encrypt data password.
if (isset($data['password']) && $basickey)
// Encrypt data path.
if (isset($data['path']) && $basickey)
{
$data['password'] = $basic->encryptString($data['password']);
$data['path'] = $basic->encryptString($data['path']);
}
// Encrypt data secret.
@ -990,18 +984,18 @@ class ComponentbuilderModelServer extends JModelAdmin
$data['secret'] = $basic->encryptString($data['secret']);
}
// Encrypt data host.
if (isset($data['host']) && $basickey)
{
$data['host'] = $basic->encryptString($data['host']);
}
// Encrypt data signature.
if (isset($data['signature']) && $basickey)
{
$data['signature'] = $basic->encryptString($data['signature']);
}
// Encrypt data password.
if (isset($data['password']) && $basickey)
{
$data['password'] = $basic->encryptString($data['password']);
}
// Encrypt data username.
if (isset($data['username']) && $basickey)
{
@ -1012,12 +1006,6 @@ class ComponentbuilderModelServer extends JModelAdmin
if (isset($data['private']) && $basickey)
{
$data['private'] = $basic->encryptString($data['private']);
}
// Encrypt data public.
if (isset($data['public']) && $basickey)
{
$data['public'] = $basic->encryptString($data['public']);
}
// Set the Params Items to data

View File

@ -152,7 +152,7 @@ class ComponentbuilderModelServers extends JModelList
$protocolArray = array(
0 => 'COM_COMPONENTBUILDER_SERVER_SELECT_AN_OPTION',
1 => 'COM_COMPONENTBUILDER_SERVER_FTP',
2 => 'COM_COMPONENTBUILDER_SERVER_SSH'
2 => 'COM_COMPONENTBUILDER_SERVER_SFTP'
);
// Now check if value is found in this array
if (isset($protocolArray[$value]) && ComponentbuilderHelper::checkString($protocolArray[$value]))
@ -304,36 +304,36 @@ class ComponentbuilderModelServers extends JModelList
continue;
}
if ($basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true)))
if ($basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true)))
{
// decrypt path
$item->path = $basic->decryptString($item->path);
// decrypt host
$item->host = $basic->decryptString($item->host);
}
if ($basickey && !is_numeric($item->port) && $item->port === base64_encode(base64_decode($item->port, true)))
{
// decrypt port
$item->port = $basic->decryptString($item->port);
}
if ($basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
if ($basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true)))
{
// decrypt password
$item->password = $basic->decryptString($item->password);
// decrypt path
$item->path = $basic->decryptString($item->path);
}
if ($basickey && !is_numeric($item->secret) && $item->secret === base64_encode(base64_decode($item->secret, true)))
{
// decrypt secret
$item->secret = $basic->decryptString($item->secret);
}
if ($basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true)))
{
// decrypt host
$item->host = $basic->decryptString($item->host);
}
if ($basickey && !is_numeric($item->signature) && $item->signature === base64_encode(base64_decode($item->signature, true)))
{
// decrypt signature
$item->signature = $basic->decryptString($item->signature);
}
if ($basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
{
// decrypt password
$item->password = $basic->decryptString($item->password);
}
if ($basickey && !is_numeric($item->username) && $item->username === base64_encode(base64_decode($item->username, true)))
{
// decrypt username
@ -344,11 +344,6 @@ class ComponentbuilderModelServers extends JModelList
// decrypt private
$item->private = $basic->decryptString($item->private);
}
if ($basickey && !is_numeric($item->public) && $item->public === base64_encode(base64_decode($item->public, true)))
{
// decrypt public
$item->public = $basic->decryptString($item->public);
}
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);

View File

@ -804,7 +804,6 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_server` (
`port` TEXT NOT NULL,
`private` TEXT NOT NULL,
`protocol` TINYINT(1) NOT NULL DEFAULT 0,
`public` TEXT NOT NULL,
`secret` TEXT NOT NULL,
`signature` TEXT NOT NULL,
`username` TEXT NOT NULL,

View File

@ -7,8 +7,7 @@ ALTER TABLE `#__componentbuilder_server` ADD `path` TEXT NOT NULL AFTER `passwor
ALTER TABLE `#__componentbuilder_server` ADD `port` TEXT NOT NULL AFTER `path`;
ALTER TABLE `#__componentbuilder_server` ADD `private` TEXT NOT NULL AFTER `port`;
ALTER TABLE `#__componentbuilder_server` ADD `protocol` TINYINT(1) NOT NULL DEFAULT 0 AFTER `private`;
ALTER TABLE `#__componentbuilder_server` ADD `public` TEXT NOT NULL AFTER `protocol`;
ALTER TABLE `#__componentbuilder_server` ADD `secret` TEXT NOT NULL AFTER `public`;
ALTER TABLE `#__componentbuilder_server` ADD `secret` TEXT NOT NULL AFTER `protocol`;
ALTER TABLE `#__componentbuilder_server` ADD `username` TEXT NOT NULL AFTER `signature`;
ALTER TABLE `#__componentbuilder_component_files_folders` ADD `addfilesfullpath` TEXT NOT NULL AFTER `addfiles`;

View File

@ -170,7 +170,7 @@ jQuery('#adminForm').on('change', '#jform_protocol',function (e)
jQuery('#jform_protocol').on('keyup',function()
{
var protocol_vvvvwav = jQuery("#jform_protocol").val();
var authentication_vvvvwav = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvwav = jQuery("#jform_authentication").val();
vvvvwav(protocol_vvvvwav,authentication_vvvvwav);
});
@ -178,7 +178,7 @@ jQuery('#adminForm').on('change', '#jform_protocol',function (e)
{
e.preventDefault();
var protocol_vvvvwav = jQuery("#jform_protocol").val();
var authentication_vvvvwav = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvwav = jQuery("#jform_authentication").val();
vvvvwav(protocol_vvvvwav,authentication_vvvvwav);
});
@ -187,7 +187,7 @@ jQuery('#adminForm').on('change', '#jform_protocol',function (e)
jQuery('#jform_authentication').on('keyup',function()
{
var protocol_vvvvwav = jQuery("#jform_protocol").val();
var authentication_vvvvwav = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvwav = jQuery("#jform_authentication").val();
vvvvwav(protocol_vvvvwav,authentication_vvvvwav);
});
@ -195,7 +195,7 @@ jQuery('#adminForm').on('change', '#jform_authentication',function (e)
{
e.preventDefault();
var protocol_vvvvwav = jQuery("#jform_protocol").val();
var authentication_vvvvwav = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvwav = jQuery("#jform_authentication").val();
vvvvwav(protocol_vvvvwav,authentication_vvvvwav);
});
@ -204,7 +204,7 @@ jQuery('#adminForm').on('change', '#jform_authentication',function (e)
jQuery('#jform_protocol').on('keyup',function()
{
var protocol_vvvvwax = jQuery("#jform_protocol").val();
var authentication_vvvvwax = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvwax = jQuery("#jform_authentication").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
});
@ -212,7 +212,7 @@ jQuery('#adminForm').on('change', '#jform_protocol',function (e)
{
e.preventDefault();
var protocol_vvvvwax = jQuery("#jform_protocol").val();
var authentication_vvvvwax = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvwax = jQuery("#jform_authentication").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
});
@ -221,7 +221,7 @@ jQuery('#adminForm').on('change', '#jform_protocol',function (e)
jQuery('#jform_authentication').on('keyup',function()
{
var protocol_vvvvwax = jQuery("#jform_protocol").val();
var authentication_vvvvwax = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvwax = jQuery("#jform_authentication").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
});
@ -229,7 +229,7 @@ jQuery('#adminForm').on('change', '#jform_authentication',function (e)
{
e.preventDefault();
var protocol_vvvvwax = jQuery("#jform_protocol").val();
var authentication_vvvvwax = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvwax = jQuery("#jform_authentication").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
});
@ -237,7 +237,7 @@ jQuery('#adminForm').on('change', '#jform_authentication',function (e)
// #jform_authentication listeners for authentication_vvvvway function
jQuery('#jform_authentication').on('keyup',function()
{
var authentication_vvvvway = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvway = jQuery("#jform_authentication").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
@ -245,7 +245,7 @@ jQuery('#jform_authentication').on('keyup',function()
jQuery('#adminForm').on('change', '#jform_authentication',function (e)
{
e.preventDefault();
var authentication_vvvvway = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvway = jQuery("#jform_authentication").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
@ -254,7 +254,7 @@ jQuery('#adminForm').on('change', '#jform_authentication',function (e)
// #jform_protocol listeners for protocol_vvvvway function
jQuery('#jform_protocol').on('keyup',function()
{
var authentication_vvvvway = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvway = jQuery("#jform_authentication").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
@ -262,7 +262,7 @@ jQuery('#jform_protocol').on('keyup',function()
jQuery('#adminForm').on('change', '#jform_protocol',function (e)
{
e.preventDefault();
var authentication_vvvvway = jQuery("#jform_authentication input[type='radio']:checked").val();
var authentication_vvvvway = jQuery("#jform_authentication").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);

View File

@ -64,7 +64,7 @@ class ComponentbuilderViewServer extends JViewLegacy
}
// Get Linked view data
$this->waplinked_components = $this->get('Waplinked_components');
$this->wanlinked_components = $this->get('Wanlinked_components');
// Set the toolbar
$this->addToolBar();

View File

@ -112,8 +112,5 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo
<language tag="en-GB">language/en-GB/en-GB.com_componentbuilder.sys.ini</language>
</languages>
</administration>
<updateservers>
<server type="extension" enabled="1" element="com_componentbuilder" name="Component Builder">https://raw.githubusercontent.com/vdm-io/Joomla-Component-Builder/master/componentbuilder_update_server.xml</server>
</updateservers>
</administration>
</extension>

View File

@ -1,427 +0,0 @@
<updates>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.5.0</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.0/JCB_v2.5.0.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.5.1</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.1/JCB_v2.5.1.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.5.2</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.4/JCB_v2.5.4.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.5.3</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.4/JCB_v2.5.4.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.5.4</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.4/JCB_v2.5.4.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.5.5</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.5/JCB_v2.5.5.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.5.6</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.6/JCB_v2.5.6.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.5.7</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.8/JCB_v2.5.8.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.5.8</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.8/JCB_v2.5.8.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.0</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.0/JCB_v2.6.0.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.1</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.1/JCB_v2.6.1.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.2</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.2/JCB_v2.6.2.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.3</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.3/JCB_v2.6.3.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.4</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.5/JCB_v2.6.5.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.5</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.5/JCB_v2.6.5.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.6</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.6/JCB_v2.6.6.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.7</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.7/JCB_v2.6.7.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.8</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.8/JCB_v2.6.8.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.9</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.9/JCB_v2.6.9.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.10</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.10/JCB_v2.6.10.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.11</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.11/JCB_v2.6.11.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.12</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.12/JCB_v2.6.12.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.13</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.13/JCB_v2.6.13.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.14</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.14/JCB_v2.6.14.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.15</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.15/JCB_v2.6.15.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>

View File

@ -3398,7 +3398,7 @@ class com_componentbuilderInstallerScript
$server->type_title = 'Componentbuilder Server';
$server->type_alias = 'com_componentbuilder.server';
$server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","path":"path","port":"port","authentication":"authentication","password":"password","secret":"secret","host":"host","signature":"signature","username":"username","not_required":"not_required","private":"private","public":"public"}}';
$server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","host":"host","port":"port","path":"path","secret":"secret","authentication":"authentication","signature":"signature","password":"password","not_required":"not_required","username":"username","private":"private"}}';
$server->router = 'ComponentbuilderHelperRoute::getServerRoute';
$server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","protocol","authentication","not_required"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
@ -4080,7 +4080,7 @@ class com_componentbuilderInstallerScript
$server->type_title = 'Componentbuilder Server';
$server->type_alias = 'com_componentbuilder.server';
$server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","path":"path","port":"port","authentication":"authentication","password":"password","secret":"secret","host":"host","signature":"signature","username":"username","not_required":"not_required","private":"private","public":"public"}}';
$server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","host":"host","port":"port","path":"path","secret":"secret","authentication":"authentication","signature":"signature","password":"password","not_required":"not_required","username":"username","private":"private"}}';
$server->router = 'ComponentbuilderHelperRoute::getServerRoute';
$server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","protocol","authentication","not_required"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';

View File

@ -1009,6 +1009,160 @@ abstract class ComponentbuilderHelper
return $none;
}
/**
* Load the Composer Vendors
**/
public static function composerAutoload()
{
// load the autoloader
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/vendor/autoload.php';
}
/**
* the SFTP object
**/
protected static $sftp = array();
/**
* get the sftp object
*
* @param int $serverID The server local id to use
*
* @return object on success with sftp power
**/
public static function getSftp($serverID)
{
// check if it was already set
if (!self::checkObject(self::$sftp[$serverID]))
{
// check if we have a server with that id
if ($server = self::getServerDetails($serverID, 2))
{
// make sure we have the composer classes loaded
self::composerAutoload();
// insure the port is set
$server->port = (isset($server->port) && is_int($server->port) && $server->port > 0) ? $server->port : 22;
// open the connection
self::$sftp[$serverID] = new phpseclib\Net\SFTP($server->host, $server->port);
// now login based on authentication type
switch($server->authentication)
{
case 1: // password
// now login
if (!self::$sftp[$serverID]->login($server->username, $server->password))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_AND_PASSWORD_ARE_CORRECT', $server->name), 'Error');
return false;
}
break;
case 2: // private key file
$rsa = new phpseclib\Crypt\RSA();
// check if we have a passprase
if (self::checkString($server->secret))
{
$rsa->setPassword($server->secret);
}
// now load the key file
if (!$rsa->loadKey(self::getFileContents($server->private, null)))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error');
return false;
}
// now login
if (!self::$sftp[$serverID]->login($server->username, $rsa))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_AND_PRIVATE_KEY_FILE_ARE_CORRECT', $server->name), 'Error');
return false;
}
break;
case 3: // both password and private key file
$rsa = new phpseclib\Crypt\RSA();
// check if we have a passphrase
if (self::checkString($server->secret))
{
$rsa->setPassword($server->secret);
}
// now load the key file
if (!$rsa->loadKey(self::getFileContents($server->private, null)))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error');
return false;
}
// now login
if (!self::$sftp[$serverID]->login($server->username, $server->password, $rsa))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_PASSWORD_AND_PRIVATE_KEY_FILE_ARE_CORRECT', $server->name), 'Error');
return false;
}
break;
}
// set some defaults
self::$sftp[$serverID]->remote_server_name = $server->name;
self::$sftp[$serverID]->remote_server_path = (self::checkString($server->path) && $server->path !== '/') ? $server->path : '';
}
else
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BSB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error');
return false;
}
}
// return the sftp object
return self::$sftp[$serverID];
}
/**
* get the server details
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
*
* @return array on success with sftp server details
**/
protected static function getServerDetails($serverID, $protocol = 2)
{
if (is_int($serverID) && is_int($serverID))
{
// Get a db connection
$db = JFactory::getDbo();
// start the query
$query = $db->getQuery(true);
// select based to protocal
if (2 == $protocol)
{
$query->select($db->quoteName(array('name','authentication','username','host','password','path','port','private','secret')));
}
else
{
$query->select($db->quoteName(array('name','signature')));
}
$query->from($db->quoteName('#__componentbuilder_server'));
$query->where($db->quoteName('id') . ' = ' . (int) $serverID);
$query->where($db->quoteName('protocol') . ' = ' . (int) $protocol);
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$server = $db->loadObject();
// Get the basic encryption.
$basickey = self::getCryptKey('basic');
// Get the encryption object.
$basic = new FOFEncryptAes($basickey, 128);
// unlock the needed fields
foreach($server as $name => $value)
{
if ($name !== 'name' && !empty($server->{$name}) && $basickey && !is_numeric($server->{$name}) && $server->{$name} === base64_encode(base64_decode($server->{$name}, true)))
{
// basic decrypt of data
$server->{$name} = rtrim($basic->decryptString($server->{$name}), "\0");
}
}
// return the server details
return $server;
}
}
return false;
}
public static function jsonToString($value, $sperator = ", ", $table = null)
{

View File

@ -37,8 +37,13 @@ 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_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>."
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_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="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 settings, bottom right there is a field called Export Key."
COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_AND_PASSWORD_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your username and password are correct!"
COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_AND_PRIVATE_KEY_FILE_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your username and private key file are correct!"
COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_USERNAME_PASSWORD_AND_PRIVATE_KEY_FILE_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your username, password and private key file are correct!"
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: <code>%s</code>"
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for <b>%s</b> server!"
COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BSB_COULD_NOT_BE_RETRIEVED="The server details for <b>(%s)</b> could not be retrieved!"
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."