From c3156642b2af2d51a3d81954ceaa909148cb5342 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sun, 18 Feb 2018 00:47:01 +0200 Subject: [PATCH] Added more security to the composer vendor folder. Added the SFTP get helper classes, and adapted the compiler to use SFTP --- README.md | 6 +- admin/README.txt | 6 +- admin/helpers/compiler.php | 70 ++- admin/helpers/compiler/a_Get.php | 36 +- admin/helpers/componentbuilder.php | 154 +++++++ admin/helpers/vendor/.htaccess | 9 + admin/helpers/vendor/autoload.php | 2 +- .../vendor/composer/autoload_classmap.php | 24 + .../helpers/vendor/composer/autoload_real.php | 14 +- .../vendor/composer/autoload_static.php | 34 +- admin/helpers/vendor/web.config | 8 + .../en-GB/en-GB.com_componentbuilder.ini | 25 +- admin/layouts/server/details_right.php | 1 - .../server/linked_components_fullwidth.php | 2 +- admin/models/forms/help_document.js | 60 +-- admin/models/forms/server.js | 62 +-- admin/models/forms/server.xml | 136 +++--- admin/models/server.php | 62 +-- admin/models/servers.php | 29 +- admin/sql/install.mysql.utf8.sql | 1 - admin/sql/updates/mysql/2.6.14.sql | 3 +- admin/views/server/tmpl/edit.php | 24 +- admin/views/server/view.html.php | 2 +- componentbuilder.xml | 5 +- componentbuilder_update_server.xml | 427 ------------------ script.php | 4 +- site/helpers/componentbuilder.php | 154 +++++++ .../en-GB/en-GB.com_componentbuilder.ini | 5 + 28 files changed, 642 insertions(+), 723 deletions(-) create mode 100644 admin/helpers/vendor/.htaccess create mode 100644 admin/helpers/vendor/web.config delete mode 100644 componentbuilder_update_server.xml diff --git a/README.md b/README.md index 8d52a57c9..2e0765795 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/admin/README.txt b/admin/README.txt index 8d52a57c9..2e0765795 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -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). diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 2cb7a0378..3ab9b997e 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -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 %s file could not be moved to %s path on %s 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 %s file could not be moved to %s path on %s 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 diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index ae02f8c5f..3e36c5c75 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -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)) diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 83f9119a1..6450530cd 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -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. **/ diff --git a/admin/helpers/vendor/.htaccess b/admin/helpers/vendor/.htaccess new file mode 100644 index 000000000..9afb1a1b3 --- /dev/null +++ b/admin/helpers/vendor/.htaccess @@ -0,0 +1,9 @@ +# Apache 2.4+ + + Require all denied + + +# Apache 2.0-2.2 + + Deny from all + diff --git a/admin/helpers/vendor/autoload.php b/admin/helpers/vendor/autoload.php index accafb459..60086a81b 100644 --- a/admin/helpers/vendor/autoload.php +++ b/admin/helpers/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitd317c2705193f17bc1491bacb879ddc5::getLoader(); +return ComposerAutoloaderInite1af6c9ee1d0c9dfa4a8dcea26b35570::getLoader(); diff --git a/admin/helpers/vendor/composer/autoload_classmap.php b/admin/helpers/vendor/composer/autoload_classmap.php index 7a91153b0..2f4700ebd 100644 --- a/admin/helpers/vendor/composer/autoload_classmap.php +++ b/admin/helpers/vendor/composer/autoload_classmap.php @@ -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', ); diff --git a/admin/helpers/vendor/composer/autoload_real.php b/admin/helpers/vendor/composer/autoload_real.php index 102b2cdb0..0eecfe833 100644 --- a/admin/helpers/vendor/composer/autoload_real.php +++ b/admin/helpers/vendor/composer/autoload_real.php @@ -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; diff --git a/admin/helpers/vendor/composer/autoload_static.php b/admin/helpers/vendor/composer/autoload_static.php index 6a993d5f9..b076aa4b4 100644 --- a/admin/helpers/vendor/composer/autoload_static.php +++ b/admin/helpers/vendor/composer/autoload_static.php @@ -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); } diff --git a/admin/helpers/vendor/web.config b/admin/helpers/vendor/web.config new file mode 100644 index 000000000..f7a77db28 --- /dev/null +++ b/admin/helpers/vendor/web.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 1dd4208b8..be50dae6e 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -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
(basic encryption)" +COM_COMPONENTBUILDER_SERVER_HOST_LABEL="Host/IP
(basic encryption)" 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.
Here are the details of the signature:
   string $host = '127.0.0.1'
   string $port = '21'
   array $options = array()
   string $user = null
   string $pass = null
   OPTIONS = Array with any of these options:
      type=>[FTP_AUTOASCII|FTP_ASCII|FTP_BINARY]
      timeout=>(int)
Here is an example signature:
host=HOSTNAME&port=PORT_INT&options[type]=FTP_BINARY&options[timeout]=15&username=user@name.com&password=password" COM_COMPONENTBUILDER_SERVER_NOTE_FTP_SIGNATURE_LABEL="The FTP Signature Details" -COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_DESCRIPTION="Do not use this feature if you do not know exactly what you are doing! 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="Do not use this feature if you do not know exactly what you are doing! 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
(basic encryption)" 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
(basic encryption)" -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
(basic encryption)" 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)
(encrypted field)
This field is only encrypted if your basic key in the JCB global settings is set." 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 %s 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 %s 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 %s 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 (%s) can not be changed to %s 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: %s" 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 %s 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 names of either or the snippet, library or snippet types 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 keep to the community naming 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 (%s) 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" diff --git a/admin/layouts/server/details_right.php b/admin/layouts/server/details_right.php index 6814f6bcc..5ee444150 100644 --- a/admin/layouts/server/details_right.php +++ b/admin/layouts/server/details_right.php @@ -33,7 +33,6 @@ $fields = $displayData->get('fields') ?: array( 'authentication', 'password', 'private', - 'public', 'secret' ); diff --git a/admin/layouts/server/linked_components_fullwidth.php b/admin/layouts/server/linked_components_fullwidth.php index 5a27bff4c..65ab05ca8 100644 --- a/admin/layouts/server/linked_components_fullwidth.php +++ b/admin/layouts/server/linked_components_fullwidth.php @@ -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"; diff --git a/admin/models/forms/help_document.js b/admin/models/forms/help_document.js index fb2bd54da..6d7bb2a20 100644 --- a/admin/models/forms/help_document.js +++ b/admin/models/forms/help_document.js @@ -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; } } } diff --git a/admin/models/forms/server.js b/admin/models/forms/server.js index 129d60baa..149a7b199 100644 --- a/admin/models/forms/server.js +++ b/admin/models/forms/server.js @@ -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; } diff --git a/admin/models/forms/server.xml b/admin/models/forms/server.xml index 4b58a9def..e9383e043 100644 --- a/admin/models/forms/server.xml +++ b/admin/models/forms/server.xml @@ -105,8 +105,20 @@ - + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - diff --git a/admin/models/server.php b/admin/models/server.php index 19489f202..83c89048e 100644 --- a/admin/models/server.php +++ b/admin/models/server.php @@ -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 diff --git a/admin/models/servers.php b/admin/models/servers.php index 14b9b38f0..ba0d834d4 100644 --- a/admin/models/servers.php +++ b/admin/models/servers.php @@ -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); diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 08b580bb3..366410bd6 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -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, diff --git a/admin/sql/updates/mysql/2.6.14.sql b/admin/sql/updates/mysql/2.6.14.sql index 7570009c2..62a6922aa 100644 --- a/admin/sql/updates/mysql/2.6.14.sql +++ b/admin/sql/updates/mysql/2.6.14.sql @@ -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`; diff --git a/admin/views/server/tmpl/edit.php b/admin/views/server/tmpl/edit.php index 45ebcf289..cb3575c99 100644 --- a/admin/views/server/tmpl/edit.php +++ b/admin/views/server/tmpl/edit.php @@ -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); diff --git a/admin/views/server/view.html.php b/admin/views/server/view.html.php index 49944c97c..993a06a09 100644 --- a/admin/views/server/view.html.php +++ b/admin/views/server/view.html.php @@ -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(); diff --git a/componentbuilder.xml b/componentbuilder.xml index 20d4d515c..6ed3a4090 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -112,8 +112,5 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo language/en-GB/en-GB.com_componentbuilder.sys.ini - - - https://raw.githubusercontent.com/vdm-io/Joomla-Component-Builder/master/componentbuilder_update_server.xml - + \ No newline at end of file diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml deleted file mode 100644 index 2fb63636a..000000000 --- a/componentbuilder_update_server.xml +++ /dev/null @@ -1,427 +0,0 @@ - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.5.0 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.0/JCB_v2.5.0.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.5.1 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.1/JCB_v2.5.1.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.5.2 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.4/JCB_v2.5.4.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.5.3 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.4/JCB_v2.5.4.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.5.4 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.4/JCB_v2.5.4.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.5.5 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.5/JCB_v2.5.5.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.5.6 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.6/JCB_v2.5.6.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.5.7 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.8/JCB_v2.5.8.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.5.8 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.8/JCB_v2.5.8.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.0 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.0/JCB_v2.6.0.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.1 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.1/JCB_v2.6.1.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.2 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.2/JCB_v2.6.2.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.3 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.3/JCB_v2.6.3.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.4 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.5/JCB_v2.6.5.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.5 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.5/JCB_v2.6.5.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.6 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.6/JCB_v2.6.6.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.7 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.7/JCB_v2.6.7.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.8 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.8/JCB_v2.6.8.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.9 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.9/JCB_v2.6.9.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.10 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.10/JCB_v2.6.10.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.11 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.11/JCB_v2.6.11.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.12 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.12/JCB_v2.6.12.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.13 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.13/JCB_v2.6.13.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.14 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.14/JCB_v2.6.14.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - - Component Builder - Builds Complex Joomla Components - com_componentbuilder - component - 2.6.15 - http://joomlacomponentbuilder.com - - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.15/JCB_v2.6.15.zip - - - stable - - Llewellyn van der Merwe - http://joomlacomponentbuilder.com - - - \ No newline at end of file diff --git a/script.php b/script.php index e57abac0a..56bf29e16 100644 --- a/script.php +++ b/script.php @@ -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"}]}'; diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index 1e60296ed..e0aea1303 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -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) { diff --git a/site/language/en-GB/en-GB.com_componentbuilder.ini b/site/language/en-GB/en-GB.com_componentbuilder.ini index eb4706a7c..6372ffbc3 100644 --- a/site/language/en-GB/en-GB.com_componentbuilder.ini +++ b/site/language/en-GB/en-GB.com_componentbuilder.ini @@ -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 settings, bottom right there is a field called Export Key." 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 %s 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 %s 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 %s 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: %s" 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 %s server!" +COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BSB_COULD_NOT_BE_RETRIEVED="The server details for (%s) 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 JCB Global Options, go to the Company 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."