From 8ac06a256b841d2249264ce9ac67885b9849d80f Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 7 Sep 2003 13:46:51 +0000 Subject: Updates mainly for removal of extension + header comment ... moved some aspects of ucp around, further work to be done on these areas ... not commiting search for time being git-svn-id: file:///svn/phpbb/trunk@4473 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/common.php | 33 +- phpBB/download.php | 196 +++++----- phpBB/faq.php | 34 +- phpBB/groupcp.php | 428 +++++++++------------ phpBB/includes/functions.php | 29 +- phpBB/includes/functions_user.php | 135 +++++++ phpBB/includes/session.php | 13 +- phpBB/includes/ucp/ucp_main.php | 4 +- phpBB/includes/ucp/ucp_prefs.php | 28 +- phpBB/includes/ucp/ucp_profile.php | 43 ++- phpBB/includes/ucp/ucp_register.php | 16 +- phpBB/index.php | 32 +- phpBB/install/schemas/schema_data.sql | 15 + phpBB/language/en/lang_admin.php | 104 +++-- phpBB/language/en/lang_main.php | 75 ++-- phpBB/language/en/search_stopwords.txt | 2 +- phpBB/mcp.php | 32 +- phpBB/memberlist.php | 35 +- phpBB/posting.php | 2 +- phpBB/report.php | 35 +- phpBB/style.php | 32 +- phpBB/styles/subSilver/template/index_body.html | 2 +- .../styles/subSilver/template/overall_header.html | 2 +- phpBB/styles/subSilver/template/ucp_profile.html | 2 +- .../styles/subSilver/template/viewforum_body.html | 4 +- .../styles/subSilver/template/viewtopic_body.html | 108 +++--- phpBB/ucp.php | 167 +------- phpBB/viewtopic.php | 58 +-- 28 files changed, 784 insertions(+), 882 deletions(-) diff --git a/phpBB/common.php b/phpBB/common.php index 2e24daf45c..c1b4da0a32 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -1,23 +1,15 @@ lang['ERROR_NO_ATTACHMENT'] . '

' . sprintf($user->lang['FILE_NOT_FOUND_404'], $filename)); - } - - // Determine the Browser the User is using, because of some nasty incompatibilities. - // borrowed from phpMyAdmin. :) - if (!empty($_SERVER['HTTP_USER_AGENT'])) - { - $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; - } - else if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) - { - $HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT']; - } - else if (!isset($HTTP_USER_AGENT)) - { - $HTTP_USER_AGENT = ''; - } - - if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) - { - $browser_version = $log_version[2]; - $browser_agent = 'opera'; - } - else if (ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) - { - $browser_version = $log_version[1]; - $browser_agent = 'ie'; - } - else if (ereg('OmniWeb/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) - { - $browser_version = $log_version[1]; - $browser_agent = 'omniweb'; - } - else if (ereg('Netscape([0-9]{1})', $HTTP_USER_AGENT, $log_version)) - { - $browser_version = $log_version[1]; - $browser_agent = 'netscape'; - } - else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) - { - $browser_version = $log_version[1]; - $browser_agent = 'mozilla'; - } - else if (ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) - { - $browser_version = $log_version[1]; - $browser_agent = 'konqueror'; - } - else - { - $browser_version = 0; - $browser_agent = 'other'; - } - - // Correct the mime type - we force application/octetstream for all files, except images - // Please do not change this, it is a security precaution - if ($category == NONE_CAT && !strstr($attachment['mimetype'], 'image')) - { - $attachment['mimetype'] = ($browser_agent == 'ie' || $browser_agent == 'opera') ? 'application/octetstream' : 'application/octet-stream'; - } - - // Now the tricky part... let's dance - @ob_end_clean(); - @ini_set('zlib.output_compression', 'Off'); - header('Pragma: public'); - header('Content-Transfer-Encoding: none'); - - // Send out the Headers - header('Content-Type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"'); - header('Content-Disposition: inline; filename="' . $attachment['real_filename'] . '"'); - - // Now send the File Contents to the Browser - $size = @filesize($filename); - if ($size) - { - header("Content-length: $size"); - } - readfile($filename); - - exit; -} - // Start session management $user->start(); $auth->acl($user->data); @@ -221,4 +125,102 @@ else exit; } + +// --------- +// FUNCTIONS +// + +function send_file_to_browser($attachment, $upload_dir, $category) +{ + global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS, $user, $db, $config; + + $filename = ($upload_dir == '') ? $attachment['physical_filename'] : $upload_dir . '/' . $attachment['physical_filename']; + + if (!file_exists($filename)) + { + trigger_error($user->lang['ERROR_NO_ATTACHMENT'] . '

' . sprintf($user->lang['FILE_NOT_FOUND_404'], $filename)); + } + + // Determine the Browser the User is using, because of some nasty incompatibilities. + // borrowed from phpMyAdmin. :) + if (!empty($_SERVER['HTTP_USER_AGENT'])) + { + $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; + } + else if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) + { + $HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT']; + } + else if (!isset($HTTP_USER_AGENT)) + { + $HTTP_USER_AGENT = ''; + } + + if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) + { + $browser_version = $log_version[2]; + $browser_agent = 'opera'; + } + else if (ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) + { + $browser_version = $log_version[1]; + $browser_agent = 'ie'; + } + else if (ereg('OmniWeb/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) + { + $browser_version = $log_version[1]; + $browser_agent = 'omniweb'; + } + else if (ereg('Netscape([0-9]{1})', $HTTP_USER_AGENT, $log_version)) + { + $browser_version = $log_version[1]; + $browser_agent = 'netscape'; + } + else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) + { + $browser_version = $log_version[1]; + $browser_agent = 'mozilla'; + } + else if (ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) + { + $browser_version = $log_version[1]; + $browser_agent = 'konqueror'; + } + else + { + $browser_version = 0; + $browser_agent = 'other'; + } + + // Correct the mime type - we force application/octetstream for all files, except images + // Please do not change this, it is a security precaution + if ($category == NONE_CAT && !strstr($attachment['mimetype'], 'image')) + { + $attachment['mimetype'] = ($browser_agent == 'ie' || $browser_agent == 'opera') ? 'application/octetstream' : 'application/octet-stream'; + } + + // Now the tricky part... let's dance + @ob_end_clean(); + @ini_set('zlib.output_compression', 'Off'); + header('Pragma: public'); + header('Content-Transfer-Encoding: none'); + + // Send out the Headers + header('Content-Type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"'); + header('Content-Disposition: inline; filename="' . $attachment['real_filename'] . '"'); + + // Now send the File Contents to the Browser + $size = @filesize($filename); + if ($size) + { + header("Content-length: $size"); + } + readfile($filename); + + exit; +} +// +// FUNCTIONS +// --------- + ?> \ No newline at end of file diff --git a/phpBB/faq.php b/phpBB/faq.php index 02a6107ee5..c5633f3be6 100644 --- a/phpBB/faq.php +++ b/phpBB/faq.php @@ -1,36 +1,26 @@ start(); $auth->acl($user->data); - $user->setup(); - // Load the appropriate faq file if (isset($_GET['mode'])) { diff --git a/phpBB/groupcp.php b/phpBB/groupcp.php index 3dc47c76fa..82a6c6c557 100644 --- a/phpBB/groupcp.php +++ b/phpBB/groupcp.php @@ -1,153 +1,38 @@ ' : ''; - break; - case USER_AVATAR_REMOTE: - $poster_avatar = ( $config['allow_avatar_remote'] ) ? '' : ''; - break; - case USER_AVATAR_GALLERY: - $poster_avatar = ( $config['allow_avatar_local'] ) ? '' : ''; - break; - } - } - - if ( !empty($row['user_viewemail']) || $group_mod ) - { - $email_uri = ( $config['board_email_form'] ) ? append_sid("ucp.$phpEx?mode=email&" . POST_USERS_URL .'=' . $row['user_id']) : 'mailto:' . $row['user_email']; - - $email_img = '' . $lang['Send_email'] . ''; - $email = '' . $lang['Send_email'] . ''; - } - else - { - $email_img = ' '; - $email = ' '; - } - - $temp_url = append_sid("ucp.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']); - $profile_img = '' . $lang['Read_profile'] . ''; - $profile = '' . $lang['Read_profile'] . ''; - - $temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $row['user_id']); - $pm_img = '' . $lang['Send_private_message'] . ''; - $pm = '' . $lang['Send_private_message'] . ''; - - $www_img = ( $row['user_website'] ) ? '' . $lang['Visit_website'] . '' : ''; - $www = ( $row['user_website'] ) ? '' . $lang['Visit_website'] . '' : ''; - - if ( !empty($row['user_icq']) ) - { - $icq_status_img = ''; - $icq_img = '' . $lang['ICQ'] . ''; - $icq = '' . $lang['ICQ'] . ''; - } - else - { - $icq_status_img = ''; - $icq_img = ''; - $icq = ''; - } - - $aim_img = ( $row['user_aim'] ) ? '' . $lang['AIM'] . '' : ''; - $aim = ( $row['user_aim'] ) ? '' . $lang['AIM'] . '' : ''; - - $temp_url = append_sid("ucp.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']); - $msn_img = ( $row['user_msnm'] ) ? '' . $lang['MSNM'] . '' : ''; - $msn = ( $row['user_msnm'] ) ? '' . $lang['MSNM'] . '' : ''; - - $yim_img = ( $row['user_yim'] ) ? '' . $lang['YIM'] . '' : ''; - $yim = ( $row['user_yim'] ) ? '' . $lang['YIM'] . '' : ''; - - $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username) . "&showresults=posts"); - $search_img = '' . $lang['Search_user_posts'] . ''; - $search = '' . $lang['Search_user_posts'] . ''; - - return; -} -// -// -------------------------- - -// // Start session management -// $user->start(); -$user->setup(); $auth->acl($user->data); -// -// End session management -// - -$script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($config['script_path'])); -$script_name = ( $script_name != '' ) ? $script_name . '/groupcp.'.$phpEx : 'groupcp.'.$phpEx; -$server_name = trim($config['server_name']); -$server_protocol = ( $config['cookie_secure'] ) ? 'https://' : 'http://'; -$server_port = ( $config['server_port'] <> 80 ) ? ':' . trim($config['server_port']) . '/' : '/'; - -$server_url = $server_protocol . $server_name . $server_port . $script_name; - -if ( isset($_GET[POST_GROUPS_URL]) || isset($_POST[POST_GROUPS_URL]) ) -{ - $group_id = ( isset($_GET[POST_GROUPS_URL]) ) ? intval($_GET[POST_GROUPS_URL]) : intval($_POST[POST_GROUPS_URL]); -} -else -{ - $group_id = ''; -} - -if ( isset($_POST['mode']) || isset($_GET['mode']) ) -{ - $mode = ( isset($_POST['mode']) ) ? $_POST['mode'] : $_GET['mode']; -} -else -{ - $mode = ''; -} +$user->setup(); -$confirm = ( isset($_POST['confirm']) ) ? TRUE : 0; -$cancel = ( isset($_POST['cancel']) ) ? TRUE : 0; +$script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($config['script_path'])); +$script_name = ($script_name != '') ? $script_name . '/groupcp.'.$phpEx : 'groupcp.'.$phpEx; +$server_name = trim($config['server_name']); +$server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://'; +$server_port = ($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/'; +$server_url = $server_protocol . $server_name . $server_port . $script_name; -$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0; +$group_id = (isset($_REQUEST['g'])) ? intval($_REQUEST['g']) : false; +$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : false; +$confirm = (!empty($_POST['confirm'])) ? TRUE : 0; +$cancel = (!empty($_POST['cancel'])) ? TRUE : 0; +$start = (isset($_GET['start'])) ? intval($_GET['start']) : 0; // // Default var values @@ -166,7 +51,7 @@ if ( isset($_POST['groupstatus']) && $group_id ) WHERE group_id = $group_id"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql); + trigger_error('Could not obtain user and group information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); @@ -177,7 +62,7 @@ if ( isset($_POST['groupstatus']) && $group_id ) 'META' => '') ); - $message = $lang['Not_group_moderator'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); + $message = $lang['Not_group_moderator'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); message_die(MESSAGE, $message); } @@ -187,14 +72,14 @@ if ( isset($_POST['groupstatus']) && $group_id ) WHERE group_id = $group_id"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql); + trigger_error('Could not obtain user and group information', '', __LINE__, __FILE__, $sql); } $template->assign_vars(array( - 'META' => '') + 'META' => '') ); - $message = $lang['Group_type_updated'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); + $message = $lang['Group_type_updated'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); message_die(MESSAGE, $message); @@ -217,7 +102,7 @@ else if ( isset($_POST['joingroup']) && $group_id ) AND ug.group_id = g.group_id"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql); + trigger_error('Could not obtain user and group information', '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) @@ -232,7 +117,7 @@ else if ( isset($_POST['joingroup']) && $group_id ) 'META' => '') ); - $message = $lang['Already_member_group'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); + $message = $lang['Already_member_group'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); message_die(MESSAGE, $message); } @@ -244,7 +129,7 @@ else if ( isset($_POST['joingroup']) && $group_id ) 'META' => '') ); - $message = $lang['This_closed_group'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); + $message = $lang['This_closed_group'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); message_die(MESSAGE, $message); } @@ -258,7 +143,7 @@ else if ( isset($_POST['joingroup']) && $group_id ) VALUES ($group_id, " . $user->data['user_id'] . ", 1)"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, "Error inserting user group subscription", "", __LINE__, __FILE__, $sql); + trigger_error("Error inserting user group subscription", "", __LINE__, __FILE__, $sql); } $sql = "SELECT u.user_email, u.username, u.user_lang, g.group_name @@ -267,7 +152,7 @@ else if ( isset($_POST['joingroup']) && $group_id ) AND g.group_id = $group_id"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, "Error getting group moderator data", "", __LINE__, __FILE__, $sql); + trigger_error("Error getting group moderator data", "", __LINE__, __FILE__, $sql); } $moderator = $db->sql_fetchrow($result); @@ -287,7 +172,7 @@ else if ( isset($_POST['joingroup']) && $group_id ) 'GROUP_MODERATOR' => $moderator['username'], 'EMAIL_SIG' => str_replace('
', "\n", "-- \n" . $config['board_email_sig']), - 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id&validate=true") + 'U_GROUPCP' => $server_url . '?' . 'g' . "=$group_id&validate=true") ); $emailer->send(); $emailer->reset(); @@ -296,7 +181,7 @@ else if ( isset($_POST['joingroup']) && $group_id ) 'META' => '') ); - $message = $lang['Group_joined'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); + $message = $lang['Group_joined'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); message_die(MESSAGE, $message); } @@ -322,7 +207,7 @@ else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id ) AND group_id = $group_id"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Could not delete group memebership data', '', __LINE__, __FILE__, $sql); + trigger_error('Could not delete group memebership data', '', __LINE__, __FILE__, $sql); } if ( $user->data['user_level'] != ADMIN && $user->data['user_level'] == MOD ) @@ -334,7 +219,7 @@ else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id ) AND aa.auth_mod = 1"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Could not obtain moderator status', '', __LINE__, __FILE__, $sql); + trigger_error('Could not obtain moderator status', '', __LINE__, __FILE__, $sql); } if ( !($row = $db->sql_fetchrow($result)) ) @@ -344,7 +229,7 @@ else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id ) WHERE user_id = " . $user->data['user_id']; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql); + trigger_error('Could not update user level', '', __LINE__, __FILE__, $sql); } } } @@ -353,7 +238,7 @@ else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id ) 'META' => '') ); - $message = $lang['Usub_success'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); + $message = $lang['Usub_success'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); message_die(MESSAGE, $message); } @@ -361,10 +246,9 @@ else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id ) { $unsub_msg = ( isset($_POST['unsub']) ) ? $lang['Confirm_unsub'] : $lang['Confirm_unsub_pending']; - $s_hidden_fields = ''; + $s_hidden_fields = ''; $page_title = $lang['Group_Control_Panel']; - include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( 'confirm' => 'confirm_body.tpl') @@ -437,7 +321,7 @@ else if ( $group_id ) } if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Could not get moderator information', '', __LINE__, __FILE__, $sql); + trigger_error('Could not get moderator information', '', __LINE__, __FILE__, $sql); } if ( $group_info = $db->sql_fetchrow($result) ) @@ -479,16 +363,16 @@ else if ( $group_id ) WHERE username = '" . str_replace("\'", "''", $username) . "'"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, "Could not get user information", $lang['Error'], __LINE__, __FILE__, $sql); + trigger_error("Could not get user information", $lang['Error'], __LINE__, __FILE__, $sql); } if ( !($row = $db->sql_fetchrow($result)) ) { $template->assign_vars(array( - 'META' => '') + 'META' => '') ); - $message = $lang['Could_not_add_user'] . "

" . sprintf($lang['Click_return_group'], "", "") . "

" . sprintf($lang['Click_return_index'], "", ""); + $message = $lang['Could_not_add_user'] . "

" . sprintf($lang['Click_return_group'], "", "") . "

" . sprintf($lang['Click_return_index'], "", ""); message_die(MESSAGE, $message); } @@ -496,10 +380,10 @@ else if ( $group_id ) if ( $row['user_id'] == ANONYMOUS ) { $template->assign_vars(array( - 'META' => '') + 'META' => '') ); - $message = $lang['Could_not_anon_user'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); + $message = $lang['Could_not_anon_user'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); message_die(MESSAGE, $message); } @@ -511,7 +395,7 @@ else if ( $group_id ) AND ug.group_id = $group_id"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Could not get user information', '', __LINE__, __FILE__, $sql); + trigger_error('Could not get user information', '', __LINE__, __FILE__, $sql); } if ( !($db->sql_fetchrow($result)) ) @@ -520,7 +404,7 @@ else if ( $group_id ) VALUES (" . $row['user_id'] . ", $group_id, 0)"; if ( !$db->sql_query($sql) ) { - message_die(ERROR, 'Could not add user to group', '', __LINE__, __FILE__, $sql); + trigger_error('Could not add user to group', '', __LINE__, __FILE__, $sql); } if ( $row['user_level'] != ADMIN && $row['user_level'] != MOD && $group_info['auth_mod'] ) @@ -530,7 +414,7 @@ else if ( $group_id ) WHERE user_id = " . $row['user_id']; if ( !$db->sql_query($sql) ) { - message_die(ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql); + trigger_error('Could not update user level', '', __LINE__, __FILE__, $sql); } } @@ -543,7 +427,7 @@ else if ( $group_id ) WHERE group_id = $group_id"; if ( !($result = $db->sql_query($group_sql)) ) { - message_die(ERROR, 'Could not get group information', '', __LINE__, __FILE__, $group_sql); + trigger_error('Could not get group information', '', __LINE__, __FILE__, $group_sql); } $group_name_row = $db->sql_fetchrow($result); @@ -565,7 +449,7 @@ else if ( $group_id ) 'GROUP_NAME' => $group_name, 'EMAIL_SIG' => str_replace('
', "\n", "-- \n" . $config['board_email_sig']), - 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id") + 'U_GROUPCP' => $server_url . '?' . 'g' . "=$group_id") ); $emailer->send(); $emailer->reset(); @@ -573,10 +457,10 @@ else if ( $group_id ) else { $template->assign_vars(array( - 'META' => '') + 'META' => '') ); - $message = $lang['User_is_member_group'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); + $message = $lang['User_is_member_group'] . '

' . sprintf($lang['Click_return_group'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); message_die(MESSAGE, $message); } @@ -604,7 +488,7 @@ else if ( $group_id ) AND user_level NOT IN (" . MOD . ", " . ADMIN . ")"; if ( !$db->sql_query($sql) ) { - message_die(ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql); + trigger_error('Could not update user level', '', __LINE__, __FILE__, $sql); } } @@ -629,7 +513,7 @@ else if ( $group_id ) ORDER BY ug.user_id, ug.group_id"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Could not obtain moderator status', '', __LINE__, __FILE__, $sql); + trigger_error('Could not obtain moderator status', '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) @@ -659,7 +543,7 @@ else if ( $group_id ) AND user_level NOT IN (" . ADMIN . ")"; if ( !$db->sql_query($sql) ) { - message_die(ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql); + trigger_error('Could not update user level', '', __LINE__, __FILE__, $sql); } } } @@ -672,7 +556,7 @@ else if ( $group_id ) if ( !$db->sql_query($sql) ) { - message_die(ERROR, 'Could not update user group table', '', __LINE__, __FILE__, $sql); + trigger_error('Could not update user group table', '', __LINE__, __FILE__, $sql); } // @@ -682,7 +566,7 @@ else if ( $group_id ) { if ( !($result = $db->sql_query($sql_select)) ) { - message_die(ERROR, 'Could not get user email information', '', __LINE__, __FILE__, $sql); + trigger_error('Could not get user email information', '', __LINE__, __FILE__, $sql); } $email_addresses = ''; @@ -699,7 +583,7 @@ else if ( $group_id ) WHERE group_id = $group_id"; if ( !($result = $db->sql_query($group_sql)) ) { - message_die(ERROR, 'Could not get group information', '', __LINE__, __FILE__, $group_sql); + trigger_error('Could not get group information', '', __LINE__, __FILE__, $group_sql); } $group_name_row = $db->sql_fetchrow($result); @@ -720,7 +604,7 @@ else if ( $group_id ) 'GROUP_NAME' => $group_name, 'EMAIL_SIG' => str_replace('
', "\n", "-- \n" . $config['board_email_sig']), - 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id") + 'U_GROUPCP' => $server_url . '?' . 'g' . "=$group_id") ); $emailer->send(); $emailer->reset(); @@ -742,11 +626,10 @@ else if ( $group_id ) // $sql = "SELECT * FROM " . GROUPS_TABLE . " - WHERE group_id = $group_id - AND group_single_user = 0"; + WHERE group_id = $group_id"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Error getting group information', '', __LINE__, __FILE__, $sql); + trigger_error('Error getting group information', '', __LINE__, __FILE__, $sql); } if ( !($group_info = $db->sql_fetchrow($result)) ) @@ -762,7 +645,7 @@ else if ( $group_id ) WHERE user_id = " . $group_info['group_moderator']; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Error getting user list for group', '', __LINE__, __FILE__, $sql); + trigger_error('Error getting user list for group', '', __LINE__, __FILE__, $sql); } $group_moderator = $db->sql_fetchrow($result); @@ -779,7 +662,7 @@ else if ( $group_id ) ORDER BY u.username"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Error getting user list for group', '', __LINE__, __FILE__, $sql); + trigger_error('Error getting user list for group', '', __LINE__, __FILE__, $sql); } $group_members = $db->sql_fetchrowset($result); @@ -795,7 +678,7 @@ else if ( $group_id ) ORDER BY u.username"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Error getting user pending information', '', __LINE__, __FILE__, $sql); + trigger_error('Error getting user pending information', '', __LINE__, __FILE__, $sql); } $modgroup_pending_list = $db->sql_fetchrowset($result); @@ -837,7 +720,7 @@ else if ( $group_id ) $group_details = $lang['Are_group_moderator']; - $s_hidden_fields = ''; + $s_hidden_fields = ''; } else if ( $is_group_member || $is_group_pending_member ) { @@ -845,7 +728,7 @@ else if ( $group_id ) $group_details = ( $is_group_pending_member ) ? $lang['Pending_this_group'] : $lang['Member_this_group']; - $s_hidden_fields = ''; + $s_hidden_fields = ''; } else if ( $user->data['user_id'] == ANONYMOUS ) { @@ -859,7 +742,7 @@ else if ( $group_id ) $template->assign_block_vars('switch_subscribe_group_input', array()); $group_details = $lang['This_open_group']; - $s_hidden_fields = ''; + $s_hidden_fields = ''; } else if ( $group_info['group_type'] == GROUP_CLOSED ) { @@ -874,7 +757,6 @@ else if ( $group_id ) } $page_title = $lang['Group_Control_Panel']; - include($phpbb_root_path . 'includes/page_header.'.$phpEx); // // Load templates @@ -894,39 +776,7 @@ else if ( $group_id ) generate_user_info($group_moderator, $config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim); $template->assign_vars(array( - 'L_GROUP_INFORMATION' => $lang['Group_Information'], - 'L_GROUP_NAME' => $lang['Group_name'], - 'L_GROUP_DESC' => $lang['Group_description'], - 'L_GROUP_TYPE' => $lang['Group_type'], - 'L_GROUP_MEMBERSHIP' => $lang['Group_membership'], - 'L_SUBSCRIBE' => $lang['Subscribe'], - 'L_UNSUBSCRIBE' => $lang['Unsubscribe'], - 'L_JOIN_GROUP' => $lang['Join_group'], - 'L_UNSUBSCRIBE_GROUP' => $lang['Unsubscribe'], - 'L_GROUP_OPEN' => $lang['Group_open'], - 'L_GROUP_CLOSED' => $lang['Group_closed'], - 'L_GROUP_HIDDEN' => $lang['Group_hidden'], - 'L_UPDATE' => $lang['Update'], - 'L_GROUP_MODERATOR' => $lang['Group_Moderator'], - 'L_GROUP_MEMBERS' => $lang['Group_Members'], - 'L_PENDING_MEMBERS' => $lang['Pending_members'], - 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], - 'L_PM' => $lang['Private_Message'], - 'L_EMAIL' => $lang['Email'], - 'L_POSTS' => $lang['Posts'], - 'L_WEBSITE' => $lang['Website'], - 'L_FROM' => $lang['Location'], - 'L_ORDER' => $lang['Order'], - 'L_SORT' => $lang['Sort'], - 'L_SUBMIT' => $lang['Sort'], - 'L_AIM' => $lang['AIM'], - 'L_YIM' => $lang['YIM'], - 'L_MSNM' => $lang['MSNM'], - 'L_ICQ' => $lang['ICQ'], - 'L_SELECT' => $lang['Select'], - 'L_REMOVE_SELECTED' => $lang['Remove_selected'], - 'L_ADD_MEMBER' => $lang['Add_member'], - 'L_FIND_USERNAME' => $lang['Find_username'], + 'GROUP_NAME' => $group_info['group_name'], 'GROUP_DESC' => $group_info['group_description'], @@ -970,7 +820,7 @@ else if ( $group_id ) 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_MODE_SELECT' => $select_sort_mode, 'S_ORDER_SELECT' => $select_sort_order, - 'S_GROUPCP_ACTION' => append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id")) + 'S_GROUPCP_ACTION' => append_sid("groupcp.$phpEx?" . 'g' . "=$group_id")) ); // @@ -1041,7 +891,7 @@ else if ( $group_id ) $current_page = ( !$members_count ) ? 1 : ceil( $members_count / $config['topics_per_page'] ); $template->assign_vars(array( - 'PAGINATION' => generate_pagination("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id", $members_count, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination("groupcp.$phpEx?" . 'g' . "=$group_id", $members_count, $config['topics_per_page'], $start), 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $config['topics_per_page'] ) + 1 ), $current_page ), 'L_GOTO_PAGE' => $lang['Goto_page']) @@ -1149,11 +999,10 @@ else FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug WHERE ug.user_id = " . $user->data['user_id'] . " AND ug.group_id = g.group_id - AND g.group_single_user <> " . TRUE . " ORDER BY g.group_name, ug.user_id"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Error getting group information', '', __LINE__, __FILE__, $sql); + trigger_error('Error getting group information', '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) @@ -1176,23 +1025,22 @@ else } while( $row = $db->sql_fetchrow($result) ); - $s_pending_groups = '"; - $s_member_groups = '"; + $s_pending_groups = '"; + $s_member_groups = '"; } } // // Select all other groups i.e. groups that this user is not a member of // - $ignore_group_sql = ( count($in_group) ) ? "AND group_id NOT IN (" . implode(', ', $in_group) . ")" : ''; + $ignore_group_sql = ( count($in_group) ) ? "WHERE group_id NOT IN (" . implode(', ', $in_group) . ")" : ''; $sql = "SELECT group_id, group_name, group_type FROM " . GROUPS_TABLE . " g - WHERE group_single_user <> " . TRUE . " - $ignore_group_sql + $ignore_group_sql ORDER BY g.group_name"; if ( !($result = $db->sql_query($sql)) ) { - message_die(ERROR, 'Error getting group information', '', __LINE__, __FILE__, $sql); + trigger_error('Error getting group information', '', __LINE__, __FILE__, $sql); } $s_group_list_opt = ''; @@ -1203,19 +1051,13 @@ else $s_group_list_opt .=''; } } - $s_group_list = ''; + $s_group_list = ''; if ( $s_group_list_opt != '' || $s_pending_groups_opt != '' || $s_member_groups_opt != '' ) { // // Load and process templates // - include($phpbb_root_path . 'includes/page_header.'.$phpEx); - - $template->set_filenames(array( - 'user' => 'groupcp_user_body.tpl') - ); - make_jumpbox('viewforum.'.$phpEx); if ( $s_pending_groups_opt != '' || $s_member_groups_opt != '' ) { @@ -1240,32 +1082,116 @@ else $s_hidden_fields = ''; $template->assign_vars(array( - 'L_GROUP_MEMBERSHIP_DETAILS' => $lang['Group_member_details'], - 'L_JOIN_A_GROUP' => $lang['Group_member_join'], - 'L_YOU_BELONG_GROUPS' => $lang['Current_memberships'], - 'L_SELECT_A_GROUP' => $lang['Non_member_groups'], - 'L_PENDING_GROUPS' => $lang['Memberships_pending'], - 'L_SUBSCRIBE' => $lang['Subscribe'], - 'L_UNSUBSCRIBE' => $lang['Unsubscribe'], - 'L_VIEW_INFORMATION' => $lang['View_Information'], - - 'S_USERGROUP_ACTION' => append_sid("groupcp.$phpEx"), + + + 'S_USERGROUP_ACTION' => "groupcp.$phpEx$SID", 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'GROUP_LIST_SELECT' => $s_group_list, 'GROUP_PENDING_SELECT' => $s_pending_groups, 'GROUP_MEMBER_SELECT' => $s_member_groups) ); - - $template->pparse('user'); } else { - message_die(MESSAGE, $lang['No_groups_exist']); + trigger_error($user->lang['No_groups_exist']); } + // Output the page + page_header($user->lang['WHO_IS_ONLINE']); + + $template->set_filenames(array( + 'body' => 'gcp_user_body.html') + ); + make_jumpbox('viewforum.'.$phpEx); + + page_footer(); + } -include($phpbb_root_path . 'includes/page_tail.'.$phpEx); +// --------- +// FUNCTIONS +// +function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$joined, &$poster_avatar, &$profile_img, &$profile, &$search_img, &$search, &$pm_img, &$pm, &$email_img, &$email, &$www_img, &$www, &$icq_status_img, &$icq_img, &$icq, &$aim_img, &$aim, &$msn_img, &$msn, &$yim_img, &$yim) +{ + global $lang, $images, $config, $phpEx; + + $from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' '; + $joined = create_date($date_format, $row['user_regdate'], $config['board_timezone']); + $posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0; + + $poster_avatar = ''; + if ( $row['user_avatar_type'] && $row['user_id'] != ANONYMOUS && $row['user_allowavatar'] ) + { + switch( $row['user_avatar_type'] ) + { + case USER_AVATAR_UPLOAD: + $poster_avatar = ( $config['allow_avatar_upload'] ) ? '' : ''; + break; + case USER_AVATAR_REMOTE: + $poster_avatar = ( $config['allow_avatar_remote'] ) ? '' : ''; + break; + case USER_AVATAR_GALLERY: + $poster_avatar = ( $config['allow_avatar_local'] ) ? '' : ''; + break; + } + } + + if ( !empty($row['user_viewemail']) || $group_mod ) + { + $email_uri = ( $config['board_email_form'] ) ? append_sid("ucp.$phpEx?mode=email&" . POST_USERS_URL .'=' . $row['user_id']) : 'mailto:' . $row['user_email']; + + $email_img = '' . $lang['Send_email'] . ''; + $email = '' . $lang['Send_email'] . ''; + } + else + { + $email_img = ' '; + $email = ' '; + } + + $temp_url = append_sid("ucp.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']); + $profile_img = '' . $lang['Read_profile'] . ''; + $profile = '' . $lang['Read_profile'] . ''; + + $temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $row['user_id']); + $pm_img = '' . $lang['Send_private_message'] . ''; + $pm = '' . $lang['Send_private_message'] . ''; + + $www_img = ( $row['user_website'] ) ? '' . $lang['Visit_website'] . '' : ''; + $www = ( $row['user_website'] ) ? '' . $lang['Visit_website'] . '' : ''; + + if ( !empty($row['user_icq']) ) + { + $icq_status_img = ''; + $icq_img = '' . $lang['ICQ'] . ''; + $icq = '' . $lang['ICQ'] . ''; + } + else + { + $icq_status_img = ''; + $icq_img = ''; + $icq = ''; + } + + $aim_img = ( $row['user_aim'] ) ? '' . $lang['AIM'] . '' : ''; + $aim = ( $row['user_aim'] ) ? '' . $lang['AIM'] . '' : ''; + + $temp_url = append_sid("ucp.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']); + $msn_img = ( $row['user_msnm'] ) ? '' . $lang['MSNM'] . '' : ''; + $msn = ( $row['user_msnm'] ) ? '' . $lang['MSNM'] . '' : ''; + + $yim_img = ( $row['user_yim'] ) ? '' . $lang['YIM'] . '' : ''; + $yim = ( $row['user_yim'] ) ? '' . $lang['YIM'] . '' : ''; + + $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username) . "&showresults=posts"); + $search_img = '' . $lang['Search_user_posts'] . ''; + $search = '' . $lang['Search_user_posts'] . ''; + + return; +} +// +// FUNCTIONS +// --------- ?> \ No newline at end of file diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 8f53c55e8d..c322c58779 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -11,6 +11,7 @@ // // ------------------------------------------------------------- + function set_config($config_name, $config_value, $is_dynamic = FALSE) { global $db, $cache, $config; @@ -215,7 +216,7 @@ function make_jumpbox($action, $forum_id = false, $select_all = false) $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id FROM ' . FORUMS_TABLE . ' ORDER BY left_id ASC'; - $result = $db->sql_query($sql, 600); + $result = $db->sql_query($sql); $right = $cat_right = $padding_inc = 0; $padding = $forum_list = $holding = ''; @@ -236,7 +237,7 @@ function make_jumpbox($action, $forum_id = false, $select_all = false) if ($row['left_id'] < $right) { - $padding .= '     '; + $padding .= '   '; $padding_store[$row['parent_id']] = $padding; } else if ($row['left_id'] > $right + 1) @@ -376,7 +377,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat { $is_watching = 0; - $sql = "DELETE FROM " . $table_sql . " + $sql = 'DELETE FROM ' . $table_sql . " WHERE $where_sql = $match_id AND user_id = $user_id"; $db->sql_query($sql); @@ -393,7 +394,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat if ($notify_status) { - $sql = "UPDATE " . $table_sql . " + $sql = 'UPDATE ' . $table_sql . " SET notify_status = 0 WHERE $where_sql = $match_id AND user_id = $user_id"; @@ -409,7 +410,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat { $is_watching = TRUE; - $sql = "INSERT INTO " . $table_sql . " (user_id, $where_sql, notify_status) + $sql = 'INSERT INTO ' . $table_sql . " (user_id, $where_sql, notify_status) VALUES ($user_id, $match_id, 0)"; $db->sql_query($sql); } @@ -691,11 +692,11 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add $page_string .= ($on_page == $total_pages) ? '' . $total_pages . '' : '' . $total_pages . '  ' . $user->lang['NEXT'] . ''; - $page_string = $user->lang['GOTO_PAGE'] . ' ' . $page_string; -// $page_string = '' . $user->lang['GOTO_PAGE'] . ' ' . $page_string; +// $page_string = $user->lang['GOTO_PAGE'] . ' ' . $page_string; + $page_string = '' . $user->lang['GOTO_PAGE'] . ' ' . $page_string; -// $template->assign_var('BASE_URL', $base_url); -// $template->assign_var('PER_PAGE', $per_page); + $template->assign_var('BASE_URL', $base_url); + $template->assign_var('PER_PAGE', $per_page); return $page_string; } @@ -706,7 +707,7 @@ function on_page($num_items, $per_page, $start) $on_page = floor($start / $per_page) + 1; -// $template->assign_var('ON_PAGE', $on_page); + $template->assign_var('ON_PAGE', $on_page); return sprintf($user->lang['PAGE_OF'], $on_page, max(ceil($num_items / $per_page), 1)); } @@ -961,16 +962,13 @@ function login_box($s_action, $s_hidden_fields = '', $login_explain = '') page_footer(); } -// TODO -// If forum has parents, check to see if password has been entered -// for those (if it/they are the same as this forums).? If they are -// different then we ignore them as if they were blank +// Generate forum login box function login_forum_box(&$forum_data) { global $db, $config, $user, $template, $phpEx; $sql = 'SELECT forum_id - FROM phpbb_forum_access + FROM ' . FORUMS_ACCESS_TABLE . ' WHERE forum_id = ' . $forum_data['forum_id'] . ' AND user_id = ' . $user->data['user_id'] . " AND session_id = '$user->session_id'"; @@ -987,6 +985,7 @@ function login_forum_box(&$forum_data) { // TODO // Remove old valid sessions + $sql = ''; if ($_POST['password'] == $forum_data['forum_password']) { diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index a352a3987c..001e03b268 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -15,6 +15,141 @@ // User functions // +function normalise_data(&$data, &$normalise) +{ + + $valid_data = array(); + foreach ($normalise as $var_type => $var_ary) + { + foreach ($var_ary as $var_name => $var_limits) + { + $var_name = (is_string($var_name)) ? $var_name : $var_limits; + $l_prefix = strtoupper($var_name); + + if (isset($data[$var_name])) + { + switch ($var_type) + { + case 'i': + $valid_data[$var_name] = (int) $data[$var_name]; + break; + + case 'f': + $valid_data[$var_name] = (double) $data[$var_name]; + break; + + case 'b': + $valid_data[$var_name] = ($data[$var_name] <= 0) ? 0 : 1; + break; + + case 's': + // Cleanup data, remove excess spaces, convert entity forms + $valid_data[$var_name] = trim(preg_replace('#\s{2,}#s', ' ', strtr((string) $data[$var_name], array_flip(get_html_translation_table(HTML_ENTITIES))))); + + // How should we check this data? + if (!is_array($var_limits)) + { + // Is the match a string? If it is, process it further, else we'll + // assume it's a maximum length + if (is_string($var_limits)) + { + if (strstr($var_limits, ',')) + { + list($min_value, $max_value) = explode(',', $var_limits); + if (!empty($valid_data[$var_name]) && strlen($valid_data[$var_name]) < $min_value) + { + $this->error[] = $l_prefix . '_TOO_SHORT'; + } + + if (strlen($valid_data[$var_name]) > $max_value) + { + $this->error[] = $l_prefix . '_TOO_LONG'; + } + } + } + else + { + if (strlen($valid_data[$var_name]) > $var_limits) + { + $this->error[] = $l_prefix . '_TOO_LONG'; + } + } + } + break; + } + } + } + } + + return $valid_data; +} + +// Validates data subject to supplied requirements, errors appropriately +function validate_data(&$data, &$validate) +{ + global $db, $user, $config; + + foreach ($validate as $operation => $var_ary) + { + foreach ($var_ary as $var_name => $compare) + { + $l_prefix = strtoupper($var_name); + + if (!empty($compare)) + { + switch ($operation) + { + case 'm': + if (is_array($compare)) + { + foreach ($compare as $match) + { + if (!preg_match($match, $data[$var_name])) + { + $this->error[] = $l_prefix . '_WRONG_DATA'; + } + } + } + else if (!preg_match($compare, $data[$var_name])) + { + $this->error[] = $l_prefix . '_WRONG_DATA'; + } + break; + + case 'c': + if (is_array($compare)) + { + if (!in_array($data[$var_name], $compare)) + { + $this->error[] = $l_prefix . '_MISMATCH'; + } + } + else if ($data[$var_name] != $compare) + { + $this->error[] = $l_prefix . '_MISMATCH'; + } + break; + + case 'f': + if ($result = $compare($data[$var_name])) + { + $this->error[] = $result; + } + + break; + + case 'r': + if (!isset($data[$compare]) || (is_string($data[$compare]) && $data[$compare] === '')) + { + $this->error[] = strtoupper($compare) . '_MISSING_DATA'; + } + break; + } + } + } + } +} + // Generates an alphanumeric random string of given length function gen_rand_string($num_chars) { diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index d321c06a37..0a2c1ca6cb 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -258,7 +258,8 @@ class session $sql_ary = array( 'session_id' => (string) $this->session_id, 'session_user_id' => (int) $user_id, - 'session_start' => (int) $this->data['session_last_visit'], + 'session_start' => (int) $current_time, + 'session_last_visit' => (int) $this->data['session_last_visit'], 'session_time' => (int) $current_time, 'session_ip' => (string) $this->ip, 'session_browser' => (string) $this->browser, @@ -282,7 +283,7 @@ class session if ($this->data['user_id'] != ANONYMOUS) { - // Trigger EVENT_NEW_SESSION + // Trigger EVT_NEW_SESSION } return true; @@ -312,6 +313,11 @@ class session $this->session_id = ''; + if ($this->data['user_id'] != ANONYMOUS) + { + // Trigger EVT_END_SESSION + } + return true; } @@ -467,6 +473,7 @@ class user extends session if (!empty($_GET['style']) && $auth->acl_get('a_styles')) { global $SID; + $style = intval($_GET['style']); $SID .= '&style=' . $style; } @@ -482,7 +489,7 @@ class user extends session AND t.template_id = s.template_id AND c.theme_id = s.theme_id AND i.imageset_id = s.imageset_id'; - $result = $db->sql_query($sql, 600); + $result = $db->sql_query($sql, 3600); if (!($row = $db->sql_fetchrow($result))) { diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 30dd590f9f..ddf5b907b9 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -4,8 +4,8 @@ // $Id$ // // FILENAME : ucp_main.php -// STARTED : Sat Feb 21, 2003 -// COPYRIGHT : © 2003 phpBB Group +// STARTED : Mon May 19, 2003 +// COPYRIGHT : © 2001, 2003 phpBB Group // WWW : http://www.phpbb.com/ // LICENCE : GPL vs2.0 [ see /docs/COPYING ] // diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index c6e2e52328..78fc12c06e 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -43,23 +43,23 @@ class ucp_prefs extends ucp { $data = array(); $normalise = array( - 'string' => array( + 's' => array( 'dateformat'=> '3,15', 'lang' => '2,5', ), - 'int' => array('dst', 'style'), - 'float' => array('tz'), - 'bool' => array('viewemail', 'massemail', 'hideonline', 'notifypm', 'popuppm') + 'i' => array('dst', 'style'), + 'f' => array('tz'), + 'b' => array('viewemail', 'massemail', 'hideonline', 'notifypm', 'popuppm') ); - $data = $this->normalise_data($_POST, $normalise); + $data = normalise_data($_POST, $normalise); $validate = array( - 'reqd' => array('lang', 'tz', 'dateformat', 'style'), - 'match' => array( + 'r' => array('lang', 'tz', 'dateformat', 'style'), + 'm' => array( 'lang' => ($data['lang']) ? '#^[a-z_]+$#i' : '', ), ); - $this->validate_data($data, $validate); + validate_data($data, $validate); if (!sizeof($this->error)) { @@ -147,14 +147,14 @@ class ucp_prefs extends ucp { $data = array(); $normalise = array( - 'string' => array( + 's' => array( 'sk' => '1,1', 'sd' => '1,1', ), - 'int' => array('st', 'minkarma'), - 'bool' => array('images', 'flash', 'smilies', 'sigs', 'avatars', 'wordcensor'), + 'i' => array('st', 'minkarma'), + 'b' => array('images', 'flash', 'smilies', 'sigs', 'avatars', 'wordcensor'), ); - $data = $this->normalise_data($_POST, $normalise); + $data = normalise_data($_POST, $normalise); if (!sizeof($this->error)) { @@ -257,9 +257,9 @@ class ucp_prefs extends ucp { $data = array(); $normalise = array( - 'bool' => array('bbcode', 'html', 'smilies', 'sig', 'notify'), + 'b' => array('bbcode', 'html', 'smilies', 'sig', 'notify'), ); - $data = $this->normalise_data($_POST, $normalise); + $data = normalise_data($_POST, $normalise); if (!sizeof($this->error)) { diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 21d18ae338..8db52ed593 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -37,11 +37,12 @@ class ucp_profile extends ucp { case 'reg_details': - if (isset($_POST['submit'])) + if ($submit) { - $data = array(); + + $normalise = array( - 'string' => array( + 's' => array( 'username' => $config['min_name_chars'] . ',' . $config['max_name_chars'], 'password_confirm' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'], 'new_password' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'], @@ -50,27 +51,29 @@ class ucp_profile extends ucp 'email_confirm' => '7,60', ) ); - $data = $this->normalise_data($_POST, $normalise); + $data = normalise_data($_POST, $normalise); // md5 current password for checking $data['cur_password'] = md5($data['cur_password']); $validate = array( - 'reqd' => array('username', 'email'), - 'compare' => array( + 'r' => array('username', 'email'), + 'c' => array( 'password_confirm' => ($data['new_password']) ? $data['new_password'] : '', 'cur_password' => ($data['new_password'] || $data['email'] != $user->data['user_email'] || $data['username'] != $user->data['username']) ? $user->data['user_password'] : '', 'email_confirm' => ($data['email'] != $user->data['user_email']) ? $data['email'] : '', ), - 'match' => array( + 'm' => array( 'username' => ($data['username'] != $user->data['username']) ? '#^' . preg_replace('#/{1}#', '\\', $config['allow_name_chars']) . '$#iu' : '', ), - 'function' => array( + 'f' => array( 'username' => ($data['username'] != $user->data['username']) ? 'validate_username' : '', 'email' => ($data['email'] != $user->data['user_email']) ? 'validate_email' : '', ), ); - $this->validate_data($data, $validate); + validate_data($data, $validate); + + if (!sizeof($this->error)) { @@ -128,7 +131,7 @@ class ucp_profile extends ucp { $data = array(); $normalise = array( - 'string' => array( + 's' => array( 'icq' => '3,15', 'aim' => '5,255', 'msn' => '5,255', @@ -139,17 +142,17 @@ class ucp_profile extends ucp 'occupation'=> '2,500', 'interests' => '2,500', ), - 'int' => array('bday_day', 'bday_month', 'bday_year') + 'i' => array('bday_day', 'bday_month', 'bday_year') ); - $data = $this->normalise_data($_POST, $normalise); + $data = normalise_data($_POST, $normalise); $validate = array( - 'match' => array( + 'm' => array( 'icq' => ($data['icq']) ? '#^[0-9]+$#i' : '', 'website' => ($data['website']) ? '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i' : '', ), ); - $this->validate_data($data, $validate); + validate_data($data, $validate); if (!sizeof($this->error)) { @@ -261,7 +264,7 @@ class ucp_profile extends ucp $message_parser = new parse_message(); $message_parser->message = $signature; $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies); - echo ">>" . $signature = $message_parser->message; + $signature = $message_parser->message; $sql_ary = array( 'user_sig' => $signature, @@ -269,7 +272,7 @@ class ucp_profile extends ucp 'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield ); - echo $sql = 'UPDATE ' . USERS_TABLE . ' + $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $user->data['user_id']; $db->sql_query($sql); @@ -356,24 +359,24 @@ class ucp_profile extends ucp else if (!empty($_POST['uploadurl']) && $can_upload) { $normalise = array( - 'string' => array( + 's' => array( 'uploadurl' => '1,255', ) ); - $data = $this->normalise_data($_POST, $normalise); + $data = normalise_data($_POST, $normalise); $this->error = avatar_upload($data); } else if (!empty($_POST['remotelink']) && $auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) { $normalise = array( - 'string' => array( + 's' => array( 'remotelink' => '1,255', 'width' => '1,3', 'height' => '1,3', ) ); - $data = $this->normalise_data($_POST, $normalise); + $data = normalise_data($_POST, $normalise); $this->error = avatar_remote($data); } diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 5ed69cf542..de1d619117 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -72,7 +72,7 @@ class ucp_register extends ucp if (isset($_POST['submit'])) { $normalise = array( - 'string' => array( + 's' => array( 'username' => $config['min_name_chars'] . ',' . $config['max_name_chars'], 'password_confirm' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'], 'new_password' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'], @@ -81,25 +81,25 @@ class ucp_register extends ucp 'email' => '7,60', 'email_confirm' => '7,60', ), - 'float' => array('tz') + 'f' => array('tz') ); - $data = $this->normalise_data($_POST, $normalise); + $data = normalise_data($_POST, $normalise); $validate = array( - 'reqd' => array('username', 'email', 'email_confirm', 'new_password', 'password_confirm', 'lang', 'confirm_code', 'tz'), - 'compare' => array( + 'r' => array('username', 'email', 'email_confirm', 'new_password', 'password_confirm', 'lang', 'confirm_code', 'tz'), + 'c' => array( 'password_confirm' => $data['new_password'], 'email_confirm' => $data['email'], ), - 'match' => array( + 'm' => array( 'username' => '#^' . preg_replace('#/{1}#', '\\', $config['allow_name_chars']) . '$#iu', ), - 'function' => array( + 'f' => array( 'username' => 'validate_username', 'email' => 'validate_email', ), ); - $this->validate_data($data, $validate); + validate_data($data, $validate); // Visual Confirmation handling if ($config['enable_confirm']) diff --git a/phpBB/index.php b/phpBB/index.php index 0bc0cd6a8a..220530b370 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -1,27 +1,19 @@ 'Events', 'CRON' => 'Cronjobs', 'PHP_INFO' => 'PHP Information', + 'IM' => 'Jabber Settings', 'GROUP_CAT' => 'Usergroups', 'CREATE' => 'Create', @@ -468,42 +469,83 @@ $lang += array( // Banning $lang += array( - 'BAN_EXPLAIN' => 'Here you can control the banning of users by name, IP or email address. These methods prevent a user reaching any part of the board. You can give a short (255 character) reason for the ban if you wish. This will be displayed in the admin log. The length of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select Until for the ban length and enter a date in yyyy-mm-dd format.', - 'BAN_LENGTH' => 'Length of ban', - 'PERMANENT' => 'Permanent', - '30_MINS' => '30 Minutes', - '1_HOUR' => '1 Hour', - '6_HOURS' => '6 Hours', - 'OTHER' => 'Until', - 'BAN_EXCLUDE' => 'Exclude from banning', - 'BAN_USER_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered users from all current bans.', + 'BAN_EXPLAIN' => 'Here you can control the banning of users by name, IP or email address. These methods prevent a user reaching any part of the board. You can give a short (255 character) reason for the ban if you wish. This will be displayed in the admin log. The length of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select Until for the ban length and enter a date in yyyy-mm-dd format.', + 'BAN_EXCLUDE' => 'Exclude from banning', + + 'BAN_REASON' => 'Reason for ban', + 'BAN_LENGTH' => 'Length of ban', + 'PERMANENT' => 'Permanent', + '30_MINS' => '30 Minutes', + '1_HOUR' => '1 Hour', + '6_HOURS' => '6 Hours', + 'OTHER' => 'Until', + + 'BAN_USERNAME_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the Find a Username facility to look up and add one or more users automatically.', + 'UNBAN_USERNAME' => 'Un-ban or Un-exclude usernames', + 'UNBAN_USERNAME_EXPLAIN' => 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users have a grey background.', + 'BAN_USER_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered users from all current bans.', + 'NO_BANNED_USERS' => 'No banned usernames', + + 'IP_HOSTNAME' => 'IP addresses or hostnames', + 'BAN_IP_EXPLAIN' => 'To specify several different IP\'s or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *', + 'UNBAN_IP' => 'Un-ban or Un-exclude IPs', + 'UNBAN_IP_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IP\'s have a grey background.', + 'BAN_IP_EXCLUDE_EXPLAIN'=> 'Enable this to exclude the entered IP from all current bans.', + 'NO_BANNED_IP' => 'No banned IP addresses', + + 'BAN_EMAIL' => 'Ban one or more email addresses', + 'BAN_EMAIL_EXPLAIN' => 'To specify more than one email address enter each on a new line. To match partial addresses use * as the wildcard, e.g. *@hotmail.com, *@*.domain.tld, etc.', + 'UNBAN_EMAIL' => 'Un-ban or Un-exclude Emails', + 'UNBAN_EMAIL_EXPLAIN' => 'You can unban (or un-exclude) multiple email addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded email addresses have a grey background.', 'BAN_EMAIL_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered email address from all current bans.', - 'BAN_IP_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered IP from all current bans.', - 'BAN_REASON' => 'Reason for ban', - 'BAN_USERNAME_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the Find a Username facility to look up and add one or more users automatically.', - 'UNBAN_USERNAME' => 'Un-ban or Un-exclude usernames', - 'UNBAN_USERNAME_EXPLAIN' => 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users have a grey background.', - 'IP_HOSTNAME' => 'IP addresses or hostnames', - 'BAN_IP_EXPLAIN' => 'To specify several different IP\'s or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *', - 'UNBAN_IP' => 'Un-ban or Un-exclude IPs', - 'UNBAN_IP_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IP\'s have a grey background.', - 'BAN_EMAIL' => 'Ban one or more email addresses', - 'BAN_EMAIL_EXPLAIN' => 'To specify more than one email address enter each on a new line. To match partial addresses use * as the wildcard, e.g. *@hotmail.com, *@*.domain.tld, etc.', - 'UNBAN_EMAIL' => 'Un-ban or Un-exclude Emails', - 'UNBAN_EMAIL_EXPLAIN' => 'You can unban (or un-exclude) multiple email addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded email addresses have a grey background.', - 'NO_BANNED_USERS' => 'No banned usernames', - 'NO_BANNED_IP' => 'No banned IP addresses', - 'NO_BANNED_EMAIL' => 'No banned email addresses', - 'BAN_UPDATE_SUCESSFUL' => 'The banlist has been updated successfully', + 'NO_BANNED_EMAIL' => 'No banned email addresses', + + 'BAN_UPDATE_SUCESSFUL' => 'The banlist has been updated successfully', +); + +// Jabber settings +$lang += array( + 'IM_EXPLAIN' => 'Here you can enable and control the use Jabber for instant messaging and board notices. Jabber is an opensource protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Please note that not all servers offer all transports and changes in protocols can prevent transports from operating.', + + 'JAB_ENABLE' => 'Enable Jabber', + 'JAB_ENABLE_EXPLAIN' => 'Enables use of jabber messaging and notifications', + + 'JAB_SERVER' => 'Jabber server', + 'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers', + 'JAB_PORT' => 'Jabber port', + 'JAB_USERNAME' => 'Jabber username', + 'JAB_USERNAME_EXPLAIN' => 'If this user is not registered it will be created if possible.', + 'JAB_PASSWORD' => 'Jabber password', + 'JAB_RESOURCE' => 'Jabber resource', + 'JAB_RESOURCE_EXPLAIN' => 'The resource locates this particular connection, e.g. board, home, etc.', + + 'JAB_TRANSPORTS' => 'Jabber Transports', + 'JAB_AIM_ENABLE' => 'Enable AIM transport', + 'AIM_USERNAME' => 'AIM Username', + 'AIM_USERNAME_EXPLAIN' => 'A valid username on %sAIM%s', + 'AIM_PASSWORD' => 'AIM Password', + 'JAB_ICQ_ENABLE' => 'Enable ICQ transport', + 'ICQ_USERNAME' => 'ICQ UID', + 'ICQ_USERNAME_EXPLAIN' => 'A valid user id on %sICQ%s', + 'ICQ_PASSWORD' => 'ICQ Password', + 'JAB_MSN_ENABLE' => 'Enable MSN transport', + 'MSN_USERNAME' => 'MSN Username', + 'MSN_USERNAME_EXPLAIN' => 'A valid username on %sMSN%s', + 'MSN_PASSWORD' => 'MSN Password', + 'JAB_YIM_ENABLE' => 'Enable YIM transport', + 'YIM_USERNAME' => 'YIM Username', + 'YIM_USERNAME_EXPLAIN' => 'A valid username on %sYIM%s', + 'YIM_PASSWORD' => 'YIM Password', ); // Cookie settings $lang += array( - 'COOKIE_SETTINGS_EXPLAIN' => 'These details define the data used to send cookies to your users browsers. In most cases the default values for the cookie settings should be sufficient. If you do need to change any do so with care, incorrect settings can prevent users logging in.', - 'COOKIE_DOMAIN' => 'Cookie domain', - 'COOKIE_NAME' => 'Cookie name', - 'COOKIE_PATH' => 'Cookie path', - 'COOKIE_SECURE' => 'Cookie secure', + 'COOKIE_SETTINGS_EXPLAIN' => 'These details define the data used to send cookies to your users browsers. In most cases the default values for the cookie settings should be sufficient. If you do need to change any do so with care, incorrect settings can prevent users logging in.', + + 'COOKIE_DOMAIN' => 'Cookie domain', + 'COOKIE_NAME' => 'Cookie name', + 'COOKIE_PATH' => 'Cookie path', + 'COOKIE_SECURE' => 'Cookie secure', 'COOKIE_SECURE_EXPLAIN' => 'If your server is running via SSL set this to enabled else leave as disabled', ); diff --git a/phpBB/language/en/lang_main.php b/phpBB/language/en/lang_main.php index 84a448b3da..749a83e08a 100644 --- a/phpBB/language/en/lang_main.php +++ b/phpBB/language/en/lang_main.php @@ -447,7 +447,7 @@ $lang += array( 'DISPLAY_POSTS' => 'Display posts from previous', 'ALL_POSTS' => 'All Posts', - 'BACK_TO_TOP' => 'Back to top', + 'BACK_TO_TOP' => 'Top', 'POST_SUBJECT' => 'Post subject', 'KARMA_LEVEL' => 'Karma Level', 'READ_PROFILE' => 'Profile', @@ -994,6 +994,7 @@ $lang += array( 'BEFORE' => 'Before', 'AFTER' => 'After', 'NEVER' => 'Never', + 'SELECT_MARKED' => 'Select Marked', 'SEND_EMAIL' => 'Send Email', 'NO_EMAIL' => 'You are not permitted to send email to this user.', @@ -1107,40 +1108,48 @@ $lang += array( // search $lang += array( - 'Search_query' => 'Search Query', - 'Search_options' => 'Search Options', - 'Search_keywords' => 'Search for Keywords', - 'Search_keywords_explain' => 'You can use AND to define words which must be in the results, OR to define words which may be in the result and NOT to define words which should not be in the result. Use * as a wildcard for partial matches', - 'Search_author' => 'Search for Author', - 'SEARCH_AUTHOR_EXPLAIN' => 'Use * as a wildcard for partial matches', - 'Last_active' => 'Last active', - 'SELECT_MARKED' => 'Select Marked', - 'Search_for_any' => 'Search for any terms or use query as entered', - 'Search_for_all' => 'Search for all terms', - 'Search_title_msg' => 'Search topic title and message text', - 'Search_msg_only' => 'Search message text only', - 'Return_first' => 'Return first', - 'characters_posts' => 'characters of posts', - 'Search_previous' => 'Search previous', - - 'SORT_BY' => 'Sort by', - 'SORT_TIME' => 'Post Time', + 'SEARCH_QUERY' => 'Search Query', + 'SEARCH_OPTIONS' => 'Search Options', + + 'SEARCH_KEYWORDS' => 'Search for Keywords', + 'SEARCH_KEYWORDS_EXPLAIN' => 'Use + for words which must be found, - for words which must not be found and | for words which may or may not be found. Use * as a wildcard for partial matches', + + 'SEARCH_AUTHOR' => 'Search for Author', + 'SEARCH_AUTHOR_EXPLAIN' => 'Use * as a wildcard for partial matches', + 'SEARCH_FORUMS' => 'Search in forums', + 'SEARCH_FORUMS_EXPLAIN' => 'Select the forum or forums you wish to search in. For speed all subforums can be searched by selecting the parent and setting enable search subforums below.', + 'SEARCH_ALL_TERMS' => 'Search for all terms or use query as entered', + 'SEARCH_ANY_TERMS' => 'Search for any terms', + 'SEARCH_WITHIN' => 'Search within', + 'SEARCH_TITLE_MSG' => 'Topic titles and message text', + 'SEARCH_MSG_ONLY' => 'Message text only', + 'SEARCH_TITLE_ONLY' => 'Topic titles only', + 'RETURN_FIRST' => 'Return first', + 'POST_CHARACTERS' => 'characters of posts', + 'SEARCH_PREVIOUS' => 'Search previous', + 'RECENT_SEARCHES' => 'Recent searches', + 'RESULT_DAYS' => 'Limit results to previous', + 'RESULT_SORT' => 'Sort results by', + 'RESULT_DIR' => 'Order results', + + 'SORT_BY' => 'Sort by', + 'SORT_TIME' => 'Post Time', 'SORT_POST_SUBJECT' => 'Post Subject', - 'SORT_TOPIC_TITLE' => 'Topic Title', - 'SORT_AUTHOR' => 'Author', - 'SORT_FORUM' => 'Forum', - - 'Display_results' => 'Display results as', - 'All_available' => 'All available', - 'No_searchable_forums' => 'You do not have permissions to search any forum on this site', - 'No_search_match' => 'No topics or posts met your search criteria', - 'Found_search_match' => 'Search found %d match', - 'Found_search_matches' => 'Search found %d matches', - + 'SORT_TOPIC_TITLE' => 'Topic Title', + 'SORT_AUTHOR' => 'Author', + 'SORT_FORUM' => 'Forum', + 'LAST_ACTIVE' => 'Last active', + + 'DISPLAY_RESULTS' => 'Display results as', + 'ALL_AVAILABLE' => 'All available', + 'ALL_RESULTS' => 'All results', + + 'NO_SEARCHABLE_FORUMS' => 'You do not have permissions to search any forum on this site', + 'NO_SEARCH_MATCH' => 'No topics or posts met your search criteria', + 'FOUND_SEARCH_MATCH' => 'Search found %d match', + 'FOUND_SEARCH_MATCHES' => 'Search found %d matches', - 'Not_Authorised' => 'Not Authorised', - - + 'NOT_AUTHORISED' => 'Not Authorised', ); // viewonline diff --git a/phpBB/language/en/search_stopwords.txt b/phpBB/language/en/search_stopwords.txt index 5f4200e302..131cf67622 100644 --- a/phpBB/language/en/search_stopwords.txt +++ b/phpBB/language/en/search_stopwords.txt @@ -248,4 +248,4 @@ IIRC LOL ROTF ROTFLMAO -YMMV +YMMV \ No newline at end of file diff --git a/phpBB/mcp.php b/phpBB/mcp.php index d05a7a980a..b43f0a2deb 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -1,23 +1,15 @@ username = (!empty($config['jab_username'])) ? $config['jab_username'] : ''; $jabber->password = (!empty($config['jab_password'])) ? $config['jab_password'] : ''; + $jabber->resource = 'phpBB'; // If a username/password are set we will try and authorise. If they don't we will // try and create a new user, username will be the basic domain name with _phpbb @@ -204,7 +197,7 @@ switch ($mode) set_config('jab_password', $jabber->password); } - $jabber->SendPresence(); + $jabber->SendPresence(NULL, NULL, 'online'); // This _really_ needs to be an "email" template I think ... indeed the whole system is probably // best suited "merged" with email in some way. Would enable notifications, etc. to be sent via @@ -212,7 +205,7 @@ switch ($mode) $subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']); $message = stripslashes(htmlspecialchars($_POST['message'])); - $jabber->SendMessage($row[$sql_field], NULL, NULL, array('subject' => $subject, 'body' => $message)); + $jabber->SendMessage($row[$sql_field], 'normal', NULL, array('subject' => $subject, 'body' => $message), ''); $jabber->Disconnect(); $s_select = 'S_SENT_JABBER'; diff --git a/phpBB/posting.php b/phpBB/posting.php index 8fda76640b..5e19e8d9d4 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -13,7 +13,7 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; -include($phpbb_root_path . 'extension.inc'); +$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); diff --git a/phpBB/report.php b/phpBB/report.php index 9d91922c90..2e568db305 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -1,36 +1,26 @@ start(); $auth->acl($user->data); - $user->setup(); - // var definitions $post_id = (!empty($_REQUEST['p'])) ? intval($_REQUEST['p']) : 0; $reason_id = (!empty($_REQUEST['reason_id'])) ? intval($_REQUEST['reason_id']) : 0; @@ -43,7 +33,6 @@ if (isset($_POST['cancel'])) redirect("viewtopic.$phpEx$SID&p=$post_id#$post_id"); } - // Grab all relevant data $sql = 'SELECT f.*, t.*, p.* FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f diff --git a/phpBB/style.php b/phpBB/style.php index 4d3db9b8b1..f1e14b21b4 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -1,27 +1,19 @@ - {forumrow.FORUM_NAME} + {forumrow.FORUM_NAME}   diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html index 712a08a866..db645e6f53 100644 --- a/phpBB/styles/subSilver/template/overall_header.html +++ b/phpBB/styles/subSilver/template/overall_header.html @@ -30,7 +30,7 @@ function im_popup(url, width, height) return false; } -function goto() +function jumpto() { var page = prompt('{L_JUMP_PAGE}:', '{ON_PAGE}'); var perpage = '{PER_PAGE}'; diff --git a/phpBB/styles/subSilver/template/ucp_profile.html b/phpBB/styles/subSilver/template/ucp_profile.html index ee791fbd55..a23bfdbe7f 100644 --- a/phpBB/styles/subSilver/template/ucp_profile.html +++ b/phpBB/styles/subSilver/template/ucp_profile.html @@ -169,7 +169,7 @@ - + {L_SIGNATURE_PREVIEW} diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html index fa01a9383a..f2f20b8499 100644 --- a/phpBB/styles/subSilver/template/viewforum_body.html +++ b/phpBB/styles/subSilver/template/viewforum_body.html @@ -23,7 +23,7 @@ {POST_IMG} -   {L_INDEX} -> {navlinks.FORUM_NAME} + {L_INDEX} -> {navlinks.FORUM_NAME} @@ -83,7 +83,7 @@ {REPORTED_IMG}  - {topicrow.NEWEST_POST_IMG}{topicrow.ATTACH_ICON_IMG}{topicrow.TOPIC_TITLE}
{topicrow.GOTO_PAGE} + {topicrow.NEWEST_POST_IMG}{topicrow.ATTACH_ICON_IMG}{topicrow.TOPIC_TITLE}
{topicrow.GOTO_PAGE}
{topicrow.TOPIC_AUTHOR} diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index 18c55b8238..9d3e00cf11 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -98,15 +98,28 @@ - + {postrow.L_IGNORE_POST} - - + + + + + + + + + +
{postrow.POST_ICON_IMG} {L_POST_SUBJECT}: {postrow.POST_SUBJECT} {QUOTE_IMG} {EDIT_IMG} {DELETE_IMG} {IP_IMG}
+ + + + + + + + - - - - +
@@ -139,58 +152,41 @@
- - - - - - - - - - -
{postrow.KARMA_IMG}
- - - - - - -
{postrow.POST_ICON_IMG} {L_POST_SUBJECT}: {postrow.POST_SUBJECT} {QUOTE_IMG} {EDIT_IMG} {DELETE_IMG} {IP_IMG}
+ @@ -201,7 +197,7 @@ - +
- + - +
- - - -
{postrow.MESSAGE} - -

{L_DOWNLOAD_NOTICE}
-
_________________
{postrow.SIGNATURE}
- {postrow.EDITED_MESSAGE}
+ {postrow.MESSAGE} + +

{L_DOWNLOAD_NOTICE}
+
_________________
{postrow.SIGNATURE}
+ {postrow.EDITED_MESSAGE} +
- - - - - - - - - - - - - - - - - - - -
{UNAPPROVED_IMG} {L_POST_NOT_APPROVED} {REPORTED_IMG} {L_POST_REPORTED} {L_RATE}: {L_RATE_GOOD} / {L_RATE_BAD} {postrow.MINI_POST_IMG}{L_POSTED}: {postrow.POST_DATE} {REPORT_IMG}
+ + + + + + + + + + + + + + + + + + + + +
{UNAPPROVED_IMG} {L_POST_NOT_APPROVED} {REPORTED_IMG} {L_POST_REPORTED} {L_RATE}: {L_RATE_GOOD} / {L_RATE_BAD} {postrow.MINI_POST_IMG}{L_POSTED}: {postrow.POST_DATE} {REPORT_IMG}
+
{PROFILE_IMG} {PM_IMG} {EMAIL_IMG} {WWW_IMG} {AIM_IMG} {YIM_IMG} {MSN_IMG} {JABBER_IMG}