diff options
author | Christoph Burschka | 2012-10-30 15:40:38 +0100 |
---|---|---|
committer | Christoph Burschka | 2012-10-30 15:40:38 +0100 |
commit | b04c17301ec17397f858fb8cca7cb0043c16d4d5 (patch) | |
tree | 720e0d076e035f00e300e426b9323f05b77f9e36 /plugins/phpbb4/JabberAuthPhpBB4.php | |
parent | Refactor to a general, flexible and extensible architecture. (diff) | |
download | ejabberd-auth-php-b04c17301ec17397f858fb8cca7cb0043c16d4d5.tar.gz |
Add phpbb4 plugin (for trunk of phpBB)
Diffstat (limited to 'plugins/phpbb4/JabberAuthPhpBB4.php')
-rw-r--r-- | plugins/phpbb4/JabberAuthPhpBB4.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/phpbb4/JabberAuthPhpBB4.php b/plugins/phpbb4/JabberAuthPhpBB4.php new file mode 100644 index 0000000..e60cbae --- /dev/null +++ b/plugins/phpbb4/JabberAuthPhpBB4.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; + } +} |