Changeset 23162


Ignore:
Timestamp:
06/12/13 16:45:36 (7 years ago)
Author:
plg
Message:

bug fixed: avoid "Access denied e" if HD is forbidden and XXL is as big as original.

bug fixed: in template use $derivative_type instead of $derivative->get_type() to avoid size=Original

Location:
extensions/download_by_size
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/download_by_size/action.php

    r23157 r23162  
    110110{ 
    111111  case 'e': 
    112     if ( !$user['enabled_high'] ) 
    113     { 
    114       $deriv = new DerivativeImage(IMG_XXLARGE, new SrcImage($element_info)); 
    115       if ( !$deriv->same_as_source() ) 
    116       { 
    117         do_error(401, 'Access denied e'); 
    118       } 
    119     } 
    120     $file = get_element_path($element_info); 
    121  
    122112    //---- specific download_by_size, start 
    123113    if (isset($_GET['size'])) 
     
    139129      $file = $deriv->get_path(); 
    140130    } 
     131    else 
     132    { 
     133    //---- specific download_by_size, end 
     134    if ( !$user['enabled_high'] ) 
     135    { 
     136      $deriv = new DerivativeImage(IMG_XXLARGE, new SrcImage($element_info)); 
     137      if ( !$deriv->same_as_source() ) 
     138      { 
     139        do_error(401, 'Access denied e'); 
     140      } 
     141    } 
     142    $file = get_element_path($element_info); 
     143    //---- specific download_by_size, start 
     144    } 
    141145    //---- specific download_by_size, end 
    142146     
  • extensions/download_by_size/picture.tpl

    r23157 r23162  
    2626  <div class="switchBoxTitle">{'Download'|@translate} - {'Photo sizes'|@translate}</div> 
    2727  {foreach from=$current.unique_derivatives item=derivative key=derivative_type} 
    28   <a href="{$DLSIZE_URL}{$derivative->get_type()}" rel="nofollow"> 
     28  <a href="{$DLSIZE_URL}{$derivative_type}" rel="nofollow"> 
    2929    {$derivative->get_type()|@translate}<span class="downloadSizeDetails"> ({$derivative->get_size_hr()})</span> 
    3030  </a><br> 
Note: See TracChangeset for help on using the changeset viewer.