[ Index ]

PHP Cross Reference of phpBB-3.3.14-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: 782 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

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

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.

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

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.

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
return: mixed        false if the whole file has to be delivered

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

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

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

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
return: null

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

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
return: null

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

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
return: bool Whether the user is allowed to download from that PM or not

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

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



Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1