diff --git a/admin/admin_ug_auth.php b/admin/admin_ug_auth.php index c1088253..4234a37c 100644 --- a/admin/admin_ug_auth.php +++ b/admin/admin_ug_auth.php @@ -193,7 +193,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 { diff --git a/dl.php b/dl.php index 00b0e85b..37e831e1 100644 --- a/dl.php +++ b/dl.php @@ -38,6 +38,10 @@ function send_file_to_browser($attachment, $upload_dir) { $attachment['mimetype'] = 'application/octet-stream'; } + else + { + header('Cache-Control: public, max-age=3600'); + } //bt if (!(isset($_GET['original']) && !IS_USER)) @@ -168,7 +172,7 @@ $datastore->rm('cat_forums'); // // Check tor status // -if (!IS_AM) +if (!IS_AM && (strpos($attachment['mimetype'], 'bittorrent') !== false)) { $sql = "SELECT tor_status, poster_id FROM " . BB_BT_TORRENTS . " WHERE attach_id = " . (int) $attachment['attach_id'];