Started with the first adaptation to implement the ssh protocol as mentioned in gh-230
This commit is contained in:
@ -316,19 +316,19 @@ class Compiler extends Infusion
|
||||
{
|
||||
$xml_update_server_path = $this->componentPath . '/' . $this->updateServerFileName . '.xml';
|
||||
// make sure we have the correct file
|
||||
if (JFile::exists($xml_update_server_path) && isset($this->componentData->update_server_ftp))
|
||||
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_ftp) && $basickey && !is_numeric($this->componentData->update_server_ftp) && $this->componentData->update_server_ftp === base64_encode(base64_decode($this->componentData->update_server_ftp, true)))
|
||||
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_ftp.
|
||||
$this->componentData->update_server_ftp = rtrim($basic->decryptString($this->componentData->update_server_ftp), "\0");
|
||||
// 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_ftp);
|
||||
$this->moveFileToFtpServer($xml_update_server_path, $this->componentData->update_server);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -497,19 +497,19 @@ class Compiler extends Infusion
|
||||
if ($this->componentData->add_sales_server == 1 && $this->dynamicIntegration)
|
||||
{
|
||||
// make sure we have the correct file
|
||||
if (isset($this->componentData->sales_server_ftp))
|
||||
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_ftp) && $basickey && !is_numeric($this->componentData->sales_server_ftp) && $this->componentData->sales_server_ftp === base64_encode(base64_decode($this->componentData->sales_server_ftp, true)))
|
||||
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 update_server_ftp.
|
||||
$this->componentData->sales_server_ftp = rtrim($basic->decryptString($this->componentData->sales_server_ftp), "\0");
|
||||
// basic decript data update_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_ftp, $this->componentSalesName . '.zip', false);
|
||||
$this->moveFileToFtpServer($this->filepath, $this->componentData->sales_server, $this->componentSalesName . '.zip', false);
|
||||
}
|
||||
}
|
||||
// remove the component folder since we are done
|
||||
|
@ -1141,23 +1141,23 @@ class Get
|
||||
// reset back to nowlang
|
||||
$this->lang = $nowLang;
|
||||
|
||||
// add the update FTP server sig
|
||||
if ($component->add_update_server == 1 && is_numeric($component->update_server_ftp) && $component->update_server_ftp > 0)
|
||||
// add the update server details
|
||||
if ($component->add_update_server == 1 && is_numeric($component->update_server) && $component->update_server > 0)
|
||||
{
|
||||
$component->update_server_ftp = ComponentbuilderHelper::getVar('ftp', (int) $component->update_server_ftp, 'id', 'signature');
|
||||
$component->update_server = ComponentbuilderHelper::getVar('server', (int) $component->update_server, 'id', 'signature');
|
||||
}
|
||||
else
|
||||
{
|
||||
$component->update_server_ftp = 0;
|
||||
$component->update_server = 0;
|
||||
}
|
||||
// add the sales FTP server sig
|
||||
if ($component->add_sales_server == 1 && is_numeric($component->sales_server_ftp) && $component->sales_server_ftp > 0)
|
||||
// add the sales server details
|
||||
if ($component->add_sales_server == 1 && is_numeric($component->sales_server) && $component->sales_server > 0)
|
||||
{
|
||||
$component->sales_server_ftp = ComponentbuilderHelper::getVar('ftp', (int) $component->sales_server_ftp, 'id', 'signature');
|
||||
$component->sales_server = ComponentbuilderHelper::getVar('server', (int) $component->sales_server, 'id', 'signature');
|
||||
}
|
||||
else
|
||||
{
|
||||
$component->sales_server_ftp = 0;
|
||||
$component->sales_server = 0;
|
||||
$component->add_sales_server = 0;
|
||||
}
|
||||
// set the ignore folders for repo if found
|
||||
|
@ -700,7 +700,7 @@ class Interpretation extends Fields
|
||||
{
|
||||
$updateXML[] = '</updates>';
|
||||
// ###UPDATE_SERVER_XML###
|
||||
$name = str_replace('.xml', '', substr($this->componentData->update_server, strrpos($this->componentData->update_server, '/') + 1));
|
||||
$name = str_replace('.xml', '', substr($this->componentData->update_server_url, strrpos($this->componentData->update_server_url, '/') + 1));
|
||||
$target = array('admin' => $name);
|
||||
$this->buildDynamique($target, 'update_server');
|
||||
$this->fileContentDynamic[$name]['###UPDATE_SERVER_XML###'] = implode(PHP_EOL, $updateXML);
|
||||
@ -710,12 +710,12 @@ class Interpretation extends Fields
|
||||
}
|
||||
}
|
||||
// add the update server link to component XML
|
||||
if ($this->componentData->add_update_server && isset($this->componentData->update_server) && ComponentbuilderHelper::checkString($this->componentData->update_server))
|
||||
if ($this->componentData->add_update_server && isset($this->componentData->update_server_url) && ComponentbuilderHelper::checkString($this->componentData->update_server_url))
|
||||
{
|
||||
// ###UPDATESERVER###
|
||||
$updateServer = array();
|
||||
$updateServer[] = PHP_EOL . "\t<updateservers>";
|
||||
$updateServer[] = "\t\t" . '<server type="extension" enabled="1" element="com_' . $this->fileContentStatic['###component###'] . '" name="' . $this->fileContentStatic['###Component_name###'] . '">' . $this->componentData->update_server . '</server>';
|
||||
$updateServer[] = "\t\t" . '<server type="extension" enabled="1" element="com_' . $this->fileContentStatic['###component###'] . '" name="' . $this->fileContentStatic['###Component_name###'] . '">' . $this->componentData->update_server_url . '</server>';
|
||||
$updateServer[] = "\t</updateservers>";
|
||||
// return the array to string
|
||||
$updateServer = implode(PHP_EOL, $updateServer);
|
||||
@ -2241,9 +2241,14 @@ class Interpretation extends Fields
|
||||
$getItem .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set data object to item.";
|
||||
$getItem .= PHP_EOL . "\t" . $tab . "\t\$this->_item[\$pk] = \$data;";
|
||||
}
|
||||
// check if the dispather should be added
|
||||
if (isset($this->JEventDispatcher) && ComponentbuilderHelper::checkArray($this->JEventDispatcher))
|
||||
// only update if dispacher placholder is found
|
||||
if (strpos($getItem, '###DISPATCHER###') !== false)
|
||||
{
|
||||
// check if the dispather should be added
|
||||
if (!isset($this->JEventDispatcher) || !ComponentbuilderHelper::checkArray($this->JEventDispatcher))
|
||||
{
|
||||
$this->JEventDispatcher = array('###DISPATCHER###' => '');
|
||||
}
|
||||
$getItem = str_replace(array_keys($this->JEventDispatcher), array_values($this->JEventDispatcher), $getItem);
|
||||
}
|
||||
return $getItem;
|
||||
@ -2696,9 +2701,14 @@ class Interpretation extends Fields
|
||||
$methods = str_replace('###CRYPT###', '', $methods);
|
||||
}
|
||||
}
|
||||
// check if the dispatcher must be set
|
||||
if (isset($this->JEventDispatcher) && ComponentbuilderHelper::checkArray($this->JEventDispatcher))
|
||||
// only update if dispacher placholder is found
|
||||
if (strpos($methods, '###DISPATCHER###') !== false)
|
||||
{
|
||||
// check if the dispather should be added
|
||||
if (!isset($this->JEventDispatcher) || !ComponentbuilderHelper::checkArray($this->JEventDispatcher))
|
||||
{
|
||||
$this->JEventDispatcher = array('###DISPATCHER###' => '');
|
||||
}
|
||||
$methods = str_replace(array_keys($this->JEventDispatcher), array_values($this->JEventDispatcher), $methods);
|
||||
}
|
||||
return $methods . PHP_EOL;
|
||||
@ -2849,9 +2859,14 @@ class Interpretation extends Fields
|
||||
$asBucket[] = $main_get['as'];
|
||||
}
|
||||
}
|
||||
// check if we should load the dispatcher
|
||||
if (isset($this->JEventDispatcher) && ComponentbuilderHelper::checkArray($this->JEventDispatcher))
|
||||
// only update if dispacher placholder is found
|
||||
if (strpos($getItem, '###DISPATCHER###') !== false)
|
||||
{
|
||||
// check if the dispather should be added
|
||||
if (!isset($this->JEventDispatcher) || !ComponentbuilderHelper::checkArray($this->JEventDispatcher))
|
||||
{
|
||||
$this->JEventDispatcher = array('###DISPATCHER###' => '');
|
||||
}
|
||||
$getItem = str_replace(array_keys($this->JEventDispatcher), array_values($this->JEventDispatcher), $getItem);
|
||||
}
|
||||
// setup Globals
|
||||
|
@ -1932,6 +1932,13 @@ abstract class ComponentbuilderHelper
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
elseif (property_exists('ComponentbuilderHelper', 'curlErrorLoaded') && !self::$curlErrorLoaded)
|
||||
{
|
||||
// set the notice
|
||||
JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP'), 'Error');
|
||||
// load this notice only once
|
||||
self::$curlErrorLoaded = true;
|
||||
}
|
||||
}
|
||||
return $none;
|
||||
}
|
||||
@ -2150,9 +2157,9 @@ abstract class ComponentbuilderHelper
|
||||
{
|
||||
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_LANGUAGES'), 'index.php?option=com_componentbuilder&view=languages', $submenu === 'languages');
|
||||
}
|
||||
if ($user->authorise('ftp.access', 'com_componentbuilder') && $user->authorise('ftp.submenu', 'com_componentbuilder'))
|
||||
if ($user->authorise('server.access', 'com_componentbuilder') && $user->authorise('server.submenu', 'com_componentbuilder'))
|
||||
{
|
||||
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_FTPS'), 'index.php?option=com_componentbuilder&view=ftps', $submenu === 'ftps');
|
||||
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_SERVERS'), 'index.php?option=com_componentbuilder&view=servers', $submenu === 'servers');
|
||||
}
|
||||
if ($user->authorise('help_document.access', 'com_componentbuilder') && $user->authorise('help_document.submenu', 'com_componentbuilder'))
|
||||
{
|
||||
|
Reference in New Issue
Block a user