Fix so gc.sh script removes also expired sessions from sql database (#1490512)

Conflicts:
	CHANGELOG
release-1.0
Aleksander Machniak 9 years ago
parent 8cded09621
commit 6ab1553b5e

@ -7,6 +7,7 @@ CHANGELOG Roundcube Webmail
- Fix so plain text signature field uses monospace font (#1490435)
- Fix draft removal after a message is sent and storing sent message is disabled (#1490467)
- Fix handling of plus character in mailto: links (#1490510)
- Fix so gc.sh script removes also expired sessions from sql database (#1490512)
RELEASE 1.0.6
-------------

@ -24,4 +24,16 @@ define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
require INSTALL_PATH.'program/include/clisetup.php';
$rcmail = rcube::get_instance();
$session_driver = $rcmail->config->get('session_storage', 'db');
$session_lifetime = $rcmail->config->get('session_lifetime', 0) * 60 * 2;
// Clean expired SQL sessions
if ($session_driver == 'db' && $session_lifetime) {
$db = $rcmail->get_dbh();
$db->query("DELETE FROM " . $db->table_name('session')
. " WHERE changed < " . $db->now(-$session_lifetime));
}
// Clean caches and temp directory
$rcmail->gc();

Loading…
Cancel
Save