From b54236dceeedbf33796dcdb8319bc72f923584bb Mon Sep 17 00:00:00 2001 From: Christoph Burschka Date: Sun, 16 Nov 2014 14:01:10 +0100 Subject: Fix #8: Add htpasswd authentication ejabberd can now authenticate against Apache auth files. --- plugins/htpasswd/BridgeHtpasswd.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugins/htpasswd/BridgeHtpasswd.php (limited to 'plugins/htpasswd/BridgeHtpasswd.php') diff --git a/plugins/htpasswd/BridgeHtpasswd.php b/plugins/htpasswd/BridgeHtpasswd.php new file mode 100644 index 0000000..51b6a94 --- /dev/null +++ b/plugins/htpasswd/BridgeHtpasswd.php @@ -0,0 +1,19 @@ +data = $data; + $this->config = $config; + } + + function isuser($username, $server) { + return array_key_exists($username, $this->data); + } + + function auth($username, $server, $password) { + return $this->isuser($username, $server) && htpasswd_check($password, $this->data[$username], $this->config); + } +} -- cgit v1.1