/**
  * Method to make logout the current user
  */
 public function logout()
 {
     // Perform a logout
     $user = JFactory::getUser();
     $application = JFactory::getApplication();
     $application->logout($user->get('id'));
     // Determine the redirect URL
     $redirectUrl = base64_decode(JFactory::getApplication()->input->getString('redirect'));
     if (empty($redirectUrl)) {
         $redirectUrl = MageBridgeModelBridge::getMagentoUrl();
     }
     // Redirect
     $application->redirect($redirectUrl);
     $application->close();
 }
 public function getMagentoAdminUrl($path = null)
 {
     $url = MageBridgeModelBridge::getMagentoUrl();
     if (!empty($url)) {
         return $url . 'index.php/' . MagebridgeModelConfig::load('backend') . '/' . $path;
     } else {
         return null;
     }
 }
 public function proxy()
 {
     $application = JFactory::getApplication();
     $url = JRequest::getVar('url');
     print file_get_contents(MageBridgeModelBridge::getMagentoUrl() . $url);
     $application->close();
 }
Beispiel #4
0
 /**
  * Method to return the Magento Admin Panel URL
  *
  * @param string $path
  *
  * @return string
  */
 public function getMagentoAdminUrl($path = null)
 {
     $url = MageBridgeModelBridge::getMagentoUrl();
     if (!empty($url)) {
         $path = preg_replace('/^\\//', '', $path);
         $url = $url . 'index.php/' . MagebridgeModelConfig::load('backend') . '/' . $path;
         return $url;
     } else {
         return null;
     }
 }