From c92b1bd7538ed0eb18bdb3a1401fe4d0010bfdeb Mon Sep 17 00:00:00 2001 From: Christoph Burschka Date: Fri, 2 Nov 2012 23:19:12 +0100 Subject: Renaming phpbb versions properly. --- config.sample.php | 8 ++--- plugins/phpbb3/BridgePhpBB3.php | 36 ---------------------- plugins/phpbb3/noweb_user.php | 17 ----------- plugins/phpbb3/phpbb3.module | 11 ------- plugins/phpbb3/phpbb3_bootstrap.php | 45 ---------------------------- plugins/phpbb30/BridgePhpBB30.php | 36 ++++++++++++++++++++++ plugins/phpbb30/noweb_user.php | 17 +++++++++++ plugins/phpbb30/phpbb30.module | 11 +++++++ plugins/phpbb30/phpbb30_bootstrap.php | 45 ++++++++++++++++++++++++++++ plugins/phpbb31/BridgePhpBB31.php | 38 ++++++++++++++++++++++++ plugins/phpbb31/noweb_user.php | 17 +++++++++++ plugins/phpbb31/phpbb31.module | 10 +++++++ plugins/phpbb31/phpbb31_bootstrap.php | 56 +++++++++++++++++++++++++++++++++++ plugins/phpbb4/JabberAuthPhpBB4.php | 38 ------------------------ plugins/phpbb4/noweb_user.php | 17 ----------- plugins/phpbb4/phpbb4.module | 10 ------- plugins/phpbb4/phpbb4_bootstrap.php | 56 ----------------------------------- 17 files changed, 234 insertions(+), 234 deletions(-) delete mode 100644 plugins/phpbb3/BridgePhpBB3.php delete mode 100644 plugins/phpbb3/noweb_user.php delete mode 100644 plugins/phpbb3/phpbb3.module delete mode 100644 plugins/phpbb3/phpbb3_bootstrap.php create mode 100644 plugins/phpbb30/BridgePhpBB30.php create mode 100644 plugins/phpbb30/noweb_user.php create mode 100644 plugins/phpbb30/phpbb30.module create mode 100644 plugins/phpbb30/phpbb30_bootstrap.php create mode 100644 plugins/phpbb31/BridgePhpBB31.php create mode 100644 plugins/phpbb31/noweb_user.php create mode 100644 plugins/phpbb31/phpbb31.module create mode 100644 plugins/phpbb31/phpbb31_bootstrap.php delete mode 100644 plugins/phpbb4/JabberAuthPhpBB4.php delete mode 100644 plugins/phpbb4/noweb_user.php delete mode 100644 plugins/phpbb4/phpbb4.module delete mode 100644 plugins/phpbb4/phpbb4_bootstrap.php diff --git a/config.sample.php b/config.sample.php index 94edc32..ad1c536 100644 --- a/config.sample.php +++ b/config.sample.php @@ -5,12 +5,12 @@ $config['plugin'] = 'phpbb3'; $config['log_path'] = __DIR__ . '/logs/'; -$config['phpbb3'] = array( - 'root_path' => '' /* path to your phpBB3 installation */, +$config['phpbb30'] = array( + 'root_path' => '' /* path to your phpBB30 installation */, ); -$config['phpbb4'] = array( - 'root_path' => '' /* path to your phpBB4 installation */, +$config['phpbb31'] = array( + 'root_path' => '' /* path to your phpBB31 installation */, ); $config['drupal7'] = array( diff --git a/plugins/phpbb3/BridgePhpBB3.php b/plugins/phpbb3/BridgePhpBB3.php deleted file mode 100644 index bc7d8c8..0000000 --- a/plugins/phpbb3/BridgePhpBB3.php +++ /dev/null @@ -1,36 +0,0 @@ -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/noweb_user.php b/plugins/phpbb3/noweb_user.php deleted file mode 100644 index 3291222..0000000 --- a/plugins/phpbb3/noweb_user.php +++ /dev/null @@ -1,17 +0,0 @@ -.\n"); - exit; -} -require($phpbb_root_path . 'includes/startup.' . $phpEx); - -if (file_exists($phpbb_root_path . 'config.' . $phpEx)) -{ - require($phpbb_root_path . 'config.' . $phpEx); -} - -if (!defined('PHPBB_INSTALLED')) -{ - file_put_contents('php://stderr', "phpBB needs to be installed first.\n"); - exit; -} - -// Include files -require(__DIR__ . '/noweb_user.php'); -require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx); -require($phpbb_root_path . 'includes/cache.' . $phpEx); -require($phpbb_root_path . 'includes/auth.' . $phpEx); -require($phpbb_root_path . 'includes/functions.' . $phpEx); -require($phpbb_root_path . 'includes/functions_content.' . $phpEx); - -require($phpbb_root_path . 'includes/constants.' . $phpEx); -require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); -require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); - -// Instantiate some basic classes -$user = new noweb_user(); -$auth = new auth(); -$db = new $sql_db(); -$cache = new cache(); - -// Connect to DB -$db->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/phpbb30/BridgePhpBB30.php b/plugins/phpbb30/BridgePhpBB30.php new file mode 100644 index 0000000..bc7d8c8 --- /dev/null +++ b/plugins/phpbb30/BridgePhpBB30.php @@ -0,0 +1,36 @@ +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/phpbb30/noweb_user.php b/plugins/phpbb30/noweb_user.php new file mode 100644 index 0000000..3291222 --- /dev/null +++ b/plugins/phpbb30/noweb_user.php @@ -0,0 +1,17 @@ +.\n"); + exit; +} +require($phpbb_root_path . 'includes/startup.' . $phpEx); + +if (file_exists($phpbb_root_path . 'config.' . $phpEx)) +{ + require($phpbb_root_path . 'config.' . $phpEx); +} + +if (!defined('PHPBB_INSTALLED')) +{ + file_put_contents('php://stderr', "phpBB needs to be installed first.\n"); + exit; +} + +// Include files +require(__DIR__ . '/noweb_user.php'); +require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx); +require($phpbb_root_path . 'includes/cache.' . $phpEx); +require($phpbb_root_path . 'includes/auth.' . $phpEx); +require($phpbb_root_path . 'includes/functions.' . $phpEx); +require($phpbb_root_path . 'includes/functions_content.' . $phpEx); + +require($phpbb_root_path . 'includes/constants.' . $phpEx); +require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); +require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); + +// Instantiate some basic classes +$user = new noweb_user(); +$auth = new auth(); +$db = new $sql_db(); +$cache = new cache(); + +// Connect to DB +$db->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/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 @@ +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/phpbb31/noweb_user.php b/plugins/phpbb31/noweb_user.php new file mode 100644 index 0000000..3291222 --- /dev/null +++ b/plugins/phpbb31/noweb_user.php @@ -0,0 +1,17 @@ +.\n"); + exit; +} + +require($phpbb_root_path . 'includes/startup.' . $phpEx); +require_once __DIR__ . '/noweb_user.php'; + +if (file_exists($phpbb_root_path . 'config.' . $phpEx)) +{ + require($phpbb_root_path . 'config.' . $phpEx); +} + +// Include files +require($phpbb_root_path . 'includes/class_loader.' . $phpEx); +require($phpbb_root_path . 'includes/di/processor/interface.' . $phpEx); +require($phpbb_root_path . 'includes/di/processor/config.' . $phpEx); + +require($phpbb_root_path . 'includes/functions.' . $phpEx); +require($phpbb_root_path . 'includes/functions_content.' . $phpEx); + +require($phpbb_root_path . 'includes/constants.' . $phpEx); +require($phpbb_root_path . 'includes/db/' . ltrim($dbms, 'dbal_') . '.' . $phpEx); +require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); + +// Set PHP error handler to ours +set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); + +$phpbb_container = new ContainerBuilder(); +$loader = new YamlFileLoader($phpbb_container, new FileLocator($phpbb_root_path.'/config')); +$loader->load('services.yml'); + +$processor = new phpbb_di_processor_config($phpbb_root_path . 'config.' . $phpEx, $phpbb_root_path, $phpEx); +$processor->process($phpbb_container); + +// Setup class loader first +$phpbb_class_loader = $phpbb_container->get('class_loader'); +$phpbb_class_loader_ext = $phpbb_container->get('class_loader.ext'); + +// Instantiate some basic classes +$user = new noweb_user; +$auth = $phpbb_container->get('auth'); +$db = $phpbb_container->get('dbal.conn'); + +// Grab global variables, re-cache if necessary +$config = $phpbb_container->get('config'); +set_config(null, null, null, $config); +set_config_count(null, null, null, $config); diff --git a/plugins/phpbb4/JabberAuthPhpBB4.php b/plugins/phpbb4/JabberAuthPhpBB4.php deleted file mode 100644 index e60cbae..0000000 --- a/plugins/phpbb4/JabberAuthPhpBB4.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/phpbb4/noweb_user.php b/plugins/phpbb4/noweb_user.php deleted file mode 100644 index 3291222..0000000 --- a/plugins/phpbb4/noweb_user.php +++ /dev/null @@ -1,17 +0,0 @@ -.\n"); - exit; -} - -require($phpbb_root_path . 'includes/startup.' . $phpEx); -require_once __DIR__ . '/noweb_user.php'; - -if (file_exists($phpbb_root_path . 'config.' . $phpEx)) -{ - require($phpbb_root_path . 'config.' . $phpEx); -} - -// Include files -require($phpbb_root_path . 'includes/class_loader.' . $phpEx); -require($phpbb_root_path . 'includes/di/processor/interface.' . $phpEx); -require($phpbb_root_path . 'includes/di/processor/config.' . $phpEx); - -require($phpbb_root_path . 'includes/functions.' . $phpEx); -require($phpbb_root_path . 'includes/functions_content.' . $phpEx); - -require($phpbb_root_path . 'includes/constants.' . $phpEx); -require($phpbb_root_path . 'includes/db/' . ltrim($dbms, 'dbal_') . '.' . $phpEx); -require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); - -// Set PHP error handler to ours -set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); - -$phpbb_container = new ContainerBuilder(); -$loader = new YamlFileLoader($phpbb_container, new FileLocator($phpbb_root_path.'/config')); -$loader->load('services.yml'); - -$processor = new phpbb_di_processor_config($phpbb_root_path . 'config.' . $phpEx, $phpbb_root_path, $phpEx); -$processor->process($phpbb_container); - -// Setup class loader first -$phpbb_class_loader = $phpbb_container->get('class_loader'); -$phpbb_class_loader_ext = $phpbb_container->get('class_loader.ext'); - -// Instantiate some basic classes -$user = new noweb_user; -$auth = $phpbb_container->get('auth'); -$db = $phpbb_container->get('dbal.conn'); - -// Grab global variables, re-cache if necessary -$config = $phpbb_container->get('config'); -set_config(null, null, null, $config); -set_config_count(null, null, null, $config); -- cgit v1.1