defined('_JEXEC') or die('Restricted access'); // Load the libraries require_once JPATH_SITE . '/components/com_magebridge/helpers/loader.php'; require_once JPATH_COMPONENT . '/helpers/acl.php'; // If no view has been set, try the default if (JRequest::getCmd('view') == '') { JRequest::setVar('view', 'home'); } // Handle the SSO redirect if (JRequest::getInt('sso') == 1) { JRequest::setVar('task', 'ssoCheck'); } // Make sure the user is authorised to view this page if (MageBridgeAclHelper::isAuthorized() == false) { return false; } // Initialize debugging MagebridgeModelDebug::init(); // Require the current controller $view = JRequest::getCmd('view'); $controller_file = JPATH_COMPONENT . '/controllers/' . $view . '.php'; if (is_file($controller_file)) { require_once $controller_file; $controller_name = 'MageBridgeController' . ucfirst($view); $controller = new $controller_name(); } else { $controller = new MageBridgeController(); } // Perform the requested task $controller->execute(JRequest::getCmd('task')); $controller->redirect();
// Require all the neccessary libraries require_once JPATH_COMPONENT . '/libraries/factory.php'; require_once JPATH_COMPONENT . '/helpers/loader.php'; require_once JPATH_ADMINISTRATOR . '/components/com_magebridge/libraries/loader.php'; // Handle the SSO redirect if (JFactory::getApplication()->input->getInt('sso') == 1) { JFactory::getApplication()->input->set('task', 'ssoCheck'); } // Handle direct proxy requests if (JFactory::getApplication()->input->get('url')) { JFactory::getApplication()->input->set('task', 'proxy'); } // Initialize debugging MagebridgeModelDebug::init(); // Require the controller $requestedController = JFactory::getApplication()->input->getCmd('controller'); if ($requestedController == 'jsonrpc') { JFactory::getApplication()->input->set('task', JFactory::getApplication()->input->getCmd('task', '', 'get')); require_once JPATH_COMPONENT . '/controllers/default.jsonrpc.php'; $controller = new MageBridgeControllerJsonrpc(); } elseif ($requestedController == 'sso') { JFactory::getApplication()->input->set('task', JFactory::getApplication()->input->getCmd('task', '', 'get')); require_once JPATH_COMPONENT . '/controllers/default.sso.php'; $controller = new MageBridgeControllerSso(); } else { require_once JPATH_COMPONENT . '/controller.php'; $controller = new MageBridgeController(); } // Perform the Request task $controller->execute(JFactory::getApplication()->input->getCmd('task')); $controller->redirect();
require_once JPATH_COMPONENT . '/helpers/loader.php'; require_once JPATH_ADMINISTRATOR . '/components/com_magebridge/libraries/loader.php'; $app = JFactory::getApplication(); $input = $app->input; // Handle the SSO redirect if ($input->getInt('sso') == 1) { $input->set('task', 'ssoCheck'); } // Handle direct proxy requests if ($input->get('url')) { $input->set('task', 'proxy'); } // Initialize debugging MagebridgeModelDebug::init(); // Simple security measure $input->set('task', $input->getCmd('task')); // Require the controller $requestedController = $input->getCmd('controller'); if ($requestedController == 'jsonrpc') { require_once JPATH_COMPONENT . '/controllers/default.jsonrpc.php'; $controller = new MageBridgeControllerJsonrpc(); } elseif ($requestedController == 'sso') { require_once JPATH_COMPONENT . '/controllers/default.sso.php'; $controller = new MageBridgeControllerSso(); } else { require_once JPATH_COMPONENT . '/controller.php'; $controller = new MageBridgeController(); } // Perform the Request task $controller->execute($input->getCmd('task')); $controller->redirect();