diff options
author | alecpl <alec@alec.pl> | 2012-04-13 08:52:02 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2012-04-13 08:52:02 +0000 |
commit | 0c259682f65eaaf23ea4ccb56a706d6baf3007e4 (patch) | |
tree | f1491f39189c8a970e7612b9dcc20f9409d7361e /program/include/rcube_session.php | |
parent | ce64332e7a9bf2468eabdb4b789270aebb3e7dc7 (diff) |
- Merge devel-framework branch, resolved conflicts
Diffstat (limited to 'program/include/rcube_session.php')
-rw-r--r-- | program/include/rcube_session.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/program/include/rcube_session.php b/program/include/rcube_session.php index e6e636e18..da221c30e 100644 --- a/program/include/rcube_session.php +++ b/program/include/rcube_session.php @@ -78,7 +78,7 @@ class rcube_session array($this, 'gc')); } else { - raise_error(array('code' => 604, 'type' => 'db', + rcube::raise_error(array('code' => 604, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__, 'message' => "Failed to connect to memcached. Please check configuration"), true, true); @@ -129,7 +129,7 @@ class rcube_session public function db_read($key) { $sql_result = $this->db->query( - "SELECT vars, ip, changed FROM ".get_table_name('session') + "SELECT vars, ip, changed FROM ".$this->db->table_name('session') ." WHERE sess_id = ?", $key); if ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) { @@ -177,18 +177,18 @@ class rcube_session if ($newvars !== $oldvars) { $this->db->query( sprintf("UPDATE %s SET vars=?, changed=%s WHERE sess_id=?", - get_table_name('session'), $now), + $this->db->table_name('session'), $now), base64_encode($newvars), $key); } else if ($ts - $this->changed > $this->lifetime / 2) { - $this->db->query("UPDATE ".get_table_name('session')." SET changed=$now WHERE sess_id=?", $key); + $this->db->query("UPDATE ".$this->db->table_name('session')." SET changed=$now WHERE sess_id=?", $key); } } else { $this->db->query( sprintf("INSERT INTO %s (sess_id, vars, ip, created, changed) ". "VALUES (?, ?, ?, %s, %s)", - get_table_name('session'), $now, $now), + $this->db->table_name('session'), $now, $now), $key, base64_encode($vars), (string)$this->ip); } @@ -228,7 +228,7 @@ class rcube_session public function db_destroy($key) { $this->db->query( - sprintf("DELETE FROM %s WHERE sess_id = ?", get_table_name('session')), + sprintf("DELETE FROM %s WHERE sess_id = ?", $this->db->table_name('session')), $key); return true; @@ -246,7 +246,7 @@ class rcube_session // just delete all expired sessions $this->db->query( sprintf("DELETE FROM %s WHERE changed < %s", - get_table_name('session'), $this->db->fromunixtime(time() - $maxlifetime))); + $this->db->table_name('session'), $this->db->fromunixtime(time() - $maxlifetime))); $this->gc(); @@ -322,8 +322,9 @@ class rcube_session */ public function gc() { - foreach ($this->gc_handlers as $fct) + foreach ($this->gc_handlers as $fct) { call_user_func($fct); + } } @@ -624,14 +625,14 @@ class rcube_session $auth_string = "$this->key,$this->secret,$timeslot"; return "S" . (function_exists('sha1') ? sha1($auth_string) : md5($auth_string)); } - + /** * */ function log($line) { if ($this->logging) - write_log('session', $line); + rcmail::write_log('session', $line); } } |