From 02599b364288aa62a257b5b10841a574a3b66374 Mon Sep 17 00:00:00 2001 From: Christoph Burschka Date: Sat, 23 Aug 2014 07:49:26 +0000 Subject: Fix #7: Fix the pruning query. session.module is supposed to prune expired auth tokens on every login request. The pruning query had the incorrect SQL syntax "DELETE COUNT(*) FROM" which mysql does not accept. --- plugins/session/BridgeSession.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/session/BridgeSession.php b/plugins/session/BridgeSession.php index d9c3afc..841622c 100644 --- a/plugins/session/BridgeSession.php +++ b/plugins/session/BridgeSession.php @@ -10,7 +10,7 @@ class BridgeSession extends EjabberdAuthBridge { $this->table = $config['mysql']['tablename']; $this->_isuser = $this->db->prepare(sprintf('SELECT COUNT(*) FROM `%s` WHERE `username` = :user AND `created` >= :limit;', $this->table)); $this->_auth = $this->db->prepare(sprintf('DELETE FROM `%s` WHERE `username` = :user AND `secret` = :secret AND `created` >= :limit;', $this->table)); - $this->_prune = $this->db->prepare(sprintf('DELETE COUNT(*) FROM `%s` WHERE `created` < :limit;', $this->table)); + $this->_prune = $this->db->prepare(sprintf('DELETE FROM `%s` WHERE `created` < :limit;', $this->table)); } function prune() { -- cgit v1.1