From a79798223a71874a70981c07e0bcc79b4dcabc28 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 6 Dec 2010 21:23:16 +0100 Subject: add timeout to html page Signed-off-by: Florian Pritz --- system/application/models/file_mod.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'system/application/models') diff --git a/system/application/models/file_mod.php b/system/application/models/file_mod.php index a41e04b1a..2d3fc8ccf 100644 --- a/system/application/models/file_mod.php +++ b/system/application/models/file_mod.php @@ -50,7 +50,7 @@ class File_mod extends Model { function get_filedata($id) { $sql = ' - SELECT hash,filename,mimetype + SELECT hash,filename,mimetype, date FROM `files` WHERE `id` = ? LIMIT 1'; @@ -202,6 +202,11 @@ class File_mod extends Model { } else { $data['current_highlight'] = $this->mime2extension($type); } + if (filesize($file) > $this->config->item("small_upload_size")) { + $data['timeout'] = date("r", $filedata["date"]+$this->config->item("upload_max_age")); + } else { + $data['timeout'] = "never"; + } echo $this->load->view('file/html_header', $data, true); $this->load->library("MemcacheLibrary"); if (! $cached = $this->memcachelibrary->get($filedata['hash'].'_'.$mode)) { -- cgit v1.2.3-24-g4f1b