aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/index.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-03-28 21:36:07 +0200
committerIgor Wiedler <igor@wiedler.ch>2012-03-28 21:36:07 +0200
commit7258794be31a374c360f916952fefe6d22c80e87 (patch)
treeb37e27990baee3d63364b922a454de09389088a5 /phpBB/index.php
parent4239d8aa4e53cda036f67e39d8eb61ccd317a6c9 (diff)
parent7c3ebcc3ff16950f76f857381222070c36a76fc3 (diff)
downloadforums-7258794be31a374c360f916952fefe6d22c80e87.tar
forums-7258794be31a374c360f916952fefe6d22c80e87.tar.gz
forums-7258794be31a374c360f916952fefe6d22c80e87.tar.bz2
forums-7258794be31a374c360f916952fefe6d22c80e87.tar.xz
forums-7258794be31a374c360f916952fefe6d22c80e87.zip
Merge remote-tracking branch 'imkingdavid/ticket/10586' into develop
* imkingdavid/ticket/10586: [ticket/10586] Added space in if statement [ticket/10586] Tidy up comments [ticket/10586] Tests finally work (thanks naderman) [ticket/10586] Correctly purge board cache and don't rename install directory [ticket/10586] trying to get tests to work [ticket/10586] more work on getting tests to pass [ticket/10586] Tests are coming along, just a little more to go [ticket/10586] Rename install directory back to install/ after tests [ticket/10586] browse tests now work, but mine dont. at least we are making progress [ticket/10586] initial work on copying fixtures. Note that this depends on 10706 [ticket/10586] Adding the extensions used by the tests [ticket/10586] Now tests run, but fail. But here is what I have. [ticket/10586] some bootstrap additions and test changes to try and make it work [ticket/10586] test stuff. does not work yet, still need to put phpBB objects in bootstrap.php [ticket/10586] Copy/paste fail fixed [ticket/10586] Sanitize periods from class names, use manager to get path. [ticket/10586] Removed file_exists() check because class_exists() covers that. [ticket/10586] Extension front controller
Diffstat (limited to 'phpBB/index.php')
-rw-r--r--phpBB/index.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/phpBB/index.php b/phpBB/index.php
index f1243bb336..d71878a885 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -24,6 +24,39 @@ $user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
+// Handle the display of extension front pages
+if ($ext = $request->variable('ext', ''))
+{
+ $class = 'phpbb_ext_' . str_replace('/', '_', $ext) . '_controller';
+
+ if (!$phpbb_extension_manager->available($ext))
+ {
+ send_status_line(404, 'Not Found');
+ trigger_error($user->lang('EXTENSION_DOES_NOT_EXIST', $ext));
+ }
+ else if (!$phpbb_extension_manager->enabled($ext))
+ {
+ send_status_line(404, 'Not Found');
+ trigger_error($user->lang('EXTENSION_DISABLED', $ext));
+ }
+ else if (!class_exists($class))
+ {
+ send_status_line(404, 'Not Found');
+ trigger_error($user->lang('EXTENSION_CONTROLLER_MISSING', $ext));
+ }
+
+ $controller = new $class;
+
+ if (!($controller instanceof phpbb_extension_controller_interface))
+ {
+ send_status_line(500, 'Internal Server Error');
+ trigger_error($user->lang('EXTENSION_CLASS_WRONG_TYPE', $class));
+ }
+
+ $controller->handle();
+ exit_handler();
+}
+
display_forums('', $config['load_moderators']);
$order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend';