diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-07-14 22:54:39 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-07-14 22:54:39 +0000 |
commit | f06ad43da62a94c0e46219b9c878276633fb39c5 (patch) | |
tree | 87d02df7a810d829218321ab00c346c3920cb565 /phpBB | |
parent | 405cac7b996671069d6e4fb4b6cf0fffec66b0fb (diff) | |
download | forums-f06ad43da62a94c0e46219b9c878276633fb39c5.tar forums-f06ad43da62a94c0e46219b9c878276633fb39c5.tar.gz forums-f06ad43da62a94c0e46219b9c878276633fb39c5.tar.bz2 forums-f06ad43da62a94c0e46219b9c878276633fb39c5.tar.xz forums-f06ad43da62a94c0e46219b9c878276633fb39c5.zip |
Re-arrange auth and setup calls ... needs to be repeated for all major scripts
git-svn-id: file:///svn/phpbb/trunk@4262 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/faq.php | 15 | ||||
-rw-r--r-- | phpBB/mcp.php | 3 | ||||
-rw-r--r-- | phpBB/memberlist.php | 13 | ||||
-rw-r--r-- | phpBB/report.php | 3 |
4 files changed, 19 insertions, 15 deletions
diff --git a/phpBB/faq.php b/phpBB/faq.php index 6ece3354f9..02a6107ee5 100644 --- a/phpBB/faq.php +++ b/phpBB/faq.php @@ -26,14 +26,15 @@ include($phpbb_root_path . 'common.'.$phpEx); // Start session management $user->start(); -$user->setup(); $auth->acl($user->data); -// End session management + +$user->setup(); + // Load the appropriate faq file -if ( isset($_GET['mode']) ) +if (isset($_GET['mode'])) { - switch( $_GET['mode'] ) + switch($_GET['mode']) { case 'bbcode': $lang_file = 'lang_bbcode'; @@ -62,7 +63,7 @@ $faq_block_titles = array(); for($i = 0; $i < count($faq); $i++) { - if ( $faq[$i][0] != '--' ) + if ($faq[$i][0] != '--') { $faq_block[$j][$counter]['id'] = $counter_2; $faq_block[$j][$counter]['question'] = $faq[$i][0]; @@ -73,7 +74,7 @@ for($i = 0; $i < count($faq); $i++) } else { - $j = ( $counter != 0 ) ? $j + 1 : 0; + $j = ($counter != 0) ? $j + 1 : 0; $faq_block_titles[$j] = $faq[$i][1]; @@ -91,7 +92,7 @@ $template->assign_vars(array( for($i = 0; $i < count($faq_block); $i++) { - if ( count($faq_block[$i]) ) + if (count($faq_block[$i])) { $template->assign_block_vars('faq_block', array( 'BLOCK_TITLE' => $faq_block_titles[$i]) diff --git a/phpBB/mcp.php b/phpBB/mcp.php index f6ff246133..729469f47b 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -52,9 +52,10 @@ include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); // Start session management $user->start(); -$user->setup(); $auth->acl($user->data); +$user->setup(); + // Obtain initial var settings $forum_id = (isset($_REQUEST['f'])) ? max(0, intval($_REQUEST['f'])) : 0; diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index c19f8f9af9..bdc4ba8c1e 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -32,9 +32,10 @@ include($phpbb_root_path . 'common.'.$phpEx); // Start session management $user->start(); -$user->setup(); $auth->acl($user->data); +$user->setup(); + // Grab data $mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : ''; @@ -311,7 +312,7 @@ switch ($mode) $post_count_sql"; $result = $db->sql_query($sql); - $num_real_posts = min($row['user_posts'], $db->sql_fetchfield('num_posts', 0, $result)); + $num_real_posts = min($user->data['user_posts'], $db->sql_fetchfield('num_posts', 0, $result)); $db->sql_freeresult($result); $sql = 'SELECT f.forum_id, f.forum_name, COUNT(post_id) AS num_posts @@ -683,9 +684,9 @@ switch ($mode) { $ips = (preg_match('#[a-z]#', $ipdomain)) ? implode(', ', preg_replace('#([0-9]{1,3}\.[0-9]{1,3}[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})#', "'\\1'", gethostbynamel($ipdomain))) : "'" . str_replace('*', '%', $ipdomain) . "'"; - $sql = "SELECT DISTINCT poster_id - FROM " . POSTS_TABLE . " - WHERE poster_ip " . ((preg_match('#%#', $ips)) ? 'LIKE' : 'IN') . " ($ips)"; + $sql = 'SELECT DISTINCT poster_id + FROM ' . POSTS_TABLE . ' + WHERE poster_ip ' . ((preg_match('#%#', $ips)) ? 'LIKE' : 'IN') . " ($ips)"; $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) @@ -898,7 +899,7 @@ function show_profile($data) 'USERNAME' => $username, 'USER_COLOR' => (!empty($data['user_colour'])) ? $data['user_colour'] : '', 'RANK_TITLE' => $rank_title, - 'KARMA' => (!empty($row['user_karma'])) ? $data['user_karma'] : 0, + 'KARMA' => (!empty($data['user_karma'])) ? $data['user_karma'] : 0, 'JOINED' => $user->format_date($data['user_regdate'], $user->lang['DATE_FORMAT']), 'VISITED' => (empty($last_visit)) ? ' - ' : $user->format_date($last_visit, $user->lang['DATE_FORMAT']), 'POSTS' => ($data['user_posts']) ? $data['user_posts'] : 0, diff --git a/phpBB/report.php b/phpBB/report.php index 32c3b55c13..c49d75588c 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -26,9 +26,10 @@ include($phpbb_root_path . 'common.'.$phpEx); // Start session management $user->start(); -$user->setup(); $auth->acl($user->data); +$user->setup(); + // var definitions $post_id = (!empty($_REQUEST['p'])) ? intval($_REQUEST['p']) : 0; |