aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/download.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-05-03 14:29:22 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-05-03 14:29:22 +0000
commitf7b51337c55f88f19f8b9406b64e7d03150efa2c (patch)
tree3b2482e66108730672abc059963c6b0b3caec061 /phpBB/download.php
parent58ac5df6b376ef57c333565b94698c41b02e67cf (diff)
downloadforums-f7b51337c55f88f19f8b9406b64e7d03150efa2c.tar
forums-f7b51337c55f88f19f8b9406b64e7d03150efa2c.tar.gz
forums-f7b51337c55f88f19f8b9406b64e7d03150efa2c.tar.bz2
forums-f7b51337c55f88f19f8b9406b64e7d03150efa2c.tar.xz
forums-f7b51337c55f88f19f8b9406b64e7d03150efa2c.zip
some language-specific adjustements
fix prune users (adding the list of users to the confirmation page) tried to fix the show/hide trigger in ACP by not using width: auto; (which gets somehow inherited to each other element) git-svn-id: file:///svn/phpbb/trunk@7455 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/download.php')
-rw-r--r--phpBB/download.php38
1 files changed, 16 insertions, 22 deletions
diff --git a/phpBB/download.php b/phpBB/download.php
index 98f3e03c0b..5a90059ae1 100644
--- a/phpBB/download.php
+++ b/phpBB/download.php
@@ -159,21 +159,11 @@ else
$db->sql_freeresult($result);
// Global announcement?
- if (!$row)
- {
- $forum_id = request_var('f', 0);
-
- $sql = 'SELECT forum_id, forum_password, parent_id
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . $forum_id;
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- }
+ $f_download = (!$row) ? $auth->acl_getf_global('f_download') : $auth->acl_get('f_download', $row['forum_id']);
- if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']))
+ if ($auth->acl_get('u_download') && $f_download)
{
- if ($row['forum_password'])
+ if ($row && $row['forum_password'])
{
// Do something else ... ?
login_forum_box($row);
@@ -270,33 +260,37 @@ else
function send_avatar_to_browser($file)
{
global $config, $phpbb_root_path;
+
$prefix = $config['avatar_salt'] . '_';
- $img_dir = $config['avatar_path'];
+ $image_dir = $config['avatar_path'];
+
// worst-case default
$browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0';
- // Adjust img_dir path (no trailing slash)
- if (substr($img_dir, -1, 1) == '/' || substr($img_dir, -1, 1) == '\\')
+ // Adjust image_dir path (no trailing slash)
+ if (substr($image_dir, -1, 1) == '/' || substr($image_dir, -1, 1) == '\\')
{
- $img_dir = substr($img_dir, 0, -1) . '/';
+ $image_dir = substr($image_dir, 0, -1) . '/';
}
- $img_dir = str_replace(array('../', '..\\', './', '.\\'), '', $img_dir);
- if ($img_dir && ($img_dir[0] == '/' || $img_dir[0] == '\\'))
+ $image_dir = str_replace(array('../', '..\\', './', '.\\'), '', $image_dir);
+
+ if ($image_dir && ($image_dir[0] == '/' || $image_dir[0] == '\\'))
{
- $img_dir = '';
+ $image_dir = '';
}
- $file_path = $phpbb_root_path . $img_dir . '/' . $prefix . $file;
+ $file_path = $phpbb_root_path . $image_dir . '/' . $prefix . $file;
if ((@file_exists($file_path) && @is_readable($file_path)) || headers_sent())
{
header('Pragma: public');
- $image_data = (getimagesize($file_path));
+ $image_data = getimagesize($file_path);
header('Content-Type: ' . image_type_to_mime_type($image_data[2]));
if (strpos(strtolower($browser), 'msie') !== false)
{
header('Content-Disposition: attachment; ' . header_filename($file));
+
if (strpos(strtolower($browser), 'msie 6.0') !== false)
{
header('Expires: -1');