summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-07-11 20:43:57 +0200
committerFlorian Pritz <bluewind@xssn.at>2010-07-11 20:43:57 +0200
commit00596f828d9e964ed008020ea104e96e77824578 (patch)
treeba693233b14546054fd35a1d9a4e97812836b46a /system
parentfb01797274be73ac10124b2f728f7092307e6c37 (diff)
don't delete if max age is 0
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'system')
-rwxr-xr-xsystem/application/config/example/config.php2
-rw-r--r--system/application/controllers/file.php2
2 files changed, 4 insertions, 0 deletions
diff --git a/system/application/config/example/config.php b/system/application/config/example/config.php
index af54fb383..bab0087b0 100755
--- a/system/application/config/example/config.php
+++ b/system/application/config/example/config.php
@@ -340,6 +340,8 @@ $config['proxy_ips'] = '';
$config['upload_path'] = FCPATH.'data/uploads';
$config['upload_max_size'] = 256*1024*1024;
$config['upload_max_text_size'] = 2*1024*1024;
+
+// 0 disables deletion
$config['upload_max_age'] = 60*60*24*5; // 5 days
// won't be deleted
diff --git a/system/application/controllers/file.php b/system/application/controllers/file.php
index a07debc40..67f7c0b2e 100644
--- a/system/application/controllers/file.php
+++ b/system/application/controllers/file.php
@@ -130,6 +130,8 @@ class File extends Controller {
function cron()
{
+ if ($this->config->item('upload_max_age') == 0) return;
+
$oldest_time = (time()-$this->config->item('upload_max_age'));
$small_upload_size = $this->config->item('small_upload_size');
$query = $this->db->query('SELECT hash, id FROM files WHERE date < ?',