From d61d668b64c44fc046095b807834c4836a8c05c5 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 08 Apr 2015 02:57:21 -0400
Subject: [PATCH] Remove useless code

---
 program/lib/Roundcube/rcube_session_db.php |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/program/lib/Roundcube/rcube_session_db.php b/program/lib/Roundcube/rcube_session_db.php
index 93d5c2b..a814c2b 100644
--- a/program/lib/Roundcube/rcube_session_db.php
+++ b/program/lib/Roundcube/rcube_session_db.php
@@ -33,10 +33,15 @@
     private $db;
     private $table_name;
 
-    public function __construct()
+    /**
+     * @param Object $config
+     */
+    public function __construct($config)
     {
+        parent::__construct($config);
+
         // get db instance
-        $this->db      = rcube::get_instance()->get_dbh();
+        $this->db = rcube::get_instance()->get_dbh();
 
         // session table name
         $this->table_name = $this->db->table_name('session', true);
@@ -138,7 +143,8 @@
      */
     public function update($key, $newvars, $oldvars)
     {
-        $now        = $this->db->now();
+        $now = $this->db->now();
+        $ts  = microtime(true);
 
         // if new and old data are not the same, update data
         // else update expire timestamp only when certain conditions are met
@@ -163,6 +169,7 @@
         // just clean all old sessions when this GC is called
         $this->db->query("DELETE FROM " . $this->db->table_name('session')
                          . " WHERE changed < " . $this->db->now(-$this->gc_enabled));
+        $this->log("Session GC (DB): remove records < " . date('Y-m-d H:i:s', time() - $this->gc_enabled) . '; rows = ' . intval($this->db->affected_rows()));
     }
 
 }
\ No newline at end of file

--
Gitblit v1.9.1