mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00: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:
parent
405cac7b99
commit
f06ad43da6
4 changed files with 19 additions and 15 deletions
|
@ -26,14 +26,15 @@ include($phpbb_root_path . 'common.'.$phpEx);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->start();
|
$user->start();
|
||||||
$user->setup();
|
|
||||||
$auth->acl($user->data);
|
$auth->acl($user->data);
|
||||||
// End session management
|
|
||||||
|
$user->setup();
|
||||||
|
|
||||||
|
|
||||||
// Load the appropriate faq file
|
// Load the appropriate faq file
|
||||||
if ( isset($_GET['mode']) )
|
if (isset($_GET['mode']))
|
||||||
{
|
{
|
||||||
switch( $_GET['mode'] )
|
switch($_GET['mode'])
|
||||||
{
|
{
|
||||||
case 'bbcode':
|
case 'bbcode':
|
||||||
$lang_file = 'lang_bbcode';
|
$lang_file = 'lang_bbcode';
|
||||||
|
@ -62,7 +63,7 @@ $faq_block_titles = array();
|
||||||
|
|
||||||
for($i = 0; $i < count($faq); $i++)
|
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]['id'] = $counter_2;
|
||||||
$faq_block[$j][$counter]['question'] = $faq[$i][0];
|
$faq_block[$j][$counter]['question'] = $faq[$i][0];
|
||||||
|
@ -73,7 +74,7 @@ for($i = 0; $i < count($faq); $i++)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$j = ( $counter != 0 ) ? $j + 1 : 0;
|
$j = ($counter != 0) ? $j + 1 : 0;
|
||||||
|
|
||||||
$faq_block_titles[$j] = $faq[$i][1];
|
$faq_block_titles[$j] = $faq[$i][1];
|
||||||
|
|
||||||
|
@ -91,7 +92,7 @@ $template->assign_vars(array(
|
||||||
|
|
||||||
for($i = 0; $i < count($faq_block); $i++)
|
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(
|
$template->assign_block_vars('faq_block', array(
|
||||||
'BLOCK_TITLE' => $faq_block_titles[$i])
|
'BLOCK_TITLE' => $faq_block_titles[$i])
|
||||||
|
|
|
@ -52,9 +52,10 @@ include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->start();
|
$user->start();
|
||||||
$user->setup();
|
|
||||||
$auth->acl($user->data);
|
$auth->acl($user->data);
|
||||||
|
|
||||||
|
$user->setup();
|
||||||
|
|
||||||
|
|
||||||
// Obtain initial var settings
|
// Obtain initial var settings
|
||||||
$forum_id = (isset($_REQUEST['f'])) ? max(0, intval($_REQUEST['f'])) : 0;
|
$forum_id = (isset($_REQUEST['f'])) ? max(0, intval($_REQUEST['f'])) : 0;
|
||||||
|
|
|
@ -32,9 +32,10 @@ include($phpbb_root_path . 'common.'.$phpEx);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->start();
|
$user->start();
|
||||||
$user->setup();
|
|
||||||
$auth->acl($user->data);
|
$auth->acl($user->data);
|
||||||
|
|
||||||
|
$user->setup();
|
||||||
|
|
||||||
|
|
||||||
// Grab data
|
// Grab data
|
||||||
$mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : '';
|
$mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : '';
|
||||||
|
@ -311,7 +312,7 @@ switch ($mode)
|
||||||
$post_count_sql";
|
$post_count_sql";
|
||||||
$result = $db->sql_query($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);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$sql = 'SELECT f.forum_id, f.forum_name, COUNT(post_id) AS num_posts
|
$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) . "'";
|
$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
|
$sql = 'SELECT DISTINCT poster_id
|
||||||
FROM " . POSTS_TABLE . "
|
FROM ' . POSTS_TABLE . '
|
||||||
WHERE poster_ip " . ((preg_match('#%#', $ips)) ? 'LIKE' : 'IN') . " ($ips)";
|
WHERE poster_ip ' . ((preg_match('#%#', $ips)) ? 'LIKE' : 'IN') . " ($ips)";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -898,7 +899,7 @@ function show_profile($data)
|
||||||
'USERNAME' => $username,
|
'USERNAME' => $username,
|
||||||
'USER_COLOR' => (!empty($data['user_colour'])) ? $data['user_colour'] : '',
|
'USER_COLOR' => (!empty($data['user_colour'])) ? $data['user_colour'] : '',
|
||||||
'RANK_TITLE' => $rank_title,
|
'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']),
|
'JOINED' => $user->format_date($data['user_regdate'], $user->lang['DATE_FORMAT']),
|
||||||
'VISITED' => (empty($last_visit)) ? ' - ' : $user->format_date($last_visit, $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,
|
'POSTS' => ($data['user_posts']) ? $data['user_posts'] : 0,
|
||||||
|
|
|
@ -26,9 +26,10 @@ include($phpbb_root_path . 'common.'.$phpEx);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->start();
|
$user->start();
|
||||||
$user->setup();
|
|
||||||
$auth->acl($user->data);
|
$auth->acl($user->data);
|
||||||
|
|
||||||
|
$user->setup();
|
||||||
|
|
||||||
|
|
||||||
// var definitions
|
// var definitions
|
||||||
$post_id = (!empty($_REQUEST['p'])) ? intval($_REQUEST['p']) : 0;
|
$post_id = (!empty($_REQUEST['p'])) ? intval($_REQUEST['p']) : 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue