I'm using this Yireo SSL Redirect Plugging and it was working fine till i decided to not to use SSL for entire virtuemart store.
My Problem is if i dont select "com_virtuemart" from this plugging, it forces virtuemart to use http even its require SSL for palaces like customer registration.
is it possible to ignore 'com_virtuemart' and let it behave as it wish.
here is the pluging:
http://www.yireo.com */
// Check to ensure this file is included in Joomla! defined('_JEXEC') or die( 'Restricted access' );
// Import the parent class jimport( 'joomla.plugin.plugin' );
/** * SSL Redirect System Plugin / class plgSystemSSLRedirect extends JPlugin { /* * Load the parameters * * @access private * @param null * @return JParameter */ private function getParams() { $plugin = JPluginHelper::getPlugin('system', 'sslredirect'); $params = new JParameter($plugin->params); return $params; }
/** * Event onAfterRoute * * @access public * @param null * @return null */ public function onAfterRoute() { // Get system variables $application = JFactory::getApplication(); $uri = JFactory::getURI(); $current_path = $uri->toString(array('path')); $Itemid = JRequest::getInt('Itemid');
// Do not rewrite for the backend if($application->isSite() == false) { return false; }
// Get and parse the menu-items from the plugin parameters $menu_items = $this->getParams()->get('menu_items'); if(empty($menu_items)) { $menu_items = array(); } elseif(!is_array($menu_items)) { $menu_items = array($menu_items); }
// Get and parse the components from the plugin parameters $components = $this->getParams()->get('components'); if(empty($components)) { $components= array(); } elseif(!is_array($components)) { $components = array($components); }
// Get and parse the custom-pages from the plugin parameters $custom_pages = $this->getParams()->get('custom_pages'); if(empty($custom_pages)) { $custom_pages = array(); } elseif(!is_array($custom_pages)) { $custom_pages = array($custom_pages); } else { $tmp = explode("\n", $custom_pages); $custom_pages = array(); foreach($tmp as $index => $text) { $custom_pages[$index] = trim($text); } }
// When SSL is currently disabled if($uri->isSSL() == false) {
$redirect = false;
// Do not redirect if this is POST-request $post = JRequest::get('post'); if(is_array($post) && !empty($post)) { $redirect = false;
// Determine whether to do a redirect based on the menu-items } elseif(in_array($Itemid, $menu_items)) { $redirect = true;
// Determine whether to do a redirect based on the component } elseif(in_array(JRequest::getCmd('option'), $components)) { $redirect = true;
// Determine whether to do a redirect based on the custom-pages } elseif(!empty($custom_pages) && !empty($current_path)) { foreach($custom_pages as $custom_page) { $pos = strpos($current_path, $custom_page); if($pos !== false && $pos == 0) { $redirect = true; break; } } }
// Redirect to SSL if($redirect == true) { $uri->setScheme('https'); $application->redirect($uri->toString()); }
// When SSL is currently enabled } else {
// Determine whether to do a redirect $redirect = true;
// Do not redirect if this is POST-request $post = JRequest::get('post'); if(is_array($post) && !empty($post)) { $redirect = false;
// Determine whether to do a redirect based on the menu-items } elseif(in_array($Itemid, $menu_items)) { $redirect = false;
// Determine whether to do a redirect based on the component } elseif(in_array(JRequest::getCmd('option'), $components)) { $redirect = false;
// Determine whether to do a redirect based on the custom-pages } elseif(!empty($custom_pages) && !empty($current_path)) { foreach($custom_pages as $custom_page) { $pos = strpos($current_path, $custom_page); if($pos !== false && $pos == 0) { $redirect = false; break; } } }
// Redirect to non-SSL if($redirect) { $uri->setScheme('http'); $application->redirect($uri->toString()); } } } }
could someone modify this coding to (if com_virtuemart = ignore this plugging)
and i have attach the pluging file
thank you very much reading this..