Hi Edwin,
I was trying to move the product images folder of Virtuemart out of the components/com_virtuemart directory for security reasons.
My client would not accept others seeing their product photos during ftp product image uploads.
However, my method only works for Firefox, IE will display "ie cannot open the internet site
JMSMASTER/administrator/index.php?option=com_virtuemart".
My method is outline below:
1. administrator/components/com_virtuemart/virtuemart.cfg.php
Line: 48- 61:
if ( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == '443' ) {
define( 'IMAGEURL', SECUREURL .'components/com_virtuemart/shop_image/' );
define( 'VM_THEMEURL', SECUREURL.'components/com_virtuemart/themes/default/' );
} else {
define( 'IMAGEURL', URL .'components/com_virtuemart/shop_image/' );
define( 'VM_THEMEURL', URL.'components/com_virtuemart/themes/default/' );
}
define( 'VM_THEMEPATH', $mosConfig_absolute_path.'/components/com_virtuemart/themes/default/' );
define( 'COMPONENTURL', URL .'administrator/components/com_virtuemart/' );
define( 'ADMINPATH', $mosConfig_absolute_path.'/administrator/components/com_virtuemart/' );
define( 'CLASSPATH', ADMINPATH.'classes/' );
define( 'PAGEPATH', ADMINPATH.'html/' );
define( 'IMAGEPATH', $mosConfig_absolute_path.'/components/com_virtuemart/shop_image/' );
Replaced by :
if ( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == '443' ) {
define( 'IMAGEURL', SECUREURL .'e_shop/shop_image/' );
define( 'VM_THEMEURL', SECUREURL.'components/com_virtuemart/themes/default/' );
} else {
define( 'IMAGEURL', URL .'e_shop/shop_image/' );
define( 'VM_THEMEURL', URL.'components/com_virtuemart/themes/default/' );
}
define( 'VM_THEMEPATH', $mosConfig_absolute_path.'/components/com_virtuemart/themes/default/' );
define( 'COMPONENTURL', URL .'administrator/components/com_virtuemart/' );
define( 'ADMINPATH', $mosConfig_absolute_path.'/administrator/components/com_virtuemart/' );
define( 'CLASSPATH', ADMINPATH.'classes/' );
define( 'PAGEPATH', ADMINPATH.'html/' );
define( 'IMAGEPATH', $mosConfig_absolute_path.'/e_shop/shop_image/' );
2. administrator/components/com_virtuemart/classes/ps_config.php
Line 234-247
if ( (!empty(\$_SERVER['HTTPS']) && \$_SERVER['HTTPS'] != 'off') || \$_SERVER['SERVER_PORT'] == '443' ) {
define( 'IMAGEURL', SECUREURL .'components/com_virtuemart/shop_image/' );
define( 'VM_THEMEURL', SECUREURL.'components/com_virtuemart/themes/".$db->getEscaped($d['conf_THEME'])."/' );
} else {
define( 'IMAGEURL', URL .'components/com_virtuemart/shop_image/' );
define( 'VM_THEMEURL', URL.'components/com_virtuemart/themes/".$db->getEscaped($d['conf_THEME'])."/' );
}
define( 'VM_THEMEPATH', \$mosConfig_absolute_path.'/components/com_virtuemart/themes/".$db->getEscaped($d['conf_THEME'])."/' );
define( 'COMPONENTURL', URL .'administrator/components/com_virtuemart/' );
define( 'ADMINPATH', \$mosConfig_absolute_path.'/administrator/components/com_virtuemart/' );
define( 'CLASSPATH', ADMINPATH.'classes/' );
define( 'PAGEPATH', ADMINPATH.'html/' );
define( 'IMAGEPATH', \$mosConfig_absolute_path.'/components/com_virtuemart/shop_image/' );\n\n";
replaced by
if ( (!empty(\$_SERVER['HTTPS']) && \$_SERVER['HTTPS'] != 'off') || \$_SERVER['SERVER_PORT'] == '443' ) {
define( 'IMAGEURL', SECUREURL .'e_shop/shop_image/' );
define( 'VM_THEMEURL', SECUREURL.'components/com_virtuemart/themes/".$db->getEscaped($d['conf_THEME'])."/' );
} else {
define( 'IMAGEURL', URL .'e_shop/shop_image/' );
define( 'VM_THEMEURL', URL.'components/com_virtuemart/themes/".$db->getEscaped($d['conf_THEME'])."/' );
}
define( 'VM_THEMEPATH', \$mosConfig_absolute_path.'/components/com_virtuemart/themes/".$db->getEscaped($d['conf_THEME'])."/' );
define( 'COMPONENTURL', URL .'administrator/components/com_virtuemart/' );
define( 'ADMINPATH', \$mosConfig_absolute_path.'/administrator/components/com_virtuemart/' );
define( 'CLASSPATH', ADMINPATH.'classes/' );
define( 'PAGEPATH', ADMINPATH.'html/' );
define( 'IMAGEPATH', \$mosConfig_absolute_path.'/e_shop/shop_image/' );\n\n";
In short, I replace "components/com_virtuemart/shop_image" by "e_shop/shop_image"
And copy folder "components/com_virtuemart/shop_image" to "e_shop/shop_image".
For Firefox, it works perfert. But IE failed. I guess it is some security matter.
May you provide any advices?
Many thanks.
KingoftheRoad