aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/ucp.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-09-23 13:31:04 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-09-23 13:31:04 +0000
commitbb97d3531aae6d11f468e72a9db0c2bb4282ebec (patch)
tree33aef912a133d94ed22b48921dd21ea36abdffcd /phpBB/ucp.php
parentce6b87ccec8a92c5455871446f88b122019672e9 (diff)
downloadforums-bb97d3531aae6d11f468e72a9db0c2bb4282ebec.tar
forums-bb97d3531aae6d11f468e72a9db0c2bb4282ebec.tar.gz
forums-bb97d3531aae6d11f468e72a9db0c2bb4282ebec.tar.bz2
forums-bb97d3531aae6d11f468e72a9db0c2bb4282ebec.tar.xz
forums-bb97d3531aae6d11f468e72a9db0c2bb4282ebec.zip
remove exit statement and make sure no "additional" code gets executed
git-svn-id: file:///svn/phpbb/trunk@8916 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/ucp.php')
-rw-r--r--phpBB/ucp.php82
1 files changed, 47 insertions, 35 deletions
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index 603391c046..d4eb566301 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -37,7 +37,7 @@ $template->assign_var('S_IN_UCP', true);
$module = new p_master();
-// Basic "global" modes
+// Go through basic "global" modes
switch ($mode)
{
case 'activate':
@@ -69,7 +69,6 @@ switch ($mode)
case 'confirm':
$module->load('ucp', 'confirm');
- exit;
break;
case 'login':
@@ -233,26 +232,57 @@ switch ($mode)
trigger_error($message);
break;
-}
-// Only registered users can go beyond this point
-if (!$user->data['is_registered'])
-{
- if ($user->data['is_bot'])
- {
- redirect(append_sid('index'));
- }
+ default:
- login_box('', $user->lang['LOGIN_EXPLAIN_UCP']);
-}
+ // Only registered users can go beyond this point
+ if (!$user->data['is_registered'])
+ {
+ if ($user->data['is_bot'])
+ {
+ redirect(append_sid('index'));
+ }
+
+ login_box('', $user->lang['LOGIN_EXPLAIN_UCP']);
+ }
-// Instantiate module system and generate list of available modules
-$module->list_modules('ucp');
+ // Instantiate module system and generate list of available modules
+ $module->list_modules('ucp');
+
+ // Check if the zebra module is set
+ if ($module->is_active('zebra', 'friends'))
+ {
+ _display_friends();
+ }
+
+ // Do not display subscribed topics/forums if not allowed
+ if (!$config['allow_topic_notify'] && !$config['allow_forum_notify'])
+ {
+ $module->set_display('main', 'subscribed', false);
+ }
-// Check if the zebra module is set
-if ($module->is_active('zebra', 'friends'))
+ // Select the active module
+ $module->set_active($id, $mode);
+
+ // Load and execute the relevant module
+ $module->load_active();
+
+ // Assign data to the template engine for the list of modules
+ $module->assign_tpl_vars(append_sid('ucp'));
+
+ // Generate the page, do not display/query online list
+ $module->display($module->get_page_title(), false);
+
+ break;
+}
+
+/**
+* Output listing of friends online
+*/
+function _display_friends()
{
- // Output listing of friends online
+ global $config, $db, $template, $user, $auth;
+
$update_time = $config['load_online_time'] * 60;
$sql = $db->sql_build_query('SELECT_DISTINCT', array(
@@ -297,24 +327,6 @@ if ($module->is_active('zebra', 'friends'))
$db->sql_freeresult($result);
}
-// Do not display subscribed topics/forums if not allowed
-if (!$config['allow_topic_notify'] && !$config['allow_forum_notify'])
-{
- $module->set_display('main', 'subscribed', false);
-}
-
-// Select the active module
-$module->set_active($id, $mode);
-
-// Load and execute the relevant module
-$module->load_active();
-
-// Assign data to the template engine for the list of modules
-$module->assign_tpl_vars(append_sid('ucp'));
-
-// Generate the page, do not display/query online list
-$module->display($module->get_page_title(), false);
-
/**
* Function for assigning a template var if the zebra module got included
*/