diff --git a/admin/admin_ug_auth.php b/admin/admin_ug_auth.php index a3d4bd646..af4896672 100644 --- a/admin/admin_ug_auth.php +++ b/admin/admin_ug_auth.php @@ -168,7 +168,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) { if (!empty($_POST['username'])) { $this_userdata = get_userdata($_POST['username'], true); - $user_id = $this_userdata['user_id']; + $user_id = $this_userdata ? $this_userdata['user_id'] : false; } else { $this_userdata = get_userdata($user_id); } diff --git a/dl.php b/dl.php index dd3e5138a..0362682b6 100644 --- a/dl.php +++ b/dl.php @@ -41,6 +41,9 @@ function send_file_to_browser($attachment, $upload_dir) if (!str_contains($attachment['mimetype'], 'image')) { $attachment['mimetype'] = 'application/octet-stream'; } + else { + header('Cache-Control: public, max-age=3600'); + } //bt if (!(isset($_GET['original']) && !IS_USER)) { @@ -150,7 +153,7 @@ if (!$authorised) { $datastore->rm('cat_forums'); // Check tor status -if (!IS_AM) { +if (!IS_AM && str_contains($attachment['mimetype'], 'bittorrent')) { $sql = 'SELECT tor_status, poster_id FROM ' . BB_BT_TORRENTS . ' WHERE attach_id = ' . (int)$attachment['attach_id']; if (!($result = DB()->sql_query($sql))) { diff --git a/filelist.php b/filelist.php index 71d6f32a3..0fb88e814 100644 --- a/filelist.php +++ b/filelist.php @@ -93,6 +93,8 @@ echo << + +