diff options
author | Christoph Burschka | 2012-10-30 02:45:21 +0100 |
---|---|---|
committer | Christoph Burschka | 2012-10-30 02:45:21 +0100 |
commit | 7fc3addf1b2796998fe0350cd4c5d7513612b1ba (patch) | |
tree | da7b47008fc112e53aee5ab51b8a39f6be4f54f2 /classes/JabberAuthPhpBB.php | |
download | ejabberd-auth-php-7fc3addf1b2796998fe0350cd4c5d7513612b1ba.tar.gz |
Initial checkin
Diffstat (limited to 'classes/JabberAuthPhpBB.php')
-rw-r--r-- | classes/JabberAuthPhpBB.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/classes/JabberAuthPhpBB.php b/classes/JabberAuthPhpBB.php new file mode 100644 index 0000000..e60cbae --- /dev/null +++ b/classes/JabberAuthPhpBB.php @@ -0,0 +1,38 @@ +<?php + +class JabberAuthPhpBB extends JabberAuth { + var $auth; + var $db; + + function __construct($auth, $db, $logpath) { + $this->logpath = $logpath; + parent::init(); + $this->auth = $auth; + $this->db = $db; + } + + function isuser($username, $server) { + $username_clean = utf8_clean_string($username); + $row = $this->db->sql_fetchrow($this->db->sql_query('SELECT username FROM ' . USERS_TABLE . ' WHERE username_clean = ' . "'" . $this->db->sql_escape($username_clean) . "'" . ';')); + return !empty($row); + } + + function auth($username, $server, $password) { + $result = $this->auth->login($username, $password); + return $result['status'] == LOGIN_SUCCESS; + } + + // The following functions are disabled. This script will not change the phpBB user database. + + function setpass($username, $server, $password) { + return FALSE; + } + + function tryregister($username, $server, $password) { + return FALSE; + } + + function removeuser($username, $server) { + return FALSE; + } +} |