|
From: Paul S. O. <ps...@us...> - 2002-04-20 00:22:32
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv5403/includes
Modified Files:
bbcode.php emailer.php functions.php functions_post.php
functions_search.php functions_validate.php page_header.php
sessions.php usercp_avatar.php usercp_email.php
usercp_register.php
Log Message:
merged from 2.0.0 branch (marked merge_point_20020420) + assorted updates and trial stuff for example session alterations
Index: bbcode.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/bbcode.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** bbcode.php 25 Mar 2002 12:41:41 -0000 1.36
--- bbcode.php 20 Apr 2002 00:22:28 -0000 1.37
***************
*** 252,256 ****
$text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, '');
! $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\".*?\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]");
// [list] and [list=x] for (un)ordered lists.
--- 252,256 ----
$text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, '');
! $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\"[^"]*?\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]");
// [list] and [list=x] for (un)ordered lists.
***************
*** 434,438 ****
$match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index);
bbcode_array_push($stack, $match);
! ++$curr_pos;
}
else
--- 434,444 ----
$match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index);
bbcode_array_push($stack, $match);
! //
! // Rather than just increment $curr_pos
! // Set it to the ending of the tag we just found
! // Keeps error in nested tag from breaking out
! // of table structure..
! //
! $curr_pos = $curr_pos + strlen($possible_start);
}
else
Index: emailer.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/emailer.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** emailer.php 22 Mar 2002 19:33:28 -0000 1.15
--- emailer.php 20 Apr 2002 00:22:28 -0000 1.16
***************
*** 179,193 ****
function send()
{
! global $phpEx, $phpbb_root_dir;
!
! if (isset($phpbb_root_dir))
! {
! // we must be in the admin section.
! $phpbb_root_path = $phpbb_root_dir;
! }
! else
! {
! $phpbb_root_path = "./";
! }
if ($this->address == NULL)
--- 179,183 ----
function send()
{
! global $phpEx, $phpbb_root_path;
if ($this->address == NULL)
Index: functions.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions.php,v
retrieving revision 1.133
retrieving revision 1.134
diff -C2 -r1.133 -r1.134
*** functions.php 2 Apr 2002 14:02:27 -0000 1.133
--- functions.php 20 Apr 2002 00:22:28 -0000 1.134
***************
*** 492,496 ****
function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')
{
! global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links;
global $userdata, $user_ip, $session_length;
global $starttime;
--- 492,496 ----
function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')
{
! global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header;
global $userdata, $user_ip, $session_length;
global $starttime;
Index: functions_post.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_post.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** functions_post.php 3 Apr 2002 14:38:56 -0000 1.9
--- functions_post.php 20 Apr 2002 00:22:28 -0000 1.10
***************
*** 23,27 ****
if ( !defined('IN_PHPBB') )
{
! die("Hacking attempt");
}
--- 23,27 ----
if ( !defined('IN_PHPBB') )
{
! die('Hacking attempt');
}
***************
*** 381,385 ****
global $db;
! $sign = ( $mode == 'delete' ) ? "- 1" : "+ 1";
$forum_update_sql = "forum_posts = forum_posts $sign";
$topic_update_sql = '';
--- 381,385 ----
global $db;
! $sign = ( $mode == 'delete' ) ? '- 1' : '+ 1';
$forum_update_sql = "forum_posts = forum_posts $sign";
$topic_update_sql = '';
***************
*** 396,400 ****
{
! $topic_update_sql = "topic_replies = topic_replies - 1";
$sql = "SELECT MAX(post_id) AS post_id
--- 396,400 ----
{
! $topic_update_sql .= "topic_replies = topic_replies - 1";
$sql = "SELECT MAX(post_id) AS post_id
***************
*** 440,445 ****
if ( $row = $db->sql_fetchrow($result) )
{
! $topic_update_sql = 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['post_id'];
}
}
}
--- 440,449 ----
if ( $row = $db->sql_fetchrow($result) )
{
! $topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['post_id'];
}
+ }
+ else
+ {
+ $topic_update_sql .= 'topic_replies = topic_replies - 1';
}
}
Index: functions_search.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_search.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** functions_search.php 2 Apr 2002 14:03:49 -0000 1.8
--- functions_search.php 20 Apr 2002 00:22:28 -0000 1.9
***************
*** 429,433 ****
{
global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
! global $starttime;
$username_list = '';
--- 429,435 ----
{
global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
! global $starttime, $gen_simple_header;
!
! $gen_simple_header = TRUE;
$username_list = '';
***************
*** 460,464 ****
}
- $gen_simple_header = TRUE;
$page_title = $lang['Search'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
--- 462,465 ----
Index: functions_validate.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_validate.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** functions_validate.php 2 Apr 2002 21:13:47 -0000 1.6
--- functions_validate.php 20 Apr 2002 00:22:29 -0000 1.7
***************
*** 64,68 ****
while( $row = $db->sql_fetchrow($result) )
{
! if ( preg_match("#\b(" . str_replace("\*", "\w*?", preg_quote($row['disallow_username'])) . ")\b#i", $username) )
{
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
--- 64,68 ----
while( $row = $db->sql_fetchrow($result) )
{
! if ( preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['disallow_username'])) . ")\b#i", $username) )
{
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
***************
*** 77,81 ****
while( $row = $db->sql_fetchrow($result) )
{
! if ( preg_match("#\b(" . str_replace("\*", "\w*?", preg_quote($row['word'])) . ")\b#i", $username) )
{
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
--- 77,81 ----
while( $row = $db->sql_fetchrow($result) )
{
! if ( preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['word'])) . ")\b#i", $username) )
{
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
***************
*** 103,107 ****
if ( $email != '' )
{
! if ( preg_match('/^[a-z0-9\.\-_]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email) )
{
$sql = "SELECT ban_email
--- 103,107 ----
if ( $email != '' )
{
! if ( preg_match('/^[a-z0-9\.\-_\+]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email) )
{
$sql = "SELECT ban_email
***************
*** 111,115 ****
while( $row = $db->sql_fetchrow($result) )
{
! $match_email = str_replace('*', '.*', $row['ban_email']);
if ( preg_match('/^' . $match_email . '$/is', $email) )
{
--- 111,115 ----
while( $row = $db->sql_fetchrow($result) )
{
! $match_email = str_replace('*', '.*?', $row['ban_email']);
if ( preg_match('/^' . $match_email . '$/is', $email) )
{
Index: page_header.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/page_header.php,v
retrieving revision 1.106
retrieving revision 1.107
diff -C2 -r1.106 -r1.107
*** page_header.php 1 Apr 2002 13:23:42 -0000 1.106
--- page_header.php 20 Apr 2002 00:22:29 -0000 1.107
***************
*** 86,96 ****
// situation
//
! $user_forum_sql = ( !empty($forum_id) ) ? "AND ( u.user_session_page = $forum_id
! OR s.session_page = $forum_id)" : '';
$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
! AND ( s.session_time >= ".( time() - 300 ) . "
! OR u.user_session_time >= " . ( time() - 300 ) . " )
$user_forum_sql
ORDER BY u.username ASC, s.session_ip ASC";
--- 86,94 ----
// situation
//
! $user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = $forum_id" : '';
$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
! AND s.session_time >= ".( time() - 300 ) . "
$user_forum_sql
ORDER BY u.username ASC, s.session_ip ASC";
***************
*** 365,368 ****
--- 363,368 ----
'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),
+ 'L_WHOSONLINE_USER' => sprintf($lang['User_online_color'], '<span style="color:#' . $theme['fontcolor1'] . '">', '</span>'),
+ 'L_LEGEND' => $lang['Legend'],
'U_SEARCH_UNANSWERED' => append_sid('search.'.$phpEx.'?search_id=unanswered'),
***************
*** 387,391 ****
'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
! 'S_TIMEZONE' => sprintf($lang['All_times'], $lang[$board_config['board_timezone']]),
'S_LOGIN_ACTION' => append_sid('login.'.$phpEx),
--- 387,391 ----
'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
! 'S_TIMEZONE' => sprintf($lang['All_times'], $lang[number_format($board_config['board_timezone'])]),
'S_LOGIN_ACTION' => append_sid('login.'.$phpEx),
Index: sessions.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/sessions.php,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -r1.58 -r1.59
*** sessions.php 19 Mar 2002 11:59:36 -0000 1.58
--- sessions.php 20 Apr 2002 00:22:29 -0000 1.59
***************
*** 22,27 ****
//
- // session_begin()
- //
// Adds/updates a new session to the database for the given userid.
// Returns the new session ID on success.
--- 22,25 ----
***************
*** 55,60 ****
//
! // Try and pull the last time stored
! // in a cookie, if it exists
//
$sql = "SELECT *
--- 53,57 ----
//
! // Try and pull the last time stored in a cookie, if it exists
//
$sql = "SELECT *
***************
*** 82,87 ****
$login = 1;
$enable_autologin = 1;
-
- $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;
}
else
--- 79,82 ----
***************
*** 103,107 ****
else
{
- $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;
$login = 1;
}
--- 98,101 ----
***************
*** 147,151 ****
WHERE session_id = '" . $session_id . "'
AND session_ip = '$user_ip'";
! if ( !($result = $db->sql_query($sql)) || !$db->sql_affectedrows() )
{
$session_id = md5(uniqid($user_ip));
--- 141,145 ----
WHERE session_id = '" . $session_id . "'
AND session_ip = '$user_ip'";
! if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )
{
$session_id = md5(uniqid($user_ip));
***************
*** 154,165 ****
(session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in)
VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login)";
! if ( !($result = $db->sql_query($sql)) )
{
! message_die(CRITICAL_ERROR, 'Error creating new session : session_begin', '', __LINE__, __FILE__, $sql);
}
}
if ( $user_id != ANONYMOUS )
! {
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit
--- 148,161 ----
(session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in)
VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login)";
! if ( !$db->sql_query($sql) )
{
! message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);
}
}
if ( $user_id != ANONYMOUS )
! {// ( $userdata['user_session_time'] > $expiry_time && $auto_create ) ? $userdata['user_lastvisit'] : (
! $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;
!
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit
***************
*** 167,171 ****
if ( !$db->sql_query($sql) )
{
! message_die(CRITICAL_ERROR, 'Error updating last visit time : session_begin', '', __LINE__, __FILE__, $sql);
}
--- 163,167 ----
if ( !$db->sql_query($sql) )
{
! message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);
}
***************
*** 186,191 ****
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
- // header('Set-cookie: ' . $cookiename . '_data=' . urlencode(serialize($sessiondata)) . '; expires=' . gmdate("l, d-M-Y H:i:s", $current_time + 31536000) . ' GMT; domain=' . $cookiedomain . '; path=' . $cookiepath . $cookiesecure);
- // header('Set-cookie: ' . $cookiename . '_sid=' . $session_id . '; domain=' . $cookiedomain . '; path=' . $cookiepath . $cookiesecure);
$SID = ( $sessionmethod == SESSION_METHOD_GET ) ? 'sid=' . $session_id : '';
--- 182,185 ----
***************
*** 195,200 ****
//
! // Checks for a given user session, tidies session
! // table and updates user sessions at each page refresh
//
function session_pagestart($user_ip, $thispage_id)
--- 189,194 ----
//
! // Checks for a given user session, tidies session table and updates user
! // sessions at each page refresh
//
function session_pagestart($user_ip, $thispage_id)
***************
*** 207,211 ****
$cookiedomain = $board_config['cookie_domain'];
$cookiesecure = $board_config['cookie_secure'];
- $cookiesecure = ( $board_config['cookie_secure'] ) ? '; secure' : '';
$current_time = time();
--- 201,204 ----
***************
*** 241,245 ****
if ( !($result = $db->sql_query($sql)) )
{
! message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch : session_pagestart', '', __LINE__, __FILE__, $sql);
}
--- 234,238 ----
if ( !($result = $db->sql_query($sql)) )
{
! message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);
}
***************
*** 256,285 ****
// Only update session DB a minute or so after last update
//
! $last_update = ( $userdata['user_id'] == ANONYMOUS ) ? $userdata['session_time'] : $userdata['user_session_time'];
!
! if ( $current_time - $last_update > 60 )
! { // || $userdata['user_session_page'] != $thispage_id
! $sql = ( $userdata['user_id'] == ANONYMOUS ) ? "UPDATE " . SESSIONS_TABLE . " SET session_time = $current_time, session_page = $thispage_id WHERE session_id = '" . $userdata['session_id'] . "' AND session_ip = '$user_ip'" : "UPDATE " . USERS_TABLE . " SET user_session_time = $current_time, user_session_page = $thispage_id WHERE user_id = " . $userdata['user_id'];
if ( !$db->sql_query($sql) )
{
! message_die(CRITICAL_ERROR, 'Error updating sessions table : session_pagestart', '', __LINE__, __FILE__, $sql);
}
! //
! // Delete expired sessions
! //
! $expiry_time = $current_time - $board_config['session_length'];
! $sql = "DELETE FROM " . SESSIONS_TABLE . "
! WHERE session_time < $expiry_time
! AND session_id <> '$session_id'";
! if ( !($result = $db->sql_query($sql)) )
{
! message_die(CRITICAL_ERROR, 'Error clearing sessions table : session_pagestart', '', __LINE__, __FILE__, $sql);
}
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
- // header('Set-cookie: ' . $cookiename . '_data=' . urlencode(serialize($sessiondata)) . '; expires=' . gmdate("l, d-M-Y H:i:s", $current_time + 31536000) . ' GMT; domain=' . $cookiedomain . '; path=' . $cookiepath . $cookiesecure);
- // header('Set-cookie: ' . $cookiename . '_sid=' . $session_id . '; domain=' . $cookiedomain . '; path=' . $cookiepath . $cookiesecure);
}
--- 249,312 ----
// Only update session DB a minute or so after last update
//
! if ( $current_time - $userdata['session_time'] > 60 || $userdata['session_page'] != $thispage_id )
! {
! $sql = "UPDATE " . SESSIONS_TABLE . "
! SET session_time = $current_time, session_page = $thispage_id
! WHERE session_id = '" . $userdata['session_id'] . "'
! AND session_ip = '$user_ip'";
if ( !$db->sql_query($sql) )
{
! message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
}
! if ( $current_time - $board_config['session_gc'] > $board_config['session_last_gc'] )
{
! $sql = "SELECT *
! FROM " . SESSIONS_TABLE . "
! WHERE session_time < " . ( $current_time - $board_config['session_length'] ) . "
! AND session_logged_in = 1";
! if ( !($result = $db->sql_query($sql)) )
! {
! message_die(CRITICAL_ERROR, 'Could not obtain expired session list', '', __LINE__, __FILE__, $sql);
! }
!
! $del_session_id = '';
! while ( $row = $db->sql_fetchrow($result) )
! {
! $sql = "UPDATE " . USERS_TABLE . "
! SET user_lastvisit = " . $row['session_time'] . ", user_session_page = " . $row['session_page'] . "
! WHERE user_id = " . $row['session_user_id'];
! if ( !$db->sql_query($sql) )
! {
! message_die(CRITICAL_ERROR, 'Could not update user session info', '', __LINE__, __FILE__, $sql);
! }
!
! $del_session_id .= ( ( $del_session_id != '' ) ? ', ' : '' ) . '\'' . $row['session_id'] . '\'';
! }
!
! if ( $del_session_id != '' )
! {
! //
! // Delete expired sessions
! //
! $sql = "DELETE FROM " . SESSIONS_TABLE . "
! WHERE session_id IN ($del_session_id)";
! if ( !$db->sql_query($sql) )
! {
! message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql);
! }
! }
!
! echo $sql = "UPDATE " . CONFIG_TABLE . "
! SET config_value = '$current_time'
! WHERE config_name = 'session_last_gc'";
! if ( !$db->sql_query($sql) )
! {
! message_die(CRITICAL_ERROR, 'Could not update session gc time', '', __LINE__, __FILE__, $sql);
! }
}
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
}
***************
*** 296,300 ****
if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )
{
! message_die(CRITICAL_ERROR, 'Error creating user session : session_pagestart', '', __LINE__, __FILE__, $sql);
}
--- 323,327 ----
if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )
{
! message_die(CRITICAL_ERROR, 'Error creating user session', '', __LINE__, __FILE__, $sql);
}
***************
*** 317,321 ****
$cookiedomain = $board_config['cookie_domain'];
$cookiesecure = $board_config['cookie_secure'];
- // $cookiesecure = ( $board_config['cookie_secure'] ) ? '; secure' : '';
//
--- 344,347 ----
***************
*** 325,334 ****
{
$session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
- $sessionmethod = SESSION_METHOD_COOKIE;
}
else
{
$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
- $sessionmethod = SESSION_METHOD_GET;
}
--- 351,358 ----
***************
*** 339,363 ****
WHERE session_id = '$session_id'
AND session_user_id = $user_id";
! if ( !($result = $db->sql_query($sql)) )
{
! message_die(CRITICAL_ERROR, 'Error removing user session : session_end', '', __LINE__, __FILE__, $sql);
}
setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
- // header('Set-cookie: ' . $cookiename . '_data=0; expires=' . gmdate("l, d-M-Y H:i:s", 0) . ' GMT; domain=' . $cookiedomain . '; path=' . $cookiepath. $cookiesecure);
- // header('Set-cookie: ' . $cookiename . '_sid=0; expires=' . gmdate("l, d-M-Y H:i:s", 0) . ' GMT; domain=' . $cookiedomain . '; path=' . $cookiepath . $cookiesecure);
-
- $SID = ( $sessionmethod == SESSION_METHOD_GET ) ? 'sid=' . $session_id : '';
-
- return TRUE;
}
//
! // Append $SID to a url. Borrowed from phplib and modified. This is an
! // extra routine utilised by the session code above and acts as a wrapper
! // around every single URL and form action. If you replace the session
! // code you must include this routine, even if it's empty.
//
function append_sid($url, $non_html_amp = false)
--- 363,379 ----
WHERE session_id = '$session_id'
AND session_user_id = $user_id";
! if ( !$db->sql_query($sql) )
{
! message_die(CRITICAL_ERROR, 'Error removing user session', '', __LINE__, __FILE__, $sql);
}
setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
+ return true;
}
//
! // Append $SID to a url. Borrowed from phplib and modified.
//
function append_sid($url, $non_html_amp = false)
***************
*** 373,375 ****
}
! ?>
--- 389,391 ----
}
! ?>
\ No newline at end of file
Index: usercp_avatar.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/usercp_avatar.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** usercp_avatar.php 31 Mar 2002 00:06:34 -0000 1.8
--- usercp_avatar.php 20 Apr 2002 00:22:29 -0000 1.9
***************
*** 234,238 ****
}
! function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popuppm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$allowviewonline, &$style, &$language, &$timezone, &$dateformat)
{
global $board_config, $db, $template, $lang, $images, $theme;
--- 234,238 ----
}
! function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popuppm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$timezone, &$dateformat)
{
global $board_config, $db, $template, $lang, $images, $theme;
***************
*** 310,314 ****
}
! $params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popuppm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'allowviewonline', 'style', 'language', 'timezone', 'dateformat');
$s_hidden_vars = '<input type="hidden" name="agreed" value="true" />';
--- 310,314 ----
}
! $params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popuppm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat');
$s_hidden_vars = '<input type="hidden" name="agreed" value="true" />';
***************
*** 334,336 ****
}
! ?>
--- 334,336 ----
}
! ?>
\ No newline at end of file
Index: usercp_email.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/usercp_email.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** usercp_email.php 31 Mar 2002 00:06:34 -0000 1.7
--- usercp_email.php 20 Apr 2002 00:22:29 -0000 1.8
***************
*** 28,37 ****
}
- if ( !$userdata['session_logged_in'] )
- {
- header('Location: ' . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=email&" . POST_USERS_URL . "=$user_id", true));
- exit;
- }
-
if ( !empty($HTTP_GET_VARS[POST_USERS_URL]) || !empty($HTTP_POST_VARS[POST_USERS_URL]) )
{
--- 28,31 ----
***************
*** 41,44 ****
--- 35,44 ----
{
message_die(GENERAL_MESSAGE, $lang['No_user_specified']);
+ }
+
+ if ( !$userdata['session_logged_in'] )
+ {
+ header('Location: ' . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=email&" . POST_USERS_URL . "=$user_id", true));
+ exit;
}
Index: usercp_register.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/usercp_register.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** usercp_register.php 3 Apr 2002 23:24:59 -0000 1.20
--- usercp_register.php 20 Apr 2002 00:22:29 -0000 1.21
***************
*** 28,36 ****
}
! //
// Load agreement template since user has not yet
// agreed to registration conditions/coppa
//
! function show_coppa(&$coppa)
{
global $template, $lang, $phpbb_root_path, $phpEx;
--- 28,36 ----
}
! // ---------------------------------------
// Load agreement template since user has not yet
// agreed to registration conditions/coppa
//
! function show_coppa()
{
global $template, $lang, $phpbb_root_path, $phpEx;
***************
*** 41,45 ****
$template->assign_vars(array(
- 'COPPA' => $coppa,
'REGISTRATION' => $lang['Registration'],
'AGREEMENT' => $lang['Reg_agreement'],
--- 41,44 ----
***************
*** 56,61 ****
}
//
! //
! //
$error = FALSE;
--- 55,59 ----
}
//
! // ---------------------------------------
$error = FALSE;
***************
*** 66,75 ****
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
! show_coppa($coppa);
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
! $coppa = ( ( !$HTTP_POST_VARS['coppa'] && !$HTTP_GET_VARS['coppa'] ) || $mode == 'register' ) ? 0 : TRUE;
//
--- 64,73 ----
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
! show_coppa();
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
! $coppa = ( empty($HTTP_POST_VARS['coppa']) && empty($HTTP_GET_VARS['coppa']) ) ? 0 : TRUE;
//
***************
*** 224,229 ****
else if ( $mode == 'register' )
{
- $coppa = (!$HTTP_POST_VARS['coppa'] && !$HTTP_GET_VARS['coppa']) ? 0 : TRUE;
-
if ( empty($username) || empty($password) || empty($password_confirm) || empty($email) )
{
--- 222,225 ----
***************
*** 231,235 ****
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
}
!
}
--- 227,231 ----
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
}
!
}
***************
*** 708,711 ****
--- 704,709 ----
);
+ $allowviewonline = !$allowviewonline;
+
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popuppm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat);
}
***************
*** 788,792 ****
//
$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
! $form_enctype = ( !@$ini_val('file_uploads') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';
$template->assign_vars(array(
--- 786,790 ----
//
$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
! $form_enctype = ( @$ini_val('file_uploads') == '0' || strtolower(@$ini_val('file_uploads') == 'off') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';
$template->assign_vars(array(
|