1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-31 13:48:04 +01:00

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
This commit is contained in:
Paul S. Owen 2003-07-14 22:54:39 +00:00
parent 405cac7b99
commit f06ad43da6
4 changed files with 19 additions and 15 deletions

View File

@ -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])

View File

@ -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;

View File

@ -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,

View File

@ -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;