Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: attachment.php 4002 2008-07-08 22:36:04Z Tikitiki $
| * $Id: attachment.php 4143 2008-08-22 02:47:25Z Tikitiki $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define('THIS_SCRIPT', 'attachment.php');
|
require_once "./global.php";
| require_once "./global.php";
|
Zeile 54 | Zeile 55 |
---|
// Permissions $forumpermissions = forum_permissions($fid);
|
// Permissions $forumpermissions = forum_permissions($fid);
|
// No Permission page if user cannot view or download attachments in this forum (if not calling the thumbnail) if(($forumpermissions['canview'] == 0 || $forumpermissions['candlattachments'] == 0) && !$mybb->input['thumbnail'])
| if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || ($forumpermissions['candlattachments'] == 0 && !$mybb->input['thumbnail']))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 113 | Zeile 113 |
---|
{ $ext = get_extension($attachment['filename']);
|
{ $ext = get_extension($attachment['filename']);
|
if($ext == "txt" || $ext == "htm" || $ext == "html" || $ext == "pdf")
| if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "msie") !== false && strpos($attachment['filetype'], "image") === false)
|
{ header("Content-disposition: attachment; filename=\"{$attachment['filename']}\""); } else { header("Content-disposition: inline; filename=\"{$attachment['filename']}\"");
|
{ header("Content-disposition: attachment; filename=\"{$attachment['filename']}\""); } else { header("Content-disposition: inline; filename=\"{$attachment['filename']}\"");
|
}
| }
|
header("Content-type: {$attachment['filetype']}"); header("Content-length: {$attachment['filesize']}");
| header("Content-type: {$attachment['filetype']}"); header("Content-length: {$attachment['filesize']}");
|