summaryrefslogtreecommitdiff
path: root/plugins/htpasswd/BridgeHtpasswd.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/htpasswd/BridgeHtpasswd.php')
-rw-r--r--plugins/htpasswd/BridgeHtpasswd.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/htpasswd/BridgeHtpasswd.php b/plugins/htpasswd/BridgeHtpasswd.php
index 51b6a94..62ac1f4 100644
--- a/plugins/htpasswd/BridgeHtpasswd.php
+++ b/plugins/htpasswd/BridgeHtpasswd.php
@@ -9,11 +9,15 @@ class BridgeHtpasswd extends EjabberdAuthBridge {
$this->config = $config;
}
+ function getData($server) {
+ return array_key_exists($server, $this->data) ? $this->data[$server] : $this->data[NULL];
+ }
+
function isuser($username, $server) {
- return array_key_exists($username, $this->data);
+ return array_key_exists($username, $this->getData($server));
}
function auth($username, $server, $password) {
- return $this->isuser($username, $server) && htpasswd_check($password, $this->data[$username], $this->config);
+ return $this->isuser($username, $server) && htpasswd_check($password, $this->getData($server)[$username], $this->config);
}
}