fixes #415, even if non-picture file, force download with action.php
This commit is contained in:
parent
f0d29d9134
commit
a684afbdc3
2 changed files with 7 additions and 4 deletions
|
@ -100,6 +100,8 @@ if ( empty($element_info) )
|
||||||
do_error(404, 'Requested id not found');
|
do_error(404, 'Requested id not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$src_image = new SrcImage($element_info);
|
||||||
|
|
||||||
// $filter['visible_categories'] and $filter['visible_images']
|
// $filter['visible_categories'] and $filter['visible_images']
|
||||||
// are not used because it's not necessary (filter <> restriction)
|
// are not used because it's not necessary (filter <> restriction)
|
||||||
$query='
|
$query='
|
||||||
|
@ -126,9 +128,9 @@ $file='';
|
||||||
switch ($_GET['part'])
|
switch ($_GET['part'])
|
||||||
{
|
{
|
||||||
case 'e':
|
case 'e':
|
||||||
if ( !$user['enabled_high'] )
|
if ( $src_image->is_original() and !$user['enabled_high'] )
|
||||||
{
|
{// we have a photo and the user has no access to HD
|
||||||
$deriv = new DerivativeImage(IMG_XXLARGE, new SrcImage($element_info));
|
$deriv = new DerivativeImage(IMG_XXLARGE, $src_image);
|
||||||
if ( !$deriv->same_as_source() )
|
if ( !$deriv->same_as_source() )
|
||||||
{
|
{
|
||||||
do_error(401, 'Access denied e');
|
do_error(401, 'Access denied e');
|
||||||
|
|
|
@ -532,7 +532,8 @@ while ($row = pwg_db_fetch_assoc($result))
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // not a pic - need download link
|
{ // not a pic - need download link
|
||||||
$row['download_url'] = $row['element_url'] = get_element_url($row);;
|
$row['element_url'] = get_element_url($row);
|
||||||
|
$row['download_url'] = get_action_url($row['id'], 'e', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue