mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 22:08:54 +00:00
- session changes
git-svn-id: file:///svn/phpbb/trunk@5247 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
9f8bb469f1
commit
a2bafd86f8
9 changed files with 49 additions and 27 deletions
|
@ -21,7 +21,7 @@ $download_id = request_var('id', 0);
|
|||
$thumbnail = request_var('t', false);
|
||||
|
||||
// Start session management
|
||||
$user->start();
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
$user->setup('viewtopic');
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
|
|||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
// Start session management
|
||||
$user->start();
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
$user->setup();
|
||||
|
||||
|
|
|
@ -14,13 +14,13 @@ define('IN_PHPBB', true);
|
|||
$phpbb_root_path = './';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
|
||||
// Start session management
|
||||
$user->start();
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
$user->setup();
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
display_forums('', $config['load_moderators']);
|
||||
|
||||
// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
|
||||
|
|
|
@ -284,7 +284,7 @@ class module
|
|||
*/
|
||||
|
||||
// Start session management
|
||||
$user->start();
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
$user->setup('mcp');
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
|
|||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
// Start session management
|
||||
$user->start();
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
$user->setup(array('memberlist', 'groups'));
|
||||
|
||||
|
@ -56,7 +56,7 @@ $sort_dir = request_var('sd', 'a');
|
|||
|
||||
// Grab rank information for later
|
||||
$ranks = array();
|
||||
obtain_ranks($ranks);
|
||||
$cache->obtain_ranks($ranks);
|
||||
|
||||
|
||||
// What do you want to do today? ... oops, I think that line is taken ...
|
||||
|
@ -275,9 +275,6 @@ switch ($mode)
|
|||
|
||||
case 'viewprofile':
|
||||
// Display a profile
|
||||
$page_title = sprintf($user->lang['VIEWING_PROFILE'], $row['username']);
|
||||
$template_html = 'memberlist_view.html';
|
||||
|
||||
if ($user_id == ANONYMOUS)
|
||||
{
|
||||
trigger_error('NO_USER');
|
||||
|
@ -509,7 +506,12 @@ switch ($mode)
|
|||
$template->assign_block_vars('custom_fields', $field_data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// Now generate page tilte
|
||||
$page_title = sprintf($user->lang['VIEWING_PROFILE'], $member['username']);
|
||||
$template_html = 'memberlist_view.html';
|
||||
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
// Send an email
|
||||
|
@ -1136,7 +1138,6 @@ switch ($mode)
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
// Output the page
|
||||
page_header($page_title);
|
||||
|
||||
|
|
|
@ -16,11 +16,12 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
|
|||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
include($phpbb_root_path . 'includes/message_parser.'.$phpEx);
|
||||
|
||||
|
||||
// Start session management
|
||||
$user->start();
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
|
||||
|
||||
|
@ -915,7 +916,6 @@ if (!sizeof($error) && $preview)
|
|||
// Attachment Preview
|
||||
if (sizeof($message_parser->attachment_data))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
$extensions = $update_count = array();
|
||||
|
||||
$template->assign_var('S_HAS_ATTACHMENTS', true);
|
||||
|
@ -1631,15 +1631,18 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
|||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$sql_insert_ary = array()
|
||||
for ($i = 0, $size = sizeof($poll['poll_options']); $i < $size; $i++)
|
||||
{
|
||||
if (trim($poll['poll_options'][$i]))
|
||||
{
|
||||
if (!$cur_poll_options[$i])
|
||||
{
|
||||
$sql = 'INSERT INTO ' . POLL_OPTIONS_TABLE . " (poll_option_id, topic_id, poll_option_text)
|
||||
VALUES ($i, " . $data['topic_id'] . ", '" . $db->sql_escape($poll['poll_options'][$i]) . "')";
|
||||
$db->sql_query($sql);
|
||||
$sql_insert_ary[] = array(
|
||||
'poll_option_id' => (int) $i,
|
||||
'topic_id' => (int) $data['topic_id'],
|
||||
'poll_option_text' => (string) $poll['poll_options'][$i]
|
||||
);
|
||||
}
|
||||
else if ($poll['poll_options'][$i] != $cur_poll_options[$i])
|
||||
{
|
||||
|
@ -1652,6 +1655,25 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
|||
}
|
||||
}
|
||||
|
||||
if (sizeof($sql_insert_ary))
|
||||
{
|
||||
switch (SQL_LAYER)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
$db->sql_query('INSERT INTO ' . POLL_OPTIONS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_insert_ary);
|
||||
break;
|
||||
|
||||
default:
|
||||
foreach ($sql_insert_ary as $ary)
|
||||
{
|
||||
$db->sql_query('INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_insert_ary));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($poll['poll_options']) < sizeof($cur_poll_options))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . '
|
||||
|
|
|
@ -17,7 +17,7 @@ include($phpbb_root_path . 'common.'.$phpEx);
|
|||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
|
||||
// Start session
|
||||
$user->start();
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
|
||||
// Start initial var setup
|
||||
|
@ -282,7 +282,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)
|
|||
|
||||
// Grab icons
|
||||
$icons = array();
|
||||
obtain_icons($icons);
|
||||
$cache->obtain_icons($icons);
|
||||
|
||||
// Grab all topic data
|
||||
$rowset = $announcement_list = $topic_list = array();
|
||||
|
|
|
@ -16,7 +16,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
|
|||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
// Start session management
|
||||
$user->start();
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
$user->setup();
|
||||
|
||||
|
|
|
@ -14,9 +14,10 @@ define('IN_PHPBB', true);
|
|||
$phpbb_root_path = './';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
|
||||
// Start session management
|
||||
$user->start();
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
|
||||
// Initial var setup
|
||||
|
@ -381,17 +382,17 @@ if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('b
|
|||
|
||||
// Grab ranks
|
||||
$ranks = array();
|
||||
obtain_ranks($ranks);
|
||||
$cache->obtain_ranks($ranks);
|
||||
|
||||
// Grab icons
|
||||
$icons = array();
|
||||
obtain_icons($icons);
|
||||
$cache->obtain_icons($icons);
|
||||
|
||||
// Grab extensions
|
||||
$extensions = array();
|
||||
if ($topic_attachment)
|
||||
{
|
||||
obtain_attach_extensions($extensions);
|
||||
$cache->obtain_attach_extensions($extensions);
|
||||
}
|
||||
|
||||
// Forum rules listing
|
||||
|
@ -974,8 +975,6 @@ if (sizeof($attach_list))
|
|||
{
|
||||
if ($auth->acl_gets('f_download', 'u_download', $forum_id))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE post_msg_id IN (' . implode(', ', $attach_list) . ')
|
||||
|
@ -1247,7 +1246,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
|
|||
|
||||
'U_PROFILE' => $user_cache[$poster_id]['profile'],
|
||||
'U_SEARCH' => $user_cache[$poster_id]['search'],
|
||||
'U_PM' => ($poster_id != ANONYMOUS) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose&action=quote&q=1&p=" . $row['post_id'] : '',
|
||||
'U_PM' => ($poster_id != ANONYMOUS) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose&action=quotepost&p=" . $row['post_id'] : '',
|
||||
'U_EMAIL' => $user_cache[$poster_id]['email'],
|
||||
'U_WWW' => $user_cache[$poster_id]['www'],
|
||||
'U_ICQ' => $user_cache[$poster_id]['icq'],
|
||||
|
|
Loading…
Add table
Reference in a new issue