PDA

View Full Version : Protected Images for osCommerce 2.3.4



michael_s
05-01-2015, 02:51 PM
After noticing complaints in the forums about the permissions used on the images created by this contribution I've updated it with much more restrictive permissions. I also had a request to allow the thumbnail creating function to create the directory for the image if it needs to so I've added a function to make that possible as well. This version also kills a few bugs that I discovered while updating the functions.

The complete contribution is attached. If you are upgrading an existing install do the following:

From instruction 5: REPLACE your existing tep_create_thumbnail function definition with the updated version from this instruction and then ADD the new tep_create_writable_directory function definition to the admin/includes/functions/general.php file. Adjust the value of the $file_permissions variable in the updated tep_create_thumbnail function as needed to get images to display in a web browser.

Instruction 35l has been updated to fix a bug where original product images were copied to the wrong folder during product duplication. The mkdir chmod pairs have also been replaced with the new tep_create_writable_directory function and some error notifications have been added to let the user know if an error occurs during product copy. Update your existing code to look like the new code from this instruction and adjust the value of $file_permissions if needed to make the copied images display in a browser.

Instruction 35n fixed a bug where the wrong variable name was used during folder creation for product insert. The mkdir chmod pairs are replaced with the new tep_create_writable_directory function and error notification has been added. Again update your existing code to match the new version.

Instruction 36 adds two defines for the new error messages. The new ones are the last two in the list for this instruction. Add these to your categories.php language file.

A couple of minor bugs have been removed from the image manager and it has been updated to handle the new possible error message from the tep_create_thumbnail function. Replace your existing admin/image_manager.php file and its language file with the new version included here.

More... (http://addons.oscommerce.com/info/9155)