Skip to content
Browse files

Add public/upload directory to hold temporary images and to show avai…

…lable images that are copied there
  • Loading branch information...
1 parent d888885 commit 802215838b6ecf156485295a30a5771bf81b20f9 @haraldpdl haraldpdl committed Jul 27, 2011
View
9 osCommerce/OM/Core/Site/Admin/Controller.php
@@ -69,6 +69,15 @@ public static function initialize() {
if ( !OSCOM::configExists('dir_fs_public', 'OSCOM') || !file_exists(OSCOM::getConfig('dir_fs_public', 'OSCOM')) ) {
Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_dir_fs_public_not_defined'), 'warning');
}
+
+// check if the upload directory exists
+ if ( is_dir(OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload') ) {
+ if ( !is_writeable(OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload') ) {
+ Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_upload_directory_not_writable'), OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload'), 'error');
+ }
+ } else {
+ Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_upload_directory_non_existant'), OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload'), 'error');
+ }
}
public static function getDefaultApplication() {
View
2 osCommerce/OM/Core/Site/Admin/languages/en_US.php
@@ -121,3 +121,5 @@
ms_error_upload_file_type_prohibited = Error: The type of file uploaded is not allowed.
ms_error_file_not_removable = Error: This file cannot be removed: %s
ms_error_directory_not_removable = Error: This directory cannot be removed: %s
+ms_error_upload_directory_not_writable = Error: The upload directory is not writable: %s
+ms_error_upload_directory_non_existant = Error: The upload directory does not exist: %s
View
0 public/upload/index.html
No changes.

0 comments on commit 8022158

Please sign in to comment.
Something went wrong with that request. Please try again.