From 3e48d2eee1d2af42aa777fd5e461fa570762732e Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 21 Nov 2008 13:19:30 -0500
Subject: [PATCH] - Increase speed of session destroy and garbage clean up - Fix session timeout when DB server got clock skew (#1485490)

---
 program/include/rcube_imap.php |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index d8845cc..c3d5991 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2146,7 +2146,7 @@
       {
       $this->db->query(
         "UPDATE ".get_table_name('cache')."
-         SET    created=".$this->db->now().", data=?, session_id=?
+         SET    created=". $this->db->fromunixtime(time()).", data=?, session_id=?
          WHERE  user_id=?
          AND    cache_key=?",
         $data,
@@ -2160,7 +2160,7 @@
       $this->db->query(
         "INSERT INTO ".get_table_name('cache')."
          (created, user_id, cache_key, data, session_id)
-         VALUES (".$this->db->now().", ?, ?, ?, ?)",
+         VALUES (".$this->db->fromunixtime(time()).", ?, ?, ?, ?)",
         $_SESSION['user_id'],
         $key,
         $data,
@@ -2374,7 +2374,7 @@
       $this->db->query(
         "INSERT INTO ".get_table_name('messages')."
          (user_id, del, cache_key, created, idx, uid, subject, ".$this->db->quoteIdentifier('from').", ".$this->db->quoteIdentifier('to').", cc, date, size, headers, structure)
-         VALUES (?, 0, ?, ".$this->db->now().", ?, ?, ?, ?, ?, ?, ".$this->db->fromunixtime($headers->timestamp).", ?, ?, ?)",
+         VALUES (?, 0, ?, ".$this->db->fromunixtime(time()).", ?, ?, ?, ?, ?, ?, ".$this->db->fromunixtime($headers->timestamp).", ?, ?, ?)",
         $_SESSION['user_id'],
         $key,
         $index,

--
Gitblit v1.9.1