From b04c17301ec17397f858fb8cca7cb0043c16d4d5 Mon Sep 17 00:00:00 2001 From: Christoph Burschka Date: Tue, 30 Oct 2012 15:40:38 +0100 Subject: Add phpbb4 plugin (for trunk of phpBB) --- plugins/phpbb3/JabberAuthPhpBB.php | 38 ----------------------------------- plugins/phpbb3/JabberAuthPhpBB3.php | 38 +++++++++++++++++++++++++++++++++++ plugins/phpbb3/phpbb3.module | 10 ++++++++++ plugins/phpbb3/phpbb3_bootstrap.php | 40 +++++++++++++++++++++++++++++++++++++ plugins/phpbb3/phpbb_bootstrap.php | 40 ------------------------------------- 5 files changed, 88 insertions(+), 78 deletions(-) delete mode 100644 plugins/phpbb3/JabberAuthPhpBB.php create mode 100644 plugins/phpbb3/JabberAuthPhpBB3.php create mode 100644 plugins/phpbb3/phpbb3.module create mode 100644 plugins/phpbb3/phpbb3_bootstrap.php delete mode 100644 plugins/phpbb3/phpbb_bootstrap.php (limited to 'plugins/phpbb3') diff --git a/plugins/phpbb3/JabberAuthPhpBB.php b/plugins/phpbb3/JabberAuthPhpBB.php deleted file mode 100644 index e60cbae..0000000 --- a/plugins/phpbb3/JabberAuthPhpBB.php +++ /dev/null @@ -1,38 +0,0 @@ -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; - } -} diff --git a/plugins/phpbb3/JabberAuthPhpBB3.php b/plugins/phpbb3/JabberAuthPhpBB3.php new file mode 100644 index 0000000..e60cbae --- /dev/null +++ b/plugins/phpbb3/JabberAuthPhpBB3.php @@ -0,0 +1,38 @@ +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; + } +} diff --git a/plugins/phpbb3/phpbb3.module b/plugins/phpbb3/phpbb3.module new file mode 100644 index 0000000..4c58762 --- /dev/null +++ b/plugins/phpbb3/phpbb3.module @@ -0,0 +1,10 @@ +sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false); +// We do not need this any longer, unset for safety purposes +unset($dbpasswd); +$config = $cache->obtain_config(); diff --git a/plugins/phpbb3/phpbb_bootstrap.php b/plugins/phpbb3/phpbb_bootstrap.php deleted file mode 100644 index 4ede950..0000000 --- a/plugins/phpbb3/phpbb_bootstrap.php +++ /dev/null @@ -1,40 +0,0 @@ -sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false); -// We do not need this any longer, unset for safety purposes -unset($dbpasswd); -$config = $cache->obtain_config(); -- cgit v1.1