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