summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
authorDavid Carter <dpc22@cam.ac.uk>2013-08-30 09:22:24 +0100
committerDavid Carter <dpc22@cam.ac.uk>2013-08-30 09:22:24 +0100
commitde8687f9f11d49d36b322af72f644f7c5a232b9f (patch)
treee8087db57c63ecc6882c0f382b80020e7387fd3a /program/lib
parent0c2ffb57a11f4a417ed2d48eea882d92c7ded3ca (diff)
Add temp_dir_ttl configuration option to control expiry time in
program/lib/Roundcube/rcube.php : gc_temp(). Default is 48 hours. Define hard wired minimum of 6 hours.
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/Roundcube/rcube.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index af9c069cf..d9c3dd8b9 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -498,7 +498,14 @@ class rcube
public function gc_temp()
{
$tmp = unslashify($this->config->get('temp_dir'));
- $expire = time() - 172800; // expire in 48 hours
+
+ // expire in 48 hours by default
+ $temp_dir_ttl = $this->config->get('temp_dir_ttl', '48h');
+ $temp_dir_ttl = get_offset_sec($temp_dir_ttl);
+ if ($temp_dir_ttl < 6*3600)
+ $temp_dir_ttl = 6*3600; // 6 hours sensible lower bound.
+
+ $expire = time() - $temp_dir_ttl;
if ($tmp && ($dir = opendir($tmp))) {
while (($fname = readdir($dir)) !== false) {