WordPress.org

Support

Support » Plugins and Hacks » Uploaded file permissions on Zeus webserver

Uploaded file permissions on Zeus webserver

  • klihelp
    Member

    @klihelp

    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/

  • The topic ‘Uploaded file permissions on Zeus webserver’ is closed to new replies.