Ignore:
Timestamp:
Feb 2, 2013, 8:09:52 AM (11 years ago)
Author:
rvelices
Message:

feature 2831: simple way to protect urls of originals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_html.inc.php

    r19703 r20516  
    594594}
    595595
     596/** optional event handler to protect src image urls */
     597function get_src_image_url_protection_handler($url, $src_image)
     598{
     599  return get_action_url($src_image->id, $src_image->is_original() ? 'e' : 'r', false);
     600}
     601
     602/** optional event handler to protect element urls */
     603function get_element_url_protection_handler($url, $infos)
     604{
     605  global $conf;
     606  if ('images'==$conf['original_url_protection'])
     607  {// protect only images and not other file types (for example large movies that we don't want to send through our file proxy)
     608    $ext = get_extension($infos['path']);
     609    if (!in_array($ext, $conf['picture_ext']))
     610    {
     611      return $url;
     612    }
     613  }
     614  return get_action_url($infos['id'], 'e', false);
     615}
     616
    596617?>
Note: See TracChangeset for help on using the changeset viewer.