WordPress.org

Ready to get started?Download WordPress

Forums

Eazyest Gallery
Uploaded file permissions on Zeus webserver (1 post)

  1. klihelp
    Member
    Plugin Author

    Posted 1 year ago #

    Uploaded file permissions are 660 (instead 664) on some hosting with Zeus webserver.

    Would be good if Eazyest Gallery core could check for the correct file permissions.

    Righ now the modified plugin Change Uploaded File Permissions will work with Eazyest Gallery files.

    /** Modify thumbHook() to work with Eazyest Gallery
    * Change Uploaded File Permissions
    * http://wordpress.org/extend/plugins/change-uploaded-file-permissions/
    * - add ID
    * - add Eazyest Gallery check
    */
    function thumbHook($metadata, $id) {
    	if (!UFPWP26)
    		return $metadata;		
    
    	$folder = explode("/",$metadata['file']);
    
        if(count($metadata ['sizes'])) {
    
    		$this->logAction( $id , __('Image ID ','change-uploaded-file-permissions'));
    
        	if ( defined(EZG_SECURE_VERSION) && ezg_is_gallery_image( $id ) ) {
        		// Eeazyest Gallery has different 
    
    				$this->logAction( 'Gallery image', __('Eazyest Image','change-uploaded-file-permissions'));
    
    	            foreach($metadata ['sizes'] as $image_name => $arr_image_data) {
    
    	            	$attached = get_post_meta( $id, '_wp_attached_file', true );
    					$pathinfo = pathinfo( $attached );
    					$dir    = $pathinfo['dirname'];
    
    	                $this->changePermission(  eazyest_gallery()->root() . $dir . '/'. $metadata ['sizes'] [$image_name] ['file'] , false, '' );
    	            }
    
            } else {
            	// Default
    
                foreach($metadata ['sizes'] as $image_name => $arr_image_data) {
    
                    $this->changePermission($metadata ['sizes'] [$image_name] ['file'],true,$folder);
                }
    		}
        }
    
        return $metadata;
    }

    http://wordpress.org/plugins/eazyest-gallery/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic