Moved the composer vendor folder to libraries and removed it from the admin/helpers folder. Improved the dynamic folder include concept.

This commit is contained in:
2018-02-28 04:27:03 +02:00
parent 1b86f1539a
commit 7f3dae297a
59 changed files with 470 additions and 2108 deletions

View File

@@ -50,115 +50,6 @@ class ComponentbuilderControllerApi extends JControllerForm
}
public function handshake()
{
// get input values
$input = JFactory::getApplication()->input;
// get Trust
$PUBLIC = $input->post->get('VDM_PUBLIC', null, 'STRING');
$SECRET = $input->post->get('VDM_SECRET', null, 'STRING');
$ID = $input->post->get('VDM_ID', null, 'STRING');
// check if correct value is given
if (ComponentbuilderHelper::checkString($PUBLIC) && ComponentbuilderHelper::checkString($SECRET) && ComponentbuilderHelper::checkString($ID))
{
// use the JCB open public protocol to open this
$opened = ComponentbuilderHelper::openPublicProtocol($SECRET, $ID, $PUBLIC);
// simple check to have a little more hoops
if (ComponentbuilderHelper::checkString($opened['public']) && ComponentbuilderHelper::checkString($opened['id'])
&& strpos($opened['public'], '-----BEGIN PUBLIC KEY-----') !== false
&& strpos($opened['public'], '-----END PUBLIC KEY-----') !== false
&& strpos($opened['id'], 'VDM_') !== false
&& strpos($opened['id'], '_SP') !== false)
&& ComponentbuilderHelper::checkObject(ComponentbuilderHelper::crypt('RSA')))
{
array('public' => ComponentbuilderHelper::getPublicKey($opened['id'], $opened['public']), 'id' => $opened['id']), $opened['public']
ComponentbuilderHelper::crypt();
// clear session
JFactory::getApplication()->getSession()->destroy();
jexit();
}
}
}
// die since have no trust
echo 12;
// clear session
JFactory::getApplication()->getSession()->destroy();
jexit();
}
public function trust()
{
// get input values
$input = JFactory::getApplication()->input;
// get Trust
$TRUST = $input->post->get('VDM_TRUST', null, 'STRING');
// check if correct value is given
if (ComponentbuilderHelper::checkString($TRUST))
{
$key = ComponentbuilderHelper::salt(1, 2);
// get the trust
$trustArray = ComponentbuilderHelper::unlock($TRUST, $key, null);
// check the array
if (ComponentbuilderHelper::checkArray($trustArray)
&& isset($trustArray['request_id']) && is_numeric($trustArray['request_id'])
&& isset($trustArray['chain']) && ComponentbuilderHelper::checkArray($trustArray['chain'])
&& isset($trustArray['url']) && ComponentbuilderHelper::checkString($trustArray['url'])
&& isset($trustArray['path']) && ComponentbuilderHelper::checkString($trustArray['path'])
&& isset($trustArray['email']) && ComponentbuilderHelper::checkString($trustArray['email'])
&& isset($trustArray['name']) && ComponentbuilderHelper::checkString($trustArray['name'])
&& isset($trustArray['method']) && is_numeric($trustArray['method']) && $trustArray['method'] > 0)
{
// send the request
echo ComponentbuilderHelper::requestTrust($trustArray);
// clear session
JFactory::getApplication()->getSession()->destroy();
jexit();
}
}
// die since have no trust
echo 12;
// clear session
JFactory::getApplication()->getSession()->destroy();
jexit();
}
public function itrust()
{
// get input values
$input = JFactory::getApplication()->input;
// get allowed string
$allow = $input->get('allow', null, 'STRING');
// check if correct value is given
if (ComponentbuilderHelper::checkString($allow))
{
// get the request ID
$request_id = ComponentbuilderHelper::unlock($allow, null, 4);
// check the array
if (ComponentbuilderHelper::checkString($request_id)
&& strpos($request_id, 'VDM_') !== false
&& strpos($request_id, '_SP') !== false)
{
$request_id = str_replace(array('VDM_', '_SP'), '', $request_id);
$request_id = (string) 'VDM_' . preg_replace("/[^0-9]/", "", $request_id) . '_SP';
if ($id = ComponentbuilderHelper::getVar('trust_site', $request_id, 'request_id', 'id'))
{
if ($message = ComponentbuilderHelper::confirmTrust($id))
{
// push out the message
echo $message;
// clear session
JFactory::getApplication()->getSession()->destroy();
jexit();
}
}
}
}
// clear session
JFactory::getApplication()->getSession()->destroy();
// die since have no trust
jexit('Restricted access');
}
public function backup()
{
// get params first

View File

@@ -1050,7 +1050,7 @@ abstract class ComponentbuilderHelper
if (!self::$composer)
{
// load the autoloader
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/vendor/autoload.php';
require_once JPATH_SITE.'/libraries/vdm_io/vendor/autoload.php';
// do not load again
self::$composer = true;
}
@@ -1160,7 +1160,7 @@ abstract class ComponentbuilderHelper
if (!class_exists('\phpseclib\Net\SFTP'))
{
// class not in place so send out error
JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_ADMINHELPERSVENDOR_FOLDER_OF_JCB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error');
JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error');
return false;
}
// insure the port is set

View File

@@ -38,7 +38,7 @@ COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCES
COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT="Since the owner details are displayed during import process before adding the key, this way if the user/dev does not have the key they can see where to get it."
COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB="That means anyone who has this package can install it into JCB. To add an export key simply open the component, go to the tab called <b>settings</b>, bottom right there is a field called <b>Export Key</b>."
COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="That means anyone who has this package can install it into JCB. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key."
COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_ADMINHELPERSVENDOR_FOLDER_OF_JCB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The <b>phpseclib\NET\SFTP</b> library\class is not available! This library\class should have been added to your admin/helpers/vendor folder of JCB. Please contact your system administrator for more info"
COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The <b>phpseclib\NET\SFTP</b> library\class is not available! This library\class should have been added to your <b>libraries/vdm_io/vendor</b> folder. Please contact your system administrator for more info"
COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER="The <b>%s</b> file could not be moved to <b>%s</b> path on <b>%s</b> server."
COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER="The <b>%s</b> file could not be moved to <b>%s</b> server."
COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP connection for <b>%s</b> could not be made. Please check your signature details!"