Originally Posted by
lhungil
Zen Cart can still be configured with separate values for HTTP_SERVER and HTTPS_SERVER for the administrative interface (by defining it in the configure.php or an override file)... And they can also still define and override ENABLE_SSL_CATALOG as well... While this is still possible (and supported by the core code), DIR_WS_HTTPS_ADMIN may still be needed on some server configurations...
Perhaps in the future Zen Cart will force end users to configure the admin to only operate using one protocol and host... But until that time, I would prefer if an "automatic" define for DIR_WS_HTTPS_ADMIN was added to the file "/admin/includes/defined_paths.php" for compatibility purposes.
This is how I addressed handling compatibility:
Code:
$path_to_file = (IS_STORE_SIDE ? /* BOF Storeside */ defined('ENABLE_SSL_CATALOG') && ENABLE_SSL_CATALOG === 'true' ? HTTPS_CATALOG_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_CATALOG_SERVER . DIR_WS_CATALOG /* EOF Storeside */ : /* BOF Adminside */ (defined('ENABLE_SSL_ADMIN') && ENABLE_SSL_ADMIN === 'true' ? (defined('HTTPS_SERVER') ? HTTPS_SERVER : HTTP_SERVER) . (defined('DIR_WS_HTTPS_ADMIN') ? DIR_WS_HTTPS_ADMIN : DIR_WS_ADMIN) : HTTP_SERVER . DIR_WS_ADMIN) /* EOF Adminside */) . $sub_directory_ends_with_slash . $file_name;
The thing is that previously I was checking to see whether they accessed this admin page using SSL or not and then generated the path using the applicable SSL folder path rather than counting on the settngs of using SSL as being true or not. It's rare, but I wanted the associated link to maximize. The use/possibility of using the SSL if it was available whether the admin configure.php had the setting correct or not... I could to some extent still do that, but at the moment the "cost" outweighs the reward... The above works...
Bookmarks