summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Burschka2014-08-23 07:49:26 +0000
committerChristoph Burschka2014-08-23 07:49:26 +0000
commit02599b364288aa62a257b5b10841a574a3b66374 (patch)
treee1b5a1f162a98e2cacfefd4ec1274fd2211a5e3a
parentMerge pull request #6 from sylae/master (diff)
downloadejabberd-auth-php-02599b364288aa62a257b5b10841a574a3b66374.tar.gz
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.
-rw-r--r--plugins/session/BridgeSession.php2
1 files changed, 1 insertions, 1 deletions
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() {