[ Index ]

PHP Cross Reference of phpBB-3.2.0-deutsch

title

Body

[close]

/includes/ -> functions_download.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 786 lines (20 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 15 functions

  send_avatar_to_browser()
  wrap_img_in_html()
  send_file_to_browser()
  header_filename()
  download_allowed()
  set_modified_headers()
  file_gc()
  phpbb_http_byte_range()
  phpbb_find_range_request()
  phpbb_parse_range_request()
  phpbb_increment_downloads()
  phpbb_download_handle_forum_auth()
  phpbb_download_handle_pm_auth()
  phpbb_download_check_pm_auth()
  phpbb_is_greater_ie_version()

Functions
Functions that are not part of a class:

send_avatar_to_browser($file, $browser)   X-Ref
A simplified function to deliver avatars
The argument needs to be checked before calling this function.


wrap_img_in_html($src, $title)   X-Ref
Wraps an url into a simple html page. Used to display attachments in IE.
this is a workaround for now; might be moved to template system later
direct any complaints to 1 Microsoft Way, Redmond


send_file_to_browser($attachment, $upload_dir, $category)   X-Ref
Send file to browser


header_filename($file)   X-Ref
Get a browser friendly UTF-8 encoded filename


download_allowed()   X-Ref
Check if downloading item is allowed


set_modified_headers($stamp, $browser)   X-Ref
Check if the browser has the file already and set the appropriate headers-

returns: false if a resend is in order.

file_gc($exit = true)   X-Ref
Garbage Collection

return: null
param: bool $exit        Whether to die or not.

phpbb_http_byte_range($filesize)   X-Ref
HTTP range support (RFC 2616 Section 14.35)

Allows browsers to request partial file content
in case a download has been interrupted.

return: mixed        false if the whole file has to be delivered
param: int $filesize        the size of the file in bytes we are about to deliver

phpbb_find_range_request()   X-Ref
Searches for HTTP range request in request headers.

return: mixed        false if no request found

phpbb_parse_range_request($request_array, $filesize)   X-Ref
Analyses a range request array.

A range request can contain multiple ranges,
we however only handle the first request and
only support requests from a given byte to the end of the file.

return: mixed        false if the whole file has to be delivered
param: array    $request_array    array of strings containing the requested ranges
param: int    $filesize        the full size of the file in bytes that has been requested

phpbb_increment_downloads($db, $ids)   X-Ref
Increments the download count of all provided attachments

return: null
param: \phpbb\db\driver\driver_interface $db The database object
param: array|int $ids The attach_id of each attachment

phpbb_download_handle_forum_auth($db, $auth, $topic_id)   X-Ref
Handles authentication when downloading attachments from a post or topic

return: null
param: \phpbb\db\driver\driver_interface $db The database object
param: \phpbb\auth\auth $auth The authentication object
param: int $topic_id The id of the topic that we are downloading from

phpbb_download_handle_pm_auth($db, $auth, $user_id, $msg_id)   X-Ref
Handles authentication when downloading attachments from PMs

return: null
param: \phpbb\db\driver\driver_interface $db The database object
param: \phpbb\auth\auth $auth The authentication object
param: int $user_id The user id
param: int $msg_id The id of the PM that we are downloading from

phpbb_download_check_pm_auth($db, $user_id, $msg_id)   X-Ref
Checks whether a user can download from a particular PM

return: bool Whether the user is allowed to download from that PM or not
param: \phpbb\db\driver\driver_interface $db The database object
param: int $user_id The user id
param: int $msg_id The id of the PM that we are downloading from

phpbb_is_greater_ie_version($user_agent, $version)   X-Ref
Check if the browser is internet explorer version 7+

return: bool true if internet explorer version is greater than $version
param: string $user_agent    User agent HTTP header
param: int $version IE version to check against



Generated: Sun Feb 19 19:47:08 2017 Cross-referenced by PHPXref 0.7.1