diff options
author | Christoph Burschka | 2012-11-02 23:19:12 +0100 |
---|---|---|
committer | Christoph Burschka | 2012-11-02 23:19:12 +0100 |
commit | c92b1bd7538ed0eb18bdb3a1401fe4d0010bfdeb (patch) | |
tree | 4df80ba2396093c2781e20430f2232190f74976b /plugins/phpbb31/BridgePhpBB31.php | |
parent | Typo in config.sample.php (diff) | |
download | ejabberd-auth-php-c92b1bd7538ed0eb18bdb3a1401fe4d0010bfdeb.tar.gz |
Renaming phpbb versions properly.
Diffstat (limited to 'plugins/phpbb31/BridgePhpBB31.php')
-rw-r--r-- | plugins/phpbb31/BridgePhpBB31.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/phpbb31/BridgePhpBB31.php b/plugins/phpbb31/BridgePhpBB31.php new file mode 100644 index 0000000..e60cbae --- /dev/null +++ b/plugins/phpbb31/BridgePhpBB31.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; + } +} |