summaryrefslogtreecommitdiff
path: root/phpbb-bridge
diff options
context:
space:
mode:
authorChristoph Burschka2012-10-30 02:45:21 +0100
committerChristoph Burschka2012-10-30 02:45:21 +0100
commit7fc3addf1b2796998fe0350cd4c5d7513612b1ba (patch)
treeda7b47008fc112e53aee5ab51b8a39f6be4f54f2 /phpbb-bridge
downloadejabberd-auth-php-7fc3addf1b2796998fe0350cd4c5d7513612b1ba.tar.gz
Initial checkin
Diffstat (limited to 'phpbb-bridge')
-rw-r--r--phpbb-bridge/noweb_user.php17
-rw-r--r--phpbb-bridge/phpbb_bootstrap.php51
2 files changed, 68 insertions, 0 deletions
diff --git a/phpbb-bridge/noweb_user.php b/phpbb-bridge/noweb_user.php
new file mode 100644
index 0000000..3291222
--- /dev/null
+++ b/phpbb-bridge/noweb_user.php
@@ -0,0 +1,17 @@
+<?php
+
+class noweb_user {
+ var $session_id = '';
+ var $browser = 'N/A';
+ var $forwarded_for = '127.0.0.1';
+ var $ip = '127.0.0.1';
+
+ function session_create() {
+ // do absolutely nothing. however, unless we tell the auth module the session
+ // was successfully created, it won't pass back a success.
+ return TRUE;
+ }
+
+ function setup() {
+ }
+}
diff --git a/phpbb-bridge/phpbb_bootstrap.php b/phpbb-bridge/phpbb_bootstrap.php
new file mode 100644
index 0000000..3f7dee5
--- /dev/null
+++ b/phpbb-bridge/phpbb_bootstrap.php
@@ -0,0 +1,51 @@
+<?php
+define('IN_PHPBB', TRUE);
+$phpEx = 'php';
+
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+
+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);