Changeset 339 in subversion
- Timestamp:
- Sep 8, 2006 8:03:22 AM (7 years ago)
- Location:
- trunk/roundcubemail/program
- Files:
-
- 5 edited
-
include/main.inc (modified) (1 diff)
-
include/session.inc (modified) (2 diffs)
-
steps/mail/compose.inc (modified) (1 diff)
-
steps/mail/func.inc (modified) (2 diffs)
-
steps/mail/upload.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/main.inc
r338 r339 824 824 825 825 826 // remove temp files of a session 827 function rcmail_clear_session_temp($sess_id) 828 { 829 global $CONFIG; 830 831 $temp_dir = slashify($CONFIG['temp_dir']); 832 $cache_dir = $temp_dir.$sess_id; 833 834 if (is_dir($cache_dir)) 835 { 836 clear_directory($cache_dir); 837 rmdir($cache_dir); 838 } 826 // remove temp files older than two day 827 function rcmail_temp_gc() 828 { 829 $tmp = unslashify($CONFIG['temp_dir']); 830 $expire = mktime() - 172800; // expire in 48 hours 831 832 if ($dir = opendir($tmp)) 833 { 834 while (($fname = readdir($dir)) !== false) 835 { 836 if ($fname{0} == '.') 837 continue; 838 839 if (filemtime($tmp.'/'.$fname) < $expire) 840 @unlink($tmp.'/'.$fname); 841 } 842 843 closedir($dir); 844 } 839 845 } 840 846 -
trunk/roundcubemail/program/include/session.inc
r338 r339 106 106 $key); 107 107 108 rcmail_clear_session_temp($key);109 108 return TRUE; 110 109 } … … 138 137 } 139 138 140 // remove session specific temp dirs141 foreach ($a_exp_sessions as $key)142 rcmail_clear_session_temp($key);143 144 139 // also run message cache GC 145 140 rcmail_message_cache_gc(); 141 rcmail_temp_gc(); 146 142 147 143 return TRUE; -
trunk/roundcubemail/program/steps/mail/compose.inc
r337 r339 498 498 function rcmail_write_compose_attachments(&$message) 499 499 { 500 global $IMAP ;501 502 $temp_dir = rcmail_create_compose_tempdir();500 global $IMAP, $CONFIG; 501 502 $temp_dir = unslashify($CONFIG['temp_dir']); 503 503 504 504 if (!is_array($_SESSION['compose']['attachments'])) -
trunk/roundcubemail/program/steps/mail/func.inc
r338 r339 1385 1385 1386 1386 1387 // create temp dir for attachments1388 function rcmail_create_compose_tempdir()1389 {1390 global $CONFIG;1391 1392 if ($_SESSION['compose']['temp_dir'])1393 return $_SESSION['compose']['temp_dir'];1394 1395 if (!empty($CONFIG['temp_dir']))1396 $temp_dir = $CONFIG['temp_dir'].(!eregi('\/$', $CONFIG['temp_dir']) ? '/' : '').$_SESSION['compose']['id'];1397 1398 // create temp-dir for uploaded attachments1399 if (!empty($CONFIG['temp_dir']) && is_writeable($CONFIG['temp_dir']))1400 {1401 mkdir($temp_dir);1402 $_SESSION['compose']['temp_dir'] = $temp_dir;1403 }1404 1405 return $_SESSION['compose']['temp_dir'];1406 }1407 1408 1409 1387 // clear message composing settings 1410 1388 function rcmail_compose_cleanup() … … 1412 1390 if (!isset($_SESSION['compose'])) 1413 1391 return; 1414 1392 1415 1393 // remove attachment files from temp dir 1416 1394 if (is_array($_SESSION['compose']['attachments'])) 1417 1395 foreach ($_SESSION['compose']['attachments'] as $attachment) 1418 1396 @unlink($attachment['path']); 1419 1420 // kill temp dir1421 if ($_SESSION['compose']['temp_dir'])1422 @rmdir($_SESSION['compose']['temp_dir']);1423 1397 1424 1398 unset($_SESSION['compose']); -
trunk/roundcubemail/program/steps/mail/upload.inc
r297 r339 27 27 28 28 29 // createtemp dir for file uploads30 $temp_dir = rcmail_create_compose_tempdir();29 // use common temp dir for file uploads 30 $temp_dir = unslashify($CONFIG['temp_dir']); 31 31 32 32
Note: See TracChangeset
for help on using the changeset viewer.
