summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Burschka2014-01-18 13:24:03 +0100
committerChristoph Burschka2014-01-18 13:24:03 +0100
commit56bab97f97b1e6f2071d53b23232cbb92d189e4b (patch)
tree148e5114649072b003f8ff5982f2e683cade2807
parentExplain the cross-domain thing. (diff)
downloadejabberd-auth-php-56bab97f97b1e6f2071d53b23232cbb92d189e4b.tar.gz
Add (hopefully) session auth for phpBB3.
-rw-r--r--plugins/phpbb30/phpbb30.module11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/phpbb30/phpbb30.module b/plugins/phpbb30/phpbb30.module
index 2fa8b9a..e6731c8 100644
--- a/plugins/phpbb30/phpbb30.module
+++ b/plugins/phpbb30/phpbb30.module
@@ -9,3 +9,14 @@ function phpbb30_init($config) {
require_once __DIR__ . '/BridgePhpBB30.php';
return new BridgePhpBB30($auth, $db);
}
+
+function phpbb30_session($config) {
+ global $phpbb_root_path;
+ $phpbb_root_path = $config['root_path'];
+ // Bootstrap the phpBB system.
+ require_once __DIR__ . '/phpbb30_bootstrap.php';
+ $GLOBALS['user'] = new user();
+ $GLOBALS['user']->session_begin();
+ return !empty($GLOBALS['user']->data['username']) ?
+ $GLOBALS['user']->data['username'] : FALSE;
+}