diff options
38 files changed, 195 insertions, 90 deletions
diff --git a/phpBB/adm/style/acp_groups_position.html b/phpBB/adm/style/acp_groups_position.html index 54c1cee769..3a03573756 100644 --- a/phpBB/adm/style/acp_groups_position.html +++ b/phpBB/adm/style/acp_groups_position.html @@ -82,10 +82,11 @@ <fieldset> <legend>{L_TEAMPAGE_SETTINGS}</legend> <dl> - <dt><label for="teampage_multiple">{L_TEAMPAGE_MULTIPLE}:</label><br /><span>{L_TEAMPAGE_MULTIPLE_EXPLAIN}</span></dt> + <dt><label for="teampage_multiple">{L_TEAMPAGE_MEMBERSHIPS}:</label></dt> <dd> - <label><input type="radio" name="teampage_multiple" class="radio" value="1"<!-- IF DISPLAY_MULTIPLE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> - <label><input type="radio" name="teampage_multiple" class="radio" value="0"<!-- IF not DISPLAY_MULTIPLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label> + <label><input type="radio" name="teampage_memberships" class="radio" value="0"<!-- IF DISPLAY_MEMBERSHIPS == 0 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_FIRST}</label><br /> + <label><input type="radio" name="teampage_memberships" class="radio" value="1"<!-- IF DISPLAY_MEMBERSHIPS == 1 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_DEFAULT}</label><br /> + <label><input type="radio" name="teampage_memberships" class="radio" value="2"<!-- IF DISPLAY_MEMBERSHIPS == 2 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_ALL}</label> </dd> </dl> <dl> diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index 87bd9ac882..a8794176a9 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -13,7 +13,7 @@ <fieldset> <legend>{L_SELECT_USER}</legend> <dl> - <dt><label for="username">{L_FIND_USERNAME}:</label></dt> + <dt><label for="username">{L_ENTER_USERNAME}:</label></dt> <dd><input class="text medium" type="text" id="username" name="username" /></dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd class="full" style="text-align: left;"><label><input type="checkbox" class="radio" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</label></dd> diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 00e68367fd..d881fc6bdc 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -175,12 +175,21 @@ class acp_ban } $result = $db->sql_query($sql); - $banned_options = ''; + $banned_options = $excluded_options = array(); $ban_length = $ban_reasons = $ban_give_reasons = array(); while ($row = $db->sql_fetchrow($result)) { - $banned_options .= '<option' . (($row['ban_exclude']) ? ' class="sep"' : '') . ' value="' . $row['ban_id'] . '">' . $row[$field] . '</option>'; + $option = '<option value="' . $row['ban_id'] . '">' . $row[$field] . '</option>'; + + if ($row['ban_exclude']) + { + $excluded_options[] = $option; + } + else + { + $banned_options[] = $option; + } $time_length = ($row['ban_end']) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0; @@ -241,10 +250,25 @@ class acp_ban } } + $options = ''; + if ($excluded_options) + { + $options .= '<optgroup label="' . $user->lang['OPTIONS_EXCLUDED'] . '">'; + $options .= implode('', $excluded_options); + $options .= '</optgroup>'; + } + + if ($banned_options) + { + $options .= '<optgroup label="' . $user->lang['OPTIONS_BANNED'] . '">'; + $options .= implode('', $banned_options); + $options .= '</optgroup>'; + } + $template->assign_vars(array( 'S_BAN_END_OPTIONS' => $ban_end_options, - 'S_BANNED_OPTIONS' => ($banned_options) ? true : false, - 'BANNED_OPTIONS' => $banned_options) - ); + 'S_BANNED_OPTIONS' => ($banned_options || $excluded_options) ? true : false, + 'BANNED_OPTIONS' => $options, + )); } } diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 854f262a0b..7fe8915ad1 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -212,15 +212,11 @@ class acp_forums $message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED']; - // Redirect to permissions - if ($auth->acl_get('a_fauth') && !$copied_permissions) - { - $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>'); - } - // redirect directly to permission settings screen if authed if ($action == 'add' && !$copied_permissions && $auth->acl_get('a_fauth')) { + $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>'); + meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url)); } diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 221dea2345..9aa54bed89 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -835,7 +835,7 @@ class acp_groups case 'set_config_teampage': set_config('teampage_forums', request_var('teampage_forums', 0)); - set_config('teampage_multiple', request_var('teampage_multiple', 0)); + set_config('teampage_memberships', request_var('teampage_memberships', 0)); break; case 'add': @@ -916,11 +916,11 @@ class acp_groups 'U_ACTION_LEGEND' => $this->u_action . '&field=legend', 'U_ACTION_TEAMPAGE' => $this->u_action . '&field=teampage', - 'S_GROUP_SELECT_LEGEND' => $s_group_select_legend, - 'S_GROUP_SELECT_TEAMPAGE' => $s_group_select_teampage, - 'DISPLAY_FORUMS' => ($config['teampage_forums']) ? true : false, - 'DISPLAY_MULTIPLE' => ($config['teampage_multiple']) ? true : false, - 'LEGEND_SORT_GROUPNAME' => ($config['legend_sort_groupname']) ? true : false, + 'S_GROUP_SELECT_LEGEND' => $s_group_select_legend, + 'S_GROUP_SELECT_TEAMPAGE' => $s_group_select_teampage, + 'DISPLAY_FORUMS' => ($config['teampage_forums']) ? true : false, + 'DISPLAY_MEMBERSHIPS' => $config['teampage_memberships'], + 'LEGEND_SORT_GROUPNAME' => ($config['legend_sort_groupname']) ? true : false, )); } } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 688bd9dad5..49574d66ce 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3256,6 +3256,10 @@ function get_preg_expression($mode) $inline = ($mode == 'relative_url') ? ')' : ''; return "(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?"; break; + + case 'table_prefix': + return '#^[a-zA-Z][a-zA-Z0-9_]*$#'; + break; } return ''; diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 4e8d8f7d34..39d0793030 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -446,6 +446,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'S_NO_CAT' => $catless && !$last_catless, 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, 'S_UNREAD_FORUM' => $forum_unread, + 'S_AUTH_READ' => $auth->acl_get('f_read', $row['forum_id']), 'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false, 'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, 'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false, @@ -1065,6 +1066,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $match_id = ($mode == 'forum') ? $forum_id : $topic_id; $u_url = "uid={$user->data['user_id']}"; $u_url .= ($mode == 'forum') ? '&f' : '&f=' . $forum_id . '&t'; + $is_watching = 0; // Is user watching this thread? if ($user_id != ANONYMOUS) @@ -1090,9 +1092,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $uid = request_var('uid', 0); $token = request_var('hash', ''); - if (($token && check_link_hash($token, "{$mode}_$match_id")) || confirm_box(true)) + if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true)) { - if (($uid != $user_id) || ($request->variable('unwatch', '', false, phpbb_request_interface::GET) != $mode)) + if ($uid != $user_id || $request->variable('unwatch', '', false, phpbb_request_interface::GET) != $mode) { $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); $message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); @@ -1105,7 +1107,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $db->sql_query($sql); $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); - $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); + $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />'; + $message .= sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); meta_refresh(3, $redirect_url); trigger_error($message); } @@ -1122,7 +1125,14 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $s_hidden_fields['t'] = $topic_id; } - $confirm_box_message = (($item_title == '') ? 'UNWATCH_' . strtoupper($mode) : $user->lang('UNWATCH_' . strtoupper($mode) . '_DETAILED', $item_title)); + if ($item_title == '') + { + $confirm_box_message = 'UNWATCH_' . strtoupper($mode); + } + else + { + $confirm_box_message = $user->lang('UNWATCH_' . strtoupper($mode) . '_DETAILED', $item_title); + } confirm_box(false, $confirm_box_message, build_hidden_fields($s_hidden_fields)); } } @@ -1147,9 +1157,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $uid = request_var('uid', 0); $token = request_var('hash', ''); - if (($token && check_link_hash($token, "{$mode}_$match_id")) || confirm_box(true)) + if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true)) { - if (($uid != $user_id) || ($request->variable('watch', '', false, phpbb_request_interface::GET) != $mode)) + if ($uid != $user_id || $request->variable('watch', '', false, phpbb_request_interface::GET) != $mode) { $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); $message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 32b57a9f2e..d90e321285 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1652,7 +1652,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) // Send Notifications if ($mode != 'edit') { - pm_notification($mode, $data['from_username'], $recipients, $subject, $data['message']); + pm_notification($mode, $data['from_username'], $recipients, $subject, $data['message'], $data['msg_id']); } return $data['msg_id']; @@ -1661,7 +1661,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) /** * PM Notification */ -function pm_notification($mode, $author, $recipients, $subject, $message) +function pm_notification($mode, $author, $recipients, $subject, $message, $msg_id) { global $db, $user, $config, $phpbb_root_path, $phpEx, $auth; @@ -1733,8 +1733,9 @@ function pm_notification($mode, $author, $recipients, $subject, $message) 'AUTHOR_NAME' => htmlspecialchars_decode($author), 'USERNAME' => htmlspecialchars_decode($addr['name']), - 'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&folder=inbox") - ); + 'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&folder=inbox", + 'U_VIEW_MESSAGE' => generate_board_url() . "/ucp.$phpEx?i=pm&mode=view&p=$msg_id", + )); $messenger->send($addr['method']); } diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 4e0aae1870..2abded4483 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -246,7 +246,7 @@ function mcp_post_details($id, $mode, $action) } // Get Reports - if ($auth->acl_get('m_', $post_info['forum_id'])) + if ($auth->acl_get('m_report', $post_info['forum_id'])) { $sql = 'SELECT r.*, re.*, u.user_id, u.username FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u, ' . REPORTS_REASONS_TABLE . " re diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 8a8ef11289..f080d78b1e 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -239,8 +239,8 @@ function mcp_topic_view($id, $mode, $action) 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'), - 'S_POST_REPORTED' => ($row['post_reported']) ? true : false, - 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true, + 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $topic_info['forum_id'])), + 'S_POST_UNAPPROVED' => (!$row['post_approved'] && $auth->acl_get('m_approve', $topic_info['forum_id'])), 'S_CHECKED' => (($submitted_id_list && !in_array(intval($row['post_id']), $submitted_id_list)) || in_array(intval($row['post_id']), $checked_ids)) ? true : false, 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 87d51ca613..0691f3158c 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -243,7 +243,7 @@ class ucp_pm $num_not_moved = $num_removed = 0; $release = request_var('release', 0); - if ($user->data['user_new_privmsg'] && $action == 'view_folder') + if ($user->data['user_new_privmsg'] && ($action == 'view_folder' || $action == 'view_message')) { $return = place_pm_into_folder($global_privmsgs_rules, $release); $num_not_moved = $return['not_moved']; diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 4572dfd25d..6cbb539824 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -79,14 +79,14 @@ class ucp_profile $error = validate_data($data, $check_ary); - if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password']) + if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email']) { - $error[] = 'NEW_PASSWORD_ERROR'; + $error[] = ($data['email_confirm']) ? 'NEW_EMAIL_ERROR' : 'NEW_EMAIL_CONFIRM_EMPTY'; } - if (($data['new_password'] || ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) || ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && !phpbb_check_hash($data['cur_password'], $user->data['user_password'])) + if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password']) { - $error[] = 'CUR_PASSWORD_ERROR'; + $error[] = ($data['password_confirm']) ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY'; } // Only check the new password against the previous password if there have been no errors @@ -95,9 +95,9 @@ class ucp_profile $error[] = 'SAME_PASSWORD_ERROR'; } - if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email']) + if (!phpbb_check_hash($data['cur_password'], $user->data['user_password'])) { - $error[] = 'NEW_EMAIL_ERROR'; + $error[] = ($data['cur_password']) ? 'CUR_PASSWORD_ERROR' : 'CUR_PASSWORD_EMPTY'; } if (!check_form_key('ucp_reg_details')) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 3d8dd9d3fa..54737be627 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2125,10 +2125,9 @@ function change_database_data(&$no_updates, $version) _sql($sql, $errored, $error_ary); } - if (!isset($config['use_system_cron'])) + if (!isset($config['legend_sort_groupname'])) { set_config('legend_sort_groupname', '0'); - set_config('teampage_multiple', '1'); set_config('teampage_forums', '1'); } @@ -2268,6 +2267,11 @@ function change_database_data(&$no_updates, $version) set_config('load_cpf_pm', '0'); } + if (!isset($config['teampage_memberships'])) + { + set_config('teampage_memberships', '1'); + } + $no_updates = false; break; } diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 439bebf27e..722b5ddebd 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -546,6 +546,11 @@ class install_install extends module $error[] = $lang['INST_ERR_NO_DB']; $connect_test = false; } + else if (!preg_match(get_preg_expression('table_prefix'), $data['table_prefix'])) + { + $error[] = $lang['INST_ERR_DB_INVALID_PREFIX']; + $connect_test = false; + } else { $connect_test = connect_check_db(true, $error, $available_dbms[$data['dbms']], $data['table_prefix'], $data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport']); @@ -1916,7 +1921,7 @@ class install_install extends module 'dbname' => array('lang' => 'DB_NAME', 'type' => 'text:25:100', 'explain' => false), 'dbuser' => array('lang' => 'DB_USERNAME', 'type' => 'text:25:100', 'explain' => false), 'dbpasswd' => array('lang' => 'DB_PASSWORD', 'type' => 'password:25:100', 'explain' => false), - 'table_prefix' => array('lang' => 'TABLE_PREFIX', 'type' => 'text:25:100', 'explain' => false), + 'table_prefix' => array('lang' => 'TABLE_PREFIX', 'type' => 'text:25:100', 'explain' => true), ); var $admin_config_options = array( 'legend1' => 'ADMIN_CONFIG', diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 8ba529e328..8f61a90de5 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -246,7 +246,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username', ''); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_multiple', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_memberships', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_forums', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0'); diff --git a/phpBB/language/en/acp/ban.php b/phpBB/language/en/acp/ban.php index 137224ba4f..c763ae6dbd 100644 --- a/phpBB/language/en/acp/ban.php +++ b/phpBB/language/en/acp/ban.php @@ -68,6 +68,9 @@ $lang = array_merge($lang, array( 'LENGTH_BAN_INVALID' => 'The date has to be formatted <kbd>YYYY-MM-DD</kbd>.', + 'OPTIONS_BANNED' => 'Banned', + 'OPTIONS_EXCLUDED' => 'Excluded', + 'PERMANENT' => 'Permanent', 'UNTIL' => 'Until', diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index 11342bf4f2..28e6fb80d9 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -129,11 +129,13 @@ $lang = array_merge($lang, array( 'SPECIAL_GROUPS' => 'Pre-defined groups', 'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.', + 'TEAMPAGE_DISP_ALL' => 'All memberships', + 'TEAMPAGE_DISP_DEFAULT' => 'User’s default group only', + 'TEAMPAGE_DISP_FIRST' => 'First membership only', 'TEAMPAGE_EXPLAIN' => 'These are the groups which are displayed on the teampage:', 'TEAMPAGE_FORUMS' => 'Display moderated forums', 'TEAMPAGE_FORUMS_EXPLAIN' => 'If set to yes, moderators will have a list with all of the forums where they have moderator permissions displayed in their row. This can be very database intensive for big boards.', - 'TEAMPAGE_MULTIPLE' => 'Display users in all groups', - 'TEAMPAGE_MULTIPLE_EXPLAIN' => 'If set to no, the users will only be displayed in their primary group (If the primary group is not listed, the users will be displayed in their first displayed group).', + 'TEAMPAGE_MEMBERSHIPS' => 'Display user memberships', 'TEAMPAGE_SETTINGS' => 'Teampage settings', 'TOTAL_MEMBERS' => 'Members', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index c79197d07a..44a63a6acb 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -165,6 +165,7 @@ $lang = array_merge($lang, array( 'EMPTY_MESSAGE_SUBJECT' => 'You must specify a subject when composing a new message.', 'ENABLED' => 'Enabled', 'ENCLOSURE' => 'Enclosure', + 'ENTER_USERNAME' => 'Enter username', 'ERR_CHANGING_DIRECTORY' => 'Unable to change directory.', 'ERR_CONNECTING_SERVER' => 'Error connecting to the server.', 'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.', diff --git a/phpBB/language/en/email/privmsg_notify.txt b/phpBB/language/en/email/privmsg_notify.txt index d363df7973..d3a86cc73c 100644 --- a/phpBB/language/en/email/privmsg_notify.txt +++ b/phpBB/language/en/email/privmsg_notify.txt @@ -8,7 +8,7 @@ You have received a new private message from "{AUTHOR_NAME}" to your account on You can view your new message by clicking on the following link: -{U_INBOX} +{U_VIEW_MESSAGE} You have requested that you be notified on this event, remember that you can always choose not to be notified of new messages by changing the appropriate setting in your profile. diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 2b5d1cad6b..98b973cfc7 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -232,6 +232,7 @@ $lang = array_merge($lang, array( 'INST_ERR' => 'Installation error', 'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below.', 'INST_ERR_DB_FORUM_PATH' => 'The database file specified is within your board directory tree. You should put this file in a non web-accessible location.', + 'INST_ERR_DB_INVALID_PREFIX'=> 'The prefix you entered is invalid. It must start with an alphanumeric character and must only contain alphanumeric characters, numbers and underscores.', 'INST_ERR_DB_NO_ERROR' => 'No error message given.', 'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the “MySQL with MySQLi Extension” option you have selected. Please try the “MySQL” option instead.', 'INST_ERR_DB_NO_SQLITE' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.', @@ -353,6 +354,7 @@ $lang = array_merge($lang, array( 'TABLES_MISSING' => 'Could not find these tables<br />» <strong>%s</strong>.', 'TABLE_PREFIX' => 'Prefix for tables in database', + 'TABLE_PREFIX_EXPLAIN' => 'The prefix must start with an alphanumeric character and must only contain alphanumeric characters, numbers and underscores.', 'TABLE_PREFIX_SAME' => 'The table prefix needs to be the one used by the software you are converting from.<br />» Specified table prefix was %s.', 'TESTS_PASSED' => 'Tests passed', 'TESTS_FAILED' => 'Tests failed', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index f4b1b591d6..c8ffbf31c0 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -138,6 +138,7 @@ $lang = array_merge($lang, array( 'CURRENT_IMAGE' => 'Current image', 'CURRENT_PASSWORD' => 'Current password', 'CURRENT_PASSWORD_EXPLAIN' => 'You must confirm your current password if you wish to change it, alter your e-mail address or username.', + 'CUR_PASSWORD_EMPTY' => 'You did not enter your current password.', 'CUR_PASSWORD_ERROR' => 'The current password you entered is incorrect.', 'CUSTOM_DATEFORMAT' => 'Custom…', @@ -268,9 +269,11 @@ $lang = array_merge($lang, array( 'MOVE_TO_FOLDER' => 'Move to folder', 'MOVE_UP' => 'Move up', + 'NEW_EMAIL_CONFIRM_EMPTY' => 'You did not enter a confirm e-mail address.', 'NEW_EMAIL_ERROR' => 'The e-mail addresses you entered do not match.', 'NEW_FOLDER_NAME' => 'New folder name', 'NEW_PASSWORD' => 'New password', + 'NEW_PASSWORD_CONFIRM_EMPTY' => 'You did not enter a confirm password.', 'NEW_PASSWORD_ERROR' => 'The passwords you entered do not match.', 'NOTIFY_METHOD' => 'Notification method', 'NOTIFY_METHOD_BOTH' => 'Both', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 1b6cb5ef94..d9b49d7780 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -229,7 +229,7 @@ switch ($mode) if (isset($user_ary[$user_id])) { $row = $user_ary[$user_id]; - if (!$config['teampage_multiple'] && ($group_id != $groups_ary[$row['default_group']]['group_id']) && $groups_ary[$row['default_group']]['group_teampage']) + if ($config['teampage_memberships'] == 1 && ($group_id != $groups_ary[$row['default_group']]['group_id']) && $groups_ary[$row['default_group']]['group_teampage']) { // Display users in their primary group, instead of the first group, when it is displayed on the teampage. continue; @@ -259,7 +259,7 @@ switch ($mode) 'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), )); - if (!$config['teampage_multiple']) + if ($config['teampage_memberships'] != 2) { unset($user_ary[$user_id]); } diff --git a/phpBB/styles/prosilver/template/message_body.html b/phpBB/styles/prosilver/template/message_body.html index d30705dbee..3a970769b7 100644 --- a/phpBB/styles/prosilver/template/message_body.html +++ b/phpBB/styles/prosilver/template/message_body.html @@ -1,4 +1,8 @@ -<!-- INCLUDE overall_header.html --> +<!-- IF S_SIMPLE_MESSAGE --> + <!-- INCLUDE simple_header.html --> +<!-- ELSE --> + <!-- INCLUDE overall_header.html --> +<!-- ENDIF --> <div class="panel" id="message"> <div class="inner"><span class="corners-top"><span></span></span> @@ -8,4 +12,8 @@ <span class="corners-bottom"><span></span></span></div> </div> -<!-- INCLUDE overall_footer.html --> +<!-- IF S_SIMPLE_MESSAGE --> + <!-- INCLUDE simple_footer.html --> +<!-- ELSE --> + <!-- INCLUDE overall_footer.html --> +<!-- ENDIF --> diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index 81b916d373..815e55b6de 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -1,4 +1,4 @@ -/* proSilver RTL definitions +/* RTL definitions ---------------------------------------- */ /** @@ -519,7 +519,7 @@ /** * cp.css */ -/* proSilver Control Panel Styles +/* Control Panel Styles ---------------------------------------- */ diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css index afd65454b1..e817380f8e 100644 --- a/phpBB/styles/prosilver/theme/buttons.css +++ b/phpBB/styles/prosilver/theme/buttons.css @@ -1,4 +1,4 @@ -/* proSilver Button Styles +/* Button Styles ---------------------------------------- */ /* Rollover buttons diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index a86f723f81..8b5e09297e 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -1,4 +1,4 @@ -/* General proSilver Markup Styles +/* General Markup Styles ---------------------------------------- */ * { diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index 17ee56c4a2..103755cb05 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -1,4 +1,4 @@ -/* proSilver Content Styles +/* Content Styles ---------------------------------------- */ ul.topiclist { diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css index b574b0ae1f..708bfbaf83 100644 --- a/phpBB/styles/prosilver/theme/cp.css +++ b/phpBB/styles/prosilver/theme/cp.css @@ -1,4 +1,4 @@ -/* proSilver Control Panel Styles +/* Control Panel Styles ---------------------------------------- */ diff --git a/phpBB/styles/prosilver/theme/forms.css b/phpBB/styles/prosilver/theme/forms.css index 803c608bcf..43888733cc 100644 --- a/phpBB/styles/prosilver/theme/forms.css +++ b/phpBB/styles/prosilver/theme/forms.css @@ -1,4 +1,4 @@ -/* proSilver Form Styles +/* Form Styles ---------------------------------------- */ /* General form styles @@ -26,6 +26,7 @@ select { border: 1px solid #666666; padding: 1px; background-color: #FAFAFA; + font-size: 1em; } option { diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css index f3b718da61..c6a7cb4559 100644 --- a/phpBB/styles/prosilver/theme/links.css +++ b/phpBB/styles/prosilver/theme/links.css @@ -1,4 +1,4 @@ -/* proSilver Link Styles +/* Link Styles ---------------------------------------- */ /* Links adjustment to correctly display an order of rtl/ltr mixed content */ diff --git a/phpBB/styles/prosilver/theme/print.css b/phpBB/styles/prosilver/theme/print.css index 2cfcd4da20..bc3ca80fdc 100644 --- a/phpBB/styles/prosilver/theme/print.css +++ b/phpBB/styles/prosilver/theme/print.css @@ -1,10 +1,5 @@ -/* proSilver Print Style Sheet -------------------------------------------------- - Author: subBlue ( http://www.subBlue.com/ ) - Version: 25 August 2004 - - Copyright 2004 phpBB Group --------------------------------------------------*/ +/* Print Style Sheet +---------------------------------------- */ /* Lots still TODO here! */ diff --git a/phpBB/styles/prosilver/theme/stylesheet.css b/phpBB/styles/prosilver/theme/stylesheet.css index 3c0223507a..3cf60ea494 100644 --- a/phpBB/styles/prosilver/theme/stylesheet.css +++ b/phpBB/styles/prosilver/theme/stylesheet.css @@ -1,11 +1,9 @@ -/* phpBB 3.0 Style Sheet +/* phpBB3 Style Sheet -------------------------------------------------------------- - Style name: proSilver - Based on style: proSilver (this is the default phpBB 3 style) - Original author: subBlue ( http://www.subBlue.com/ ) - Modified by: - - Copyright 2006 phpBB Group ( http://www.phpbb.com/ ) + Style name: prosilver (the default phpBB 3.0.x style) + Based on style: + Original author: Tom Beddard ( http://www.subblue.com/ ) + Modified by: phpBB Group ( http://www.phpbb.com/ ) -------------------------------------------------------------- */ @@ -17,4 +15,4 @@ @import url("forms.css"); @import url("tweaks.css"); @import url("colours.css"); -@import url("imageset.css");
\ No newline at end of file +@import url("imageset.css"); diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css index 351d4808ba..089bc6f764 100644 --- a/phpBB/styles/prosilver/theme/tweaks.css +++ b/phpBB/styles/prosilver/theme/tweaks.css @@ -1,4 +1,4 @@ -/* proSilver Style Sheet Tweaks +/* Style Sheet Tweaks These style definitions are mainly IE specific tweaks required due to its poor CSS support. diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css index a753c914ba..ee1a8f44dc 100644 --- a/phpBB/styles/subsilver2/theme/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/stylesheet.css @@ -1,14 +1,9 @@ -/* phpBB 3.0 Style Sheet +/* phpBB3 Style Sheet -------------------------------------------------------------- - Style name: subsilver2 - Based on style: subSilver (the default phpBB 2 style) - Original author: subBlue ( http://www.subBlue.com/ ) - Modified by: psoTFX and the phpBB team ( http://www.phpbb.com ) - - This is an alternative style for phpBB3 for those wishing to stay with - the familiar subSilver style of phpBB version 2.x - - Copyright 2006 phpBB Group ( http://www.phpbb.com/ ) + Style name: subsilver2 + Based on style: subSilver (the default phpBB 2.0.x style) + Original author: Tom Beddard ( http://www.subblue.com/ ) + Modified by: phpBB Group ( http://www.phpbb.com/ ) -------------------------------------------------------------- */ diff --git a/phpBB/ucp.php b/phpBB/ucp.php index 4ec5d01fe0..505dbb998b 100644 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -256,6 +256,12 @@ if (!$user->data['is_registered']) redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } + if ($id == 'pm' && $mode == 'view' && isset($_GET['p'])) + { + $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx?i=pm&p=" . request_var('p', 0)); + login_box($redirect_url, $user->lang['LOGIN_EXPLAIN_UCP']); + } + login_box('', $user->lang['LOGIN_EXPLAIN_UCP']); } diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 62cf939545..caed794671 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -209,7 +209,7 @@ $s_watching_forum = array( 'is_watching' => false, ); -if (($config['email_enable'] || $config['jab_enable']) && $config['allow_forum_notify'] && $forum_data['forum_type'] == FORUM_POST && $auth->acl_get('f_subscribe', $forum_id)) +if (($config['email_enable'] || $config['jab_enable']) && $config['allow_forum_notify'] && $forum_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_subscribe', $forum_id) || $user->data['user_id'] == ANONYMOUS)) { $notify_status = (isset($forum_data['notify_status'])) ? $forum_data['notify_status'] : NULL; watch_topic_forum('forum', $s_watching_forum, $user->data['user_id'], $forum_id, 0, $notify_status, $start, $forum_data['forum_name']); @@ -391,6 +391,12 @@ if ($forum_data['forum_type'] == FORUM_POST) while ($row = $db->sql_fetchrow($result)) { + if (!$row['topic_approved'] && !$auth->acl_get('m_approve', $row['forum_id'])) + { + // Do not display announcements that are waiting for approval. + continue; + } + $rowset[$row['topic_id']] = $row; $announcement_list[] = $row['topic_id']; @@ -567,10 +573,14 @@ if ($s_display_active) $topics_count = 1; } +// We need to remove the global announcements from the forums total topic count, +// otherwise the number is different from the one on the forum list +$total_topic_count = $topics_count - sizeof($global_announce_forums); + $template->assign_vars(array( 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '')), $topics_count, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), - 'TOTAL_TOPICS' => ($s_display_active) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count))) + 'TOTAL_TOPICS' => ($s_display_active) ? false : (($total_topic_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_topic_count))) ); $topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index a1976e169d..ceb9f3ea1c 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -454,9 +454,10 @@ $s_watching_topic = array( 'is_watching' => false, ); -if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify'] && $user->data['is_registered']) +if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify']) { - watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $topic_data['notify_status'], $start, $topic_data['topic_title']); + $notify_status = (isset($topic_data['notify_status'])) ? $topic_data['notify_status'] : null; + watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $notify_status, $start, $topic_data['topic_title']); // Reset forum notification if forum notify is set if ($config['allow_forum_notify'] && $auth->acl_get('f_subscribe', $forum_id)) diff --git a/tests/regex/table_prefix_test.php b/tests/regex/table_prefix_test.php new file mode 100644 index 0000000000..67a18b4fbc --- /dev/null +++ b/tests/regex/table_prefix_test.php @@ -0,0 +1,35 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; + +class phpbb_regex_table_prefix_test extends phpbb_test_case +{ + public function table_prefix_test_data() + { + return array( + array('phpbb_', 1), + array('phpBB3', 1), + array('a', 1), + + array('', 0), + array('_', 0), + array('a-', 0), + array("'", 0), + ); + } + + /** + * @dataProvider table_prefix_test_data + */ + public function test_table_prefix($prefix, $expected) + { + $this->assertEquals($expected, preg_match(get_preg_expression('table_prefix'), $prefix)); + } +} |