diff options
author | Florian Pritz <bluewind@xssn.at> | 2010-12-06 21:23:16 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xssn.at> | 2010-12-06 21:23:16 +0100 |
commit | a79798223a71874a70981c07e0bcc79b4dcabc28 (patch) | |
tree | c6864a2623a1bea9b74b14bbd07367514121f62d /system/application/models | |
parent | 31a0853361be29df22ee5794696a5616607cec03 (diff) |
add timeout to html page
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'system/application/models')
-rw-r--r-- | system/application/models/file_mod.php | 7 |
1 files changed, 6 insertions, 1 deletions
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)) { |