From 3c632fa8e4af4b9b666ddbab2de77d42716ce2b2 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 13:14:51 +0200 Subject: [ticket/11842] Use group_id 0 and correct avatar name after creating group It seems like the function group_correct_avatar() was forgotten while adding the new avatar system. We now pass the group_id 0 to the upload avatar and let the function group_correct_avatar() fix the avatar filename after creating the group like it was done previously. PHPBB3-11842 --- phpBB/includes/acp/acp_groups.php | 4 ++++ phpBB/includes/functions_user.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index ad29a5521b..e0f2e0ed8d 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -325,6 +325,10 @@ class acp_groups // This is normalised data, without the group_ prefix $avatar_data = \phpbb\avatar\manager::clean_row($group_row); + if (!isset($avatar_data['id'])) + { + $avatar_data['id'] = $group_id; + } } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 30891c3fb5..475f59da1d 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2314,7 +2314,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow { $group_id = $db->sql_nextid(); - if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == AVATAR_UPLOAD) + if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == 'avatar.driver.upload') { group_correct_avatar($group_id, $sql_ary['group_avatar']); } -- cgit v1.2.1 From 9d4d212e0f71789e1f0332046dd852d80ab9c8ba Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 13:55:23 +0200 Subject: [ticket/11525] Only remove group or user prefix from given avatar data Until now, the user data had both user_id and group_id keys in the avatar data. As both group_ and user_ prefixes were removed the group_id was collapsed onto the user_id and therefore all users in the same group had the same prefix for their uploaded avatars. This patch will make sure that the correct id is used depending on whether it's a group's or user's avatar data. PHPBB3-11525 --- phpBB/includes/acp/acp_groups.php | 2 +- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/functions_display.php | 4 ++-- phpBB/includes/ucp/ucp_groups.php | 2 +- phpBB/includes/ucp/ucp_profile.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index ad29a5521b..8f417e753c 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -324,7 +324,7 @@ class acp_groups $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the group_ prefix - $avatar_data = \phpbb\avatar\manager::clean_row($group_row); + $avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group'); } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 8853200ddc..9feb1074d0 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1742,7 +1742,7 @@ class acp_users $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the user_ prefix - $avatar_data = \phpbb\avatar\manager::clean_row($user_row); + $avatar_data = \phpbb\avatar\manager::clean_row($user_row, 'user'); if ($submit) { diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index c6ab5df90f..f03e4c01d0 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1352,7 +1352,7 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank */ function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false) { - $row = \phpbb\avatar\manager::clean_row($user_row); + $row = \phpbb\avatar\manager::clean_row($user_row, 'user'); return phpbb_get_avatar($row, $alt, $ignore_config); } @@ -1367,7 +1367,7 @@ function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = */ function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config = false) { - $row = \phpbb\avatar\manager::clean_row($user_row); + $row = \phpbb\avatar\manager::clean_row($user_row, 'group'); return phpbb_get_avatar($row, $alt, $ignore_config); } diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index a75d2e9bfc..32b27b55b4 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -465,7 +465,7 @@ class ucp_groups $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the group_ prefix - $avatar_data = \phpbb\avatar\manager::clean_row($group_row); + $avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group'); } // Did we submit? diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 3f58ce20b4..f7c6aca9e8 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -567,7 +567,7 @@ class ucp_profile $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the user_ prefix - $avatar_data = \phpbb\avatar\manager::clean_row($user->data); + $avatar_data = \phpbb\avatar\manager::clean_row($user->data, 'user'); if ($submit) { -- cgit v1.2.1 From 1f624e136785893d0c9e4bfeb1a12f9c08693a24 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 21:41:41 +0200 Subject: [ticket/11842] Replace outdated occurences of user and group avatar_type user_avatar_type und group_avatar_type are now a string and should therefore be treated accordingly. PHPBB3-11842 --- phpBB/includes/functions_user.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 475f59da1d..9e84af5c28 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -213,7 +213,7 @@ function user_add($user_row, $cp_data = false) 'user_occ' => '', 'user_interests' => '', 'user_avatar' => '', - 'user_avatar_type' => 0, + 'user_avatar_type' => '', 'user_avatar_width' => 0, 'user_avatar_height' => 0, 'user_new_privmsg' => 0, @@ -463,7 +463,7 @@ function user_delete($mode, $user_ids, $retain_username = true) $added_guest_posts = 0; foreach ($user_rows as $user_id => $user_row) { - if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == AVATAR_UPLOAD) + if ($user_row['user_avatar'] && ($user_row['user_avatar_type'] == AVATAR_UPLOAD || $user_row['user_avatar_type'] == 'avatar.driver.upload')) { avatar_delete('user', $user_row); } @@ -2415,7 +2415,7 @@ function avatar_remove_db($avatar_name) $sql = 'UPDATE ' . USERS_TABLE . " SET user_avatar = '', - user_avatar_type = 0 + user_avatar_type = '' WHERE user_avatar = '" . $db->sql_escape($avatar_name) . '\''; $db->sql_query($sql); } @@ -2825,7 +2825,7 @@ function remove_default_avatar($group_id, $user_ids) $sql = 'UPDATE ' . USERS_TABLE . " SET user_avatar = '', - user_avatar_type = 0, + user_avatar_type = '', user_avatar_width = 0, user_avatar_height = 0 WHERE group_id = " . (int) $group_id . " @@ -3083,7 +3083,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal 'group_colour' => 'string', 'group_rank' => 'int', 'group_avatar' => 'string', - 'group_avatar_type' => 'int', + 'group_avatar_type' => 'string', 'group_avatar_width' => 'int', 'group_avatar_height' => 'int', ); -- cgit v1.2.1 From 7aa4d8fce2e61776d5f2dbf67386a589bcd7d634 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 7 Nov 2013 12:56:10 +0100 Subject: [ticket/11927] Correctly add new files on update Currently we ignore language and style files when the directory where they go to do not exist. However in 3.1 we introduce some new sub directories: * language/en/email/short/ * styles/prosilver/theme/en/ So we need to change our check to look whether the language or style exist, rather then the parent directory. PHPBB3-11927 --- phpBB/includes/functions_install.php | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 1be6e49471..be0ecd4306 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -533,3 +533,42 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test return $config_data; } + +/** +* +*/ +function ignore_new_file_on_update($phpbb_root_path, $file) +{ + $ignore_new_file = false; + + // We ignore new files in some circumstances: + // 1. The file is a language file, but the language is not installed + if (!$ignore_new_file && strpos($file, 'language/') === 0) + { + list($language_dir, $language_iso) = explode('/', $file); + $ignore_new_file = !file_exists($phpbb_root_path . $language_dir . '/' . $language_iso); + } + + // 2. The file is a style file, but the style is not installed + if (!$ignore_new_file && strpos($file, 'styles/') === 0) + { + list($styles_dir, $style_name) = explode('/', $file); + $ignore_new_file = !file_exists($phpbb_root_path . $styles_dir . '/' . $style_name); + } + + // 3. The file is a style language file, but the language is not installed + if (!$ignore_new_file && strpos($file, 'styles/') === 0) + { + $dirs = explode('/', $file); + if ($dirs >= 5) + { + list($styles_dir, $style_name, $template_component, $language_iso) = explode('/', $file); + if ($template_component == 'theme' && $language_iso !== 'images') + { + $ignore_new_file = !file_exists($phpbb_root_path . 'language/' . $language_iso); + } + } + } + + return $ignore_new_file; +} -- cgit v1.2.1 From 0e33c8d3d2fe830490771f7d1a357612b297ef96 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 7 Nov 2013 13:26:43 +0100 Subject: [ticket/11927] Add doc block to new function PHPBB3-11927 --- phpBB/includes/functions_install.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index be0ecd4306..25b594cac3 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -535,7 +535,16 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test } /** +* Check whether a file should be ignored on update * +* We ignore new files in some circumstances: +* 1. The file is a language file, but the language is not installed +* 2. The file is a style file, but the style is not installed +* 3. The file is a style language file, but the language is not installed +* +* @param string $phpbb_root_path phpBB root path +* @param string $file File including path from phpbb root +* @return bool Should we ignore the new file or add it to the board? */ function ignore_new_file_on_update($phpbb_root_path, $file) { -- cgit v1.2.1 From 95348c8f6d64302d2d525f2ba1a9408f1510144b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 7 Nov 2013 13:49:55 +0100 Subject: [ticket/11927] Prefix function with phpbb_ PHPBB3-11927 --- phpBB/includes/functions_install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 25b594cac3..10e9878cc8 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -546,7 +546,7 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test * @param string $file File including path from phpbb root * @return bool Should we ignore the new file or add it to the board? */ -function ignore_new_file_on_update($phpbb_root_path, $file) +function phpbb_ignore_new_file_on_update($phpbb_root_path, $file) { $ignore_new_file = false; -- cgit v1.2.1 From a6c73ea0c8ca3b0d147c31543c2655ec822dd0f8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 8 Nov 2013 14:08:02 +0100 Subject: [ticket/12002] Add link hash to extension manager links PHPBB3-12002 --- phpBB/includes/acp/acp_extensions.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index c5c17cb559..c21c9f4e9d 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -55,6 +55,11 @@ class acp_extensions $ext_name = ''; } + if (in_array($action, array('enable', 'disable', 'delete_data')) && !check_link_hash($request->variable('hash', ''), $action . '.' . $ext_name)) + { + trigger_error('FORM_INVALID', E_USER_WARNING); + } + // If they've specified an extension, let's load the metadata manager and validate it. if ($ext_name) { @@ -98,7 +103,7 @@ class acp_extensions $template->assign_vars(array( 'PRE' => true, 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), - 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name), + 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name), )); break; @@ -117,7 +122,7 @@ class acp_extensions { $template->assign_var('S_NEXT_STEP', true); - meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name)); + meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name)); } } } @@ -144,7 +149,7 @@ class acp_extensions $template->assign_vars(array( 'PRE' => true, 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), - 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name), + 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name), )); break; @@ -156,7 +161,7 @@ class acp_extensions { $template->assign_var('S_NEXT_STEP', true); - meta_refresh(0, $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name)); + meta_refresh(0, $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name)); } } @@ -177,7 +182,7 @@ class acp_extensions $template->assign_vars(array( 'PRE' => true, 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), - 'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name), + 'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name), )); break; @@ -191,7 +196,7 @@ class acp_extensions { $template->assign_var('S_NEXT_STEP', true); - meta_refresh(0, $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name)); + meta_refresh(0, $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name)); } } } -- cgit v1.2.1 From 57ec9ee49e95fa45f8c5c441b4ed05095c3918a8 Mon Sep 17 00:00:00 2001 From: Lukasz Date: Thu, 7 Nov 2013 19:52:27 +0100 Subject: [ticket/12005] Remove PM popup setting from user preferences PHPBB3-12005 --- phpBB/includes/acp/acp_users.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index fd9c17f171..c476b06c75 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1512,7 +1512,6 @@ class acp_users 'hideonline' => request_var('hideonline', !$user_row['user_allow_viewonline']), 'notifymethod' => request_var('notifymethod', $user_row['user_notify_type']), 'notifypm' => request_var('notifypm', $user_row['user_notify_pm']), - 'popuppm' => request_var('popuppm', $this->optionget($user_row, 'popuppm')), 'allowpm' => request_var('allowpm', $user_row['user_allow_pm']), 'topic_sk' => request_var('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'), @@ -1556,7 +1555,6 @@ class acp_users if (!sizeof($error)) { - $this->optionset($user_row, 'popuppm', $data['popuppm']); $this->optionset($user_row, 'viewimg', $data['view_images']); $this->optionset($user_row, 'viewflash', $data['view_flash']); $this->optionset($user_row, 'viewsmilies', $data['view_smilies']); @@ -1699,7 +1697,6 @@ class acp_users 'NOTIFY_IM' => ($data['notifymethod'] == NOTIFY_IM) ? true : false, 'NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false, 'NOTIFY_PM' => $data['notifypm'], - 'POPUP_PM' => $data['popuppm'], 'BBCODE' => $data['bbcode'], 'SMILIES' => $data['smilies'], 'ATTACH_SIG' => $data['sig'], -- cgit v1.2.1 From 166e27566ad3b3e39e4d69b25e88608b2f5cc0df Mon Sep 17 00:00:00 2001 From: Lukasz Date: Thu, 7 Nov 2013 19:52:54 +0100 Subject: [ticket/12005] Remove PM popup from converter PHPBB3-12005 --- phpBB/includes/functions_convert.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 3eeecd038d..1646c79161 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1027,7 +1027,6 @@ function set_user_options() 'attachsig' => array('bit' => 6, 'default' => 0), 'bbcode' => array('bit' => 8, 'default' => 1), 'smilies' => array('bit' => 9, 'default' => 1), - 'popuppm' => array('bit' => 10, 'default' => 0), 'sig_bbcode' => array('bit' => 15, 'default' => 1), 'sig_smilies' => array('bit' => 16, 'default' => 1), 'sig_links' => array('bit' => 17, 'default' => 1), -- cgit v1.2.1 From 0499c30b2bbb2bc683203f7ffd93e472ba3c8c54 Mon Sep 17 00:00:00 2001 From: Lukasz Date: Thu, 7 Nov 2013 19:53:24 +0100 Subject: [ticket/12005] Remove PM popup UCP module PHPBB3-12005 --- phpBB/includes/ucp/info/ucp_pm.php | 1 - phpBB/includes/ucp/ucp_pm.php | 27 --------------------------- 2 files changed, 28 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/info/ucp_pm.php b/phpBB/includes/ucp/info/ucp_pm.php index 02931e9d31..a80de21999 100644 --- a/phpBB/includes/ucp/info/ucp_pm.php +++ b/phpBB/includes/ucp/info/ucp_pm.php @@ -22,7 +22,6 @@ class ucp_pm_info 'compose' => array('title' => 'UCP_PM_COMPOSE', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')), 'drafts' => array('title' => 'UCP_PM_DRAFTS', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')), 'options' => array('title' => 'UCP_PM_OPTIONS', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')), - 'popup' => array('title' => 'UCP_PM_POPUP_TITLE', 'auth' => 'cfg_allow_privmsg', 'display' => false, 'cat' => array('UCP_PM')), ), ); } diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index d4ce8e41ee..517ae0b08c 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -83,33 +83,6 @@ class ucp_pm switch ($mode) { - // New private messages popup - case 'popup': - - $l_new_message = ''; - if ($user->data['is_registered']) - { - if ($user->data['user_new_privmsg']) - { - $l_new_message = ($user->data['user_new_privmsg'] == 1) ? $user->lang['YOU_NEW_PM'] : $user->lang['YOU_NEW_PMS']; - } - else - { - $l_new_message = $user->lang['YOU_NO_NEW_PM']; - } - } - - $template->assign_vars(array( - 'MESSAGE' => $l_new_message, - 'S_NOT_LOGGED_IN' => ($user->data['user_id'] == ANONYMOUS) ? true : false, - 'CLICK_TO_VIEW' => sprintf($user->lang['CLICK_VIEW_PRIVMSG'], '', ''), - 'U_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'), - 'UA_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox', false)) - ); - - $tpl_file = 'ucp_pm_popup'; - break; - // Compose message case 'compose': $action = request_var('action', 'post'); -- cgit v1.2.1 From 65fbf87ce717b50b5d14babbd264a64640f5c7b6 Mon Sep 17 00:00:00 2001 From: Lukasz Date: Thu, 7 Nov 2013 19:53:54 +0100 Subject: [ticket/12005] Remove PM popup PHPBB3-12005 --- phpBB/includes/functions.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index f6f1c96ac7..041c971a87 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -5359,7 +5359,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'), 'U_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'), - 'U_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup'), 'U_MEMBERLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"), 'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$phpbb_root_path}viewonline.$phpEx") : '', 'U_LOGIN_LOGOUT' => $u_login_logout, @@ -5387,7 +5386,6 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'S_BOARD_DISABLED' => ($config['board_disable']) ? true : false, 'S_REGISTERED_USER' => (!empty($user->data['is_registered'])) ? true : false, 'S_IS_BOT' => (!empty($user->data['is_bot'])) ? true : false, - 'S_USER_PM_POPUP' => $user->optionget('popuppm'), 'S_USER_LANG' => $user_lang, 'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], 'S_USERNAME' => $user->data['username'], -- cgit v1.2.1 From 252b5fe4f717494adde6644f257a044a661d2a7b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 9 Nov 2013 20:28:24 +0100 Subject: =?UTF-8?q?[=C5=A7icket/11896]=20Set=20form=5Ftime=20with=20time()?= =?UTF-8?q?=20when=20marking=20all=20notifications=20read?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit form_time is only set if is passed via the form. Since the mark notifications read link does not use the form, it will default to 0 causing the mark notifications logic to only mark notifications read if their time is smaller or equal to 0. This patch will change ucp_notifications to correctly set form_time for the confirm_box. PHPBB3-11896 --- phpBB/includes/ucp/ucp_notifications.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index 5a896c31b0..de9352a322 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -103,7 +103,7 @@ class ucp_notifications { confirm_box(false, 'NOTIFICATIONS_MARK_ALL_READ', build_hidden_fields(array( 'mark' => 'all', - 'form_time' => $form_time, + 'form_time' => time(), ))); } } -- cgit v1.2.1 From 97915b467ed2a0f15805b43155eb24ac8b326c35 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Wed, 13 Nov 2013 01:27:24 -0800 Subject: [ticket/10810] Remove obsolete swatch code. PHPBB3-10810 --- phpBB/includes/acp/acp_groups.php | 1 - phpBB/includes/ucp/ucp_groups.php | 1 - 2 files changed, 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index ad29a5521b..6ad1f12813 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -657,7 +657,6 @@ class acp_groups 'GROUP_HIDDEN' => $type_hidden, 'U_BACK' => $u_back, - 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&name=group_colour'), 'U_ACTION' => "{$this->u_action}&action=$action&g=$group_id", 'L_AVATAR_EXPLAIN' => phpbb_avatar_explanation_string(), )); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index a75d2e9bfc..1d08a8263b 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -699,7 +699,6 @@ class ucp_groups 'GROUP_CLOSED' => $type_closed, 'GROUP_HIDDEN' => $type_hidden, - 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=ucp&name=group_colour'), 'S_UCP_ACTION' => $this->u_action . "&action=$action&g=$group_id", 'L_AVATAR_EXPLAIN' => phpbb_avatar_explanation_string(), )); -- cgit v1.2.1 From 0d3396487e58091053778c9eb40ebcb6fa86536f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 14 Nov 2013 18:16:29 +0100 Subject: [ticket/11896] Use $form_time and fix out of bounds $form_time PHPBB3-11896 --- phpBB/includes/ucp/ucp_notifications.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index de9352a322..63dbe79666 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -27,7 +27,8 @@ class ucp_notifications add_form_key('ucp_notification'); $start = $request->variable('start', 0); - $form_time = min($request->variable('form_time', 0), time()); + $form_time = $request->variable('form_time', 0); + $form_time = ($form_time <= 0 || $form_time > time()) ? time() : $form_time; $phpbb_notifications = $phpbb_container->get('notification_manager'); @@ -103,7 +104,7 @@ class ucp_notifications { confirm_box(false, 'NOTIFICATIONS_MARK_ALL_READ', build_hidden_fields(array( 'mark' => 'all', - 'form_time' => time(), + 'form_time' => $form_time, ))); } } -- cgit v1.2.1 From 5fe822021bc284f756ca9361f15220dbbefb31d4 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 19 Nov 2013 00:23:49 +0100 Subject: [ticket/12023] Correctly compare the size of the array in ignore_new_files PHPBB3-12023 --- phpBB/includes/functions_install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 10e9878cc8..deb304b838 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -569,7 +569,7 @@ function phpbb_ignore_new_file_on_update($phpbb_root_path, $file) if (!$ignore_new_file && strpos($file, 'styles/') === 0) { $dirs = explode('/', $file); - if ($dirs >= 5) + if (sizeof($dirs) >= 5) { list($styles_dir, $style_name, $template_component, $language_iso) = explode('/', $file); if ($template_component == 'theme' && $language_iso !== 'images') -- cgit v1.2.1 From 6ee05d369e5aa0acb307bf88f0ac15fb33aade2b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 13 Nov 2013 17:50:57 +0100 Subject: [prep-release-3.1.0-a2] Update version to 3.1.0-a2 --- phpBB/includes/constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index e1da41d106..546cd9e6d4 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -24,7 +24,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.1.0-a2-dev'); +define('PHPBB_VERSION', '3.1.0-a2'); // QA-related // define('PHPBB_QA', 1); -- cgit v1.2.1 From d67341ea0054f2694880dc6c9fda01e6048e0ed3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 19 Nov 2013 01:37:31 +0100 Subject: [prep-release-3.1.0-a2] Update version to 3.1.0-a3-dev in install and constant --- phpBB/includes/constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 546cd9e6d4..855b6ff187 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -24,7 +24,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.1.0-a2'); +define('PHPBB_VERSION', '3.1.0-a3-dev'); // QA-related // define('PHPBB_QA', 1); -- cgit v1.2.1 From 0faafce4ce254ff282de801901372f67ca4f4415 Mon Sep 17 00:00:00 2001 From: callumacrae Date: Fri, 12 Jul 2013 21:52:10 -0400 Subject: [ticket/11672] Removed unnecessary text from alerts. Messages like "Return to forum last visited" are entirely unnecessary when using AJAX to delete a post, so this commit removes them. PHPBB3-11672 --- phpBB/includes/functions_display.php | 27 +++++++++++++++++++++------ phpBB/includes/mcp/mcp_queue.php | 6 +++++- 2 files changed, 26 insertions(+), 7 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f03e4c01d0..8829554276 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1128,7 +1128,7 @@ function display_user_activity(&$userdata) */ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0, $item_title = '') { - global $template, $db, $user, $phpEx, $start, $phpbb_root_path; + global $template, $db, $user, $phpEx, $start, $phpbb_root_path, $request; global $request; $table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE; @@ -1167,7 +1167,11 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, if ($uid != $user_id || $request->variable('unwatch', '', false, \phpbb\request\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'] . '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + $message = $user->lang['ERR_UNWATCHING']; + if (!$request->is_ajax()) + { + $message .= '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + } trigger_error($message); } @@ -1177,8 +1181,11 @@ 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)] . '

'; - $message .= sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)]; + if (!$request->is_ajax()) + { + $message .= '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + } meta_refresh(3, $redirect_url); trigger_error($message); } @@ -1232,7 +1239,11 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, if ($uid != $user_id || $request->variable('watch', '', false, \phpbb\request\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'] . '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + $message = $user->lang['ERR_WATCHING']; + if (!$request->is_ajax()) + { + $message .= '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + } trigger_error($message); } @@ -1243,7 +1254,11 @@ 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['ARE_WATCHING_' . strtoupper($mode)] . '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + $message = $user->lang['ARE_WATCHING_' . strtoupper($mode)]; + if (!$request->is_ajax()) + { + $message .= '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + } meta_refresh(3, $redirect_url); trigger_error($message); } diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index db461d07fa..365a794253 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -873,7 +873,7 @@ class mcp_queue $add_message = '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); } - $message = $user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '') . $add_message; + $message = $user->lang[$success_msg]; if ($request->is_ajax()) { @@ -885,6 +885,10 @@ class mcp_queue 'visible' => true, )); } + else + { + $message .= '

' . sprintf($user->lang['RETURN_PAGE'], "", '') . $add_message; + } trigger_error($message); } -- cgit v1.2.1 From c6473da412d1a572ed80ec10d826239ad5ce5098 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 17 Oct 2013 20:14:14 -0700 Subject: [ticket/11672] Replace sprintf() usage with $user->lang(). PHPBB3-11672 --- phpBB/includes/functions_display.php | 12 ++++++++---- phpBB/includes/mcp/mcp_queue.php | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 8829554276..140ffc42f0 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1168,9 +1168,10 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, { $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); $message = $user->lang['ERR_UNWATCHING']; + if (!$request->is_ajax()) { - $message .= '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + $message .= '

' . $user->lang('RETURN_' . strtoupper($mode), '', ''); } trigger_error($message); } @@ -1182,9 +1183,10 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)]; + if (!$request->is_ajax()) { - $message .= '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + $message .= '

' . $user->lang('RETURN_' . strtoupper($mode), '', ''); } meta_refresh(3, $redirect_url); trigger_error($message); @@ -1240,9 +1242,10 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, { $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); $message = $user->lang['ERR_WATCHING']; + if (!$request->is_ajax()) { - $message .= '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + $message .= '

' . $user->lang('RETURN_' . strtoupper($mode), '', ''); } trigger_error($message); } @@ -1255,9 +1258,10 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); $message = $user->lang['ARE_WATCHING_' . strtoupper($mode)]; + if (!$request->is_ajax()) { - $message .= '

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + $message .= '

' . $user->lang('RETURN_' . strtoupper($mode), '', ''); } meta_refresh(3, $redirect_url); trigger_error($message); diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 365a794253..e529960c99 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -887,7 +887,7 @@ class mcp_queue } else { - $message .= '

' . sprintf($user->lang['RETURN_PAGE'], "", '') . $add_message; + $message .= '

' . $user->lang('RETURN_PAGE', '', '') . $add_message; } trigger_error($message); -- cgit v1.2.1 From 3eda261b8d591ebd6a3d20b1f85c418c9c02f84a Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 18 Oct 2013 02:37:11 -0700 Subject: [ticket/11672] Remove some messages that were missed in mcp_queue.php. PHPBB3-11672 --- phpBB/includes/mcp/mcp_queue.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index e529960c99..48b6740583 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -725,7 +725,7 @@ class mcp_queue $add_message = '

' . sprintf($user->lang['RETURN_POST'], '', ''); } - $message = $user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '') . $add_message; + $message = $user->lang[$success_msg]; if ($request->is_ajax()) { @@ -737,6 +737,10 @@ class mcp_queue 'visible' => true, )); } + else + { + $message .= '

' . $user->lang('RETURN_PAGE', '', '') . $add_message; + } trigger_error($message); } @@ -1212,7 +1216,7 @@ class mcp_queue } else { - $message = $user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_PAGE'], '', ''); + $message = $user->lang[$success_msg]; if ($request->is_ajax()) { @@ -1224,6 +1228,10 @@ class mcp_queue 'visible' => false, )); } + else + { + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + } meta_refresh(3, $redirect); trigger_error($message); -- cgit v1.2.1 From 10bfb212c45c23b84c2d961902613fd869553173 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 18 Oct 2013 04:33:22 -0700 Subject: [ticket/11672] Clean up the logic in mcp_queue.php. PHPBB3-11672 --- phpBB/includes/mcp/mcp_queue.php | 172 +++++++++++++++++---------------------- 1 file changed, 75 insertions(+), 97 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 48b6740583..c782d98fbc 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -678,6 +678,32 @@ class mcp_queue } } } + + meta_refresh(3, $redirect); + $message = $user->lang[$success_msg]; + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $message, + 'REFRESH_DATA' => null, + 'visible' => true, + )); + } + else + { + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + + // If approving one post, also give links back to post... + if (sizeof($post_info) == 1 && $post_url) + { + $message .= '

' . $user->lang('RETURN_POST', '', ''); + } + } + + trigger_error($message); } else { @@ -709,41 +735,7 @@ class mcp_queue $redirect = $request->variable('redirect', "index.$phpEx"); $redirect = reapply_sid($redirect); - - if (!$success_msg) - { - redirect($redirect); - } - else - { - meta_refresh(3, $redirect); - - // If approving one post, also give links back to post... - $add_message = ''; - if (sizeof($post_info) == 1 && $post_url) - { - $add_message = '

' . sprintf($user->lang['RETURN_POST'], '', ''); - } - - $message = $user->lang[$success_msg]; - - if ($request->is_ajax()) - { - $json_response = new \phpbb\json_response; - $json_response->send(array( - 'MESSAGE_TITLE' => $user->lang['INFORMATION'], - 'MESSAGE_TEXT' => $message, - 'REFRESH_DATA' => null, - 'visible' => true, - )); - } - else - { - $message .= '

' . $user->lang('RETURN_PAGE', '', '') . $add_message; - } - - trigger_error($message); - } + redirect($redirect); } /** @@ -830,6 +822,32 @@ class mcp_queue } } } + + meta_refresh(3, $redirect); + $message = $user->lang[$success_msg]; + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $message, + 'REFRESH_DATA' => null, + 'visible' => true, + )); + } + else + { + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + + // If approving one topic, also give links back to topic... + if (sizeof($topic_info) == 1 && $topic_url) + { + $message .= '

' . $user->lang('RETURN_TOPIC', '', ''); + } + } + + trigger_error($message); } else { @@ -861,41 +879,7 @@ class mcp_queue $redirect = $request->variable('redirect', "index.$phpEx"); $redirect = reapply_sid($redirect); - - if (!$success_msg) - { - redirect($redirect); - } - else - { - meta_refresh(3, $redirect); - - // If approving one topic, also give links back to topic... - $add_message = ''; - if (sizeof($topic_info) == 1 && $topic_url) - { - $add_message = '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); - } - - $message = $user->lang[$success_msg]; - - if ($request->is_ajax()) - { - $json_response = new \phpbb\json_response; - $json_response->send(array( - 'MESSAGE_TITLE' => $user->lang['INFORMATION'], - 'MESSAGE_TEXT' => $message, - 'REFRESH_DATA' => null, - 'visible' => true, - )); - } - else - { - $message .= '

' . $user->lang('RETURN_PAGE', '', '') . $add_message; - } - - trigger_error($message); - } + redirect($redirect); } /** @@ -1159,6 +1143,26 @@ class mcp_queue { $success_msg .= '_DELETED_SUCCESS'; } + + meta_refresh(3, $redirect); + $message = $user->lang[$success_msg]; + + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'MESSAGE_TITLE' => $user->lang['INFORMATION'], + 'MESSAGE_TEXT' => $message, + 'REFRESH_DATA' => null, + 'visible' => false, + )); + } + else + { + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + } + + trigger_error($message); } else { @@ -1209,32 +1213,6 @@ class mcp_queue $redirect = $request->variable('redirect', "index.$phpEx"); $redirect = reapply_sid($redirect); - - if (!$success_msg) - { - redirect($redirect); - } - else - { - $message = $user->lang[$success_msg]; - - if ($request->is_ajax()) - { - $json_response = new \phpbb\json_response; - $json_response->send(array( - 'MESSAGE_TITLE' => $user->lang['INFORMATION'], - 'MESSAGE_TEXT' => $message, - 'REFRESH_DATA' => null, - 'visible' => false, - )); - } - else - { - $message .= '

' . $user->lang('RETURN_PAGE', '', ''); - } - - meta_refresh(3, $redirect); - trigger_error($message); - } + redirect($redirect); } } -- cgit v1.2.1 From cccb4fb83d364015962f5f77537ca1a242e03961 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 24 Oct 2013 05:48:30 -0700 Subject: [ticket/11672] Remove the messages for lock/unlock/change topic type. PHPBB3-11672 --- phpBB/includes/mcp/mcp_main.php | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 7a22c31248..5491af0859 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -219,7 +219,7 @@ class mcp_main */ function lock_unlock($action, $ids) { - global $auth, $user, $db, $phpEx, $phpbb_root_path; + global $auth, $user, $db, $phpEx, $phpbb_root_path, $request; if ($action == 'lock' || $action == 'unlock') { @@ -279,6 +279,15 @@ function lock_unlock($action, $ids) } $success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS'; + + meta_refresh(2, $redirect); + $message = $user->lang[$success_msg]; + + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + } + trigger_error($message); } else { @@ -287,16 +296,7 @@ function lock_unlock($action, $ids) $redirect = request_var('redirect', "index.$phpEx"); $redirect = reapply_sid($redirect); - - if (!$success_msg) - { - redirect($redirect); - } - else - { - meta_refresh(2, $redirect); - trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); - } + redirect($redirect); } /** @@ -304,7 +304,7 @@ function lock_unlock($action, $ids) */ function change_topic_type($action, $topic_ids) { - global $auth, $user, $db, $phpEx, $phpbb_root_path; + global $auth, $user, $db, $phpEx, $phpbb_root_path, $request; switch ($action) { @@ -381,6 +381,15 @@ function change_topic_type($action, $topic_ids) add_log('mod', $forum_id, $topic_id, 'LOG_TOPIC_TYPE_CHANGED', $row['topic_title']); } } + + meta_refresh(2, $redirect); + $message = $user->lang[$success_msg]; + + if (!$request->is_ajax()) + { + $message .= $user->lang('RETURN_PAGE', '', ''); + } + trigger_error($message); } else { @@ -389,16 +398,7 @@ function change_topic_type($action, $topic_ids) $redirect = request_var('redirect', "index.$phpEx"); $redirect = reapply_sid($redirect); - - if (!$success_msg) - { - redirect($redirect); - } - else - { - meta_refresh(2, $redirect); - trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); - } + redirect($redirect); } /** -- cgit v1.2.1 From 03e78c33fa85fab86ab0cb0802b33beada2a08d3 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sat, 2 Nov 2013 14:09:21 -0700 Subject: [ticket/11672] The json response call exits so the else is not necessary. PHPBB3-11672 --- phpBB/includes/mcp/mcp_queue.php | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index c782d98fbc..3b5e3752f8 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -692,17 +692,13 @@ class mcp_queue 'visible' => true, )); } - else - { - $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); - // If approving one post, also give links back to post... - if (sizeof($post_info) == 1 && $post_url) - { - $message .= '

' . $user->lang('RETURN_POST', '', ''); - } + // If approving one post, also give links back to post... + if (sizeof($post_info) == 1 && $post_url) + { + $message .= '

' . $user->lang('RETURN_POST', '', ''); } - trigger_error($message); } else @@ -836,17 +832,13 @@ class mcp_queue 'visible' => true, )); } - else - { - $message .= '

' . $user->lang('RETURN_PAGE', '', ''); + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); - // If approving one topic, also give links back to topic... - if (sizeof($topic_info) == 1 && $topic_url) - { - $message .= '

' . $user->lang('RETURN_TOPIC', '', ''); - } + // If approving one topic, also give links back to topic... + if (sizeof($topic_info) == 1 && $topic_url) + { + $message .= '

' . $user->lang('RETURN_TOPIC', '', ''); } - trigger_error($message); } else @@ -1157,11 +1149,7 @@ class mcp_queue 'visible' => false, )); } - else - { - $message .= '

' . $user->lang('RETURN_PAGE', '', ''); - } - + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); trigger_error($message); } else -- cgit v1.2.1 From bc33fd9950e6aad4abed3f22f44e2590f1749eab Mon Sep 17 00:00:00 2001 From: Cesar G Date: Tue, 19 Nov 2013 07:34:37 -0800 Subject: [ticket/11672] Remove duplicate $request global. PHPBB3-11672 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 140ffc42f0..5592aa89ba 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1128,7 +1128,7 @@ function display_user_activity(&$userdata) */ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0, $item_title = '') { - global $template, $db, $user, $phpEx, $start, $phpbb_root_path, $request; + global $template, $db, $user, $phpEx, $start, $phpbb_root_path; global $request; $table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE; -- cgit v1.2.1 From 3caeb09b18744a74ca2b46c670a9b943a3905c74 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 20 Nov 2013 17:15:32 +0100 Subject: [ticket/11842] Use only new avatar type in user_delete function PHPBB3-11842 --- phpBB/includes/functions_user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 9e84af5c28..bdc7104e5f 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -463,7 +463,7 @@ function user_delete($mode, $user_ids, $retain_username = true) $added_guest_posts = 0; foreach ($user_rows as $user_id => $user_row) { - if ($user_row['user_avatar'] && ($user_row['user_avatar_type'] == AVATAR_UPLOAD || $user_row['user_avatar_type'] == 'avatar.driver.upload')) + if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == 'avatar.driver.upload') { avatar_delete('user', $user_row); } -- cgit v1.2.1 From fa31096cb98a8c26377121f26ea79520dcab00f9 Mon Sep 17 00:00:00 2001 From: Lukasz Date: Wed, 20 Nov 2013 22:57:41 +0100 Subject: [ticket/12026] Correct path for template files Correct path for template files in MCP and UCP modules, which are added via extenstions PHPBB3-12026 --- phpBB/includes/functions_module.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index dca720c36e..ac13a99aa2 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -528,12 +528,12 @@ class p_master * the style paths for the extension (the ext author can change them * if necessary). */ - $module_dir = explode('_', get_class($this->module)); + $module_dir = explode('\\', get_class($this->module)); - // 0 phpbb, 1 ext, 2 vendor, 3 extension name, ... - if (isset($module_dir[3]) && $module_dir[1] === 'ext') + // 0 vendor, 1 extension name, ... + if (isset($module_dir[1])) { - $module_style_dir = 'ext/' . $module_dir[2] . '/' . $module_dir[3] . '/styles'; + $module_style_dir = $phpbb_root_path . 'ext/' . $module_dir[0] . '/' . $module_dir[1] . '/styles'; if (is_dir($phpbb_root_path . $module_style_dir)) { -- cgit v1.2.1 From fc778fe63706d21ce2fd78f10e5c8f4dec29ed3b Mon Sep 17 00:00:00 2001 From: Lukasz Date: Wed, 20 Nov 2013 23:04:56 +0100 Subject: [ticket/12026] Remove phpbb root path PHPBB3-12026 --- phpBB/includes/functions_module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index ac13a99aa2..0d0f79a16d 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -535,7 +535,7 @@ class p_master { $module_style_dir = $phpbb_root_path . 'ext/' . $module_dir[0] . '/' . $module_dir[1] . '/styles'; - if (is_dir($phpbb_root_path . $module_style_dir)) + if (is_dir($module_style_dir)) { $template->set_style(array($module_style_dir, 'styles')); } -- cgit v1.2.1 From 6d45146df7e7b19d6286f09370950fda207e309e Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 21 Nov 2013 04:37:37 -0800 Subject: [ticket/11672] Move the reapply_sid() call before meta_refresh() is called. The $redirect assignment is not necessary because the variable has already been set near the start of the functions. The redirect value will also never default to index.php because a default value has already been provided when $redirect is initially assigned and passed to the template as a hidden field. PHPBB3-11672 --- phpBB/includes/mcp/mcp_main.php | 8 +++----- phpBB/includes/mcp/mcp_queue.php | 9 +++------ 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 5491af0859..d9197da07e 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -256,6 +256,7 @@ function lock_unlock($action, $ids) unset($orig_ids); $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $redirect = reapply_sid($redirect); $s_hidden_fields = build_hidden_fields(array( $sql_id . '_list' => $ids, @@ -294,8 +295,6 @@ function lock_unlock($action, $ids) confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields); } - $redirect = request_var('redirect', "index.$phpEx"); - $redirect = reapply_sid($redirect); redirect($redirect); } @@ -341,6 +340,7 @@ function change_topic_type($action, $topic_ids) } $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $redirect = reapply_sid($redirect); $s_hidden_fields = array( 'topic_id_list' => $topic_ids, @@ -387,7 +387,7 @@ function change_topic_type($action, $topic_ids) if (!$request->is_ajax()) { - $message .= $user->lang('RETURN_PAGE', '', ''); + $message .= '

' . $user->lang('RETURN_PAGE', '', ''); } trigger_error($message); } @@ -396,8 +396,6 @@ function change_topic_type($action, $topic_ids) confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields)); } - $redirect = request_var('redirect', "index.$phpEx"); - $redirect = reapply_sid($redirect); redirect($redirect); } diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 3b5e3752f8..0318bc5e15 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -576,6 +576,7 @@ class mcp_queue } $redirect = $request->variable('redirect', build_url(array('quickmod'))); + $redirect = reapply_sid($redirect); $success_msg = $post_url = ''; $approve_log = array(); @@ -729,8 +730,6 @@ class mcp_queue confirm_box(false, strtoupper($action) . '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html'); } - $redirect = $request->variable('redirect', "index.$phpEx"); - $redirect = reapply_sid($redirect); redirect($redirect); } @@ -754,6 +753,7 @@ class mcp_queue } $redirect = $request->variable('redirect', build_url(array('quickmod'))); + $redirect = reapply_sid($redirect); $success_msg = $topic_url = ''; $approve_log = array(); @@ -869,8 +869,6 @@ class mcp_queue confirm_box(false, strtoupper($action) . '_TOPIC' . ((sizeof($topic_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html'); } - $redirect = $request->variable('redirect', "index.$phpEx"); - $redirect = reapply_sid($redirect); redirect($redirect); } @@ -893,6 +891,7 @@ class mcp_queue } $redirect = $request->variable('redirect', build_url(array('t', 'mode', 'quickmod')) . "&mode=$mode"); + $redirect = reapply_sid($redirect); $reason = $request->variable('reason', '', true); $reason_id = $request->variable('reason_id', 0); $success_msg = $additional_msg = ''; @@ -1199,8 +1198,6 @@ class mcp_queue confirm_box(false, $l_confirm_msg, $s_hidden_fields, $confirm_template); } - $redirect = $request->variable('redirect', "index.$phpEx"); - $redirect = reapply_sid($redirect); redirect($redirect); } } -- cgit v1.2.1 From 3a00cb0c081efff55fd7b1c55c8990c8682e7b8d Mon Sep 17 00:00:00 2001 From: Mario Skouat Date: Sat, 23 Mar 2013 13:48:46 +0100 Subject: [ticket/10910] Allow setting size selects in build_cfg_template() PHPBB3-10910 --- phpBB/includes/functions_acp.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index b9210114ef..ca116372ba 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -363,7 +363,9 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) if ($tpl_type[0] == 'select') { - $tpl = ''; + $size = (isset($tpl_type[1])) ? (int) $tpl_type[1] : 1; + + $tpl = ''; } else { -- cgit v1.2.1 From 2f4d15015e7a0e8d8f9a76b60c5c8c0091e399ca Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 22 Nov 2013 15:51:56 +0100 Subject: [ticket/10910] Do not add size when its 1 (default) PHPBB3-10910 --- phpBB/includes/functions_acp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index ca116372ba..cb44ed2794 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -365,7 +365,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) { $size = (isset($tpl_type[1])) ? (int) $tpl_type[1] : 1; - $tpl = ''; + $tpl = ''; } else { -- cgit v1.2.1 From b5e6d107aea96aa3338584b5f8027eade9b68f99 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 23 Nov 2013 01:05:39 +0100 Subject: [ticket/11842] Add missing prefix for group id in avatar data PHPBB3-11842 --- phpBB/includes/acp/acp_groups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index e0f2e0ed8d..449c905bfa 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -327,7 +327,7 @@ class acp_groups $avatar_data = \phpbb\avatar\manager::clean_row($group_row); if (!isset($avatar_data['id'])) { - $avatar_data['id'] = $group_id; + $avatar_data['id'] = 'g' . $group_id; } } -- cgit v1.2.1 From 83b12782737b8eea03fe0cbff07ade9dbf27dee1 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Wed, 27 Nov 2013 20:05:00 -0800 Subject: [ticket/11869] Fix strict standards error when registering. PHPBB3-11869 --- phpBB/includes/functions_user.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 30891c3fb5..b54197ac03 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -281,8 +281,9 @@ function user_add($user_row, $cp_data = false) include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); } + $cp = new custom_profile(); $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . - $db->sql_build_array('INSERT', custom_profile::build_insert_sql_array($cp_data)); + $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data)); $db->sql_query($sql); } -- cgit v1.2.1 From b41e2d335a8783da0ac60b521f6d1c82fb14e954 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Wed, 27 Nov 2013 20:49:16 -0800 Subject: [ticket/11507] Allow the posts awaiting approval value to be 0. PHPBB3-11507 --- phpBB/includes/acp/acp_prune.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 4234ec1505..5514cb2b9a 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -358,12 +358,12 @@ class acp_prune */ function get_prune_users(&$user_ids, &$usernames) { - global $user, $db; + global $user, $db, $request; $users_by_name = request_var('users', '', true); $users_by_id = request_var('user_ids', array(0)); $group_id = request_var('group_id', 0); - $posts_on_queue = request_var('posts_on_queue', 0); + $posts_on_queue = (trim($request->variable('posts_on_queue', '')) === '') ? false : $request->variable('posts_on_queue', 0); if ($users_by_name) { @@ -511,7 +511,7 @@ class acp_prune $db->sql_freeresult($result); } - if ($posts_on_queue) + if ($posts_on_queue !== false) { $sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u -- cgit v1.2.1 From c5656747d8e4e6838f9549000642886df6014755 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Wed, 27 Nov 2013 20:51:16 -0800 Subject: [ticket/11507] Fix the unapproved posts count query. Only unapproved posts should be counted. PHPBB3-11507 --- phpBB/includes/acp/acp_prune.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 5514cb2b9a..5d8d0a9dbc 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -516,10 +516,11 @@ class acp_prune $sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.poster_id', $user_ids, false, true) . ' + AND p.post_visibility = ' . ITEM_UNAPPROVED . ' AND u.user_id = p.poster_id GROUP BY p.poster_id HAVING queue_posts ' . $key_match[$queue_select] . ' ' . $posts_on_queue; - $result = $db->sql_query($result); + $result = $db->sql_query($sql); // same intersection logic as the above group ID portion $user_ids = $usernames = array(); -- cgit v1.2.1 From ef2e5ca9669cabbb0153b4855ed19403a6079536 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Wed, 27 Nov 2013 20:59:45 -0800 Subject: [ticket/11507] Allow group & unapproved post count options to be used alone. PHPBB3-11507 --- phpBB/includes/acp/acp_prune.php | 58 +++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 21 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 5d8d0a9dbc..6860fa220d 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -450,8 +450,8 @@ class acp_prune } } - // Protect the admin, do not prune if no options are given... - if (!$where_sql) + // If no search criteria were provided, go no further. + if (!$where_sql && !$group_id && $posts_on_queue === false) { return; } @@ -468,32 +468,38 @@ class acp_prune } $db->sql_freeresult($result); - // Do not prune founder members - $sql = 'SELECT user_id, username - FROM ' . USERS_TABLE . ' - WHERE user_id <> ' . ANONYMOUS . ' - AND user_type <> ' . USER_FOUNDER . " - $where_sql"; - $result = $db->sql_query($sql); + // Protect the admin, do not prune if no options are given... + if ($where_sql) + { + // Do not prune founder members + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE user_id <> ' . ANONYMOUS . ' + AND user_type <> ' . USER_FOUNDER . " + $where_sql"; + $result = $db->sql_query($sql); - $user_ids = $usernames = array(); + $user_ids = $usernames = array(); - while ($row = $db->sql_fetchrow($result)) - { - // Do not prune bots and the user currently pruning. - if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) + while ($row = $db->sql_fetchrow($result)) { - $user_ids[] = $row['user_id']; - $usernames[$row['user_id']] = $row['username']; + // Do not prune bots and the user currently pruning. + if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) + { + $user_ids[] = $row['user_id']; + $usernames[$row['user_id']] = $row['username']; + } } + $db->sql_freeresult($result); } - $db->sql_freeresult($result); if ($group_id) { $sql = 'SELECT u.user_id, u.username FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u WHERE ug.group_id = ' . (int) $group_id . ' + AND ug.user_id <> ' . ANONYMOUS . ' + AND u.user_type <> ' . USER_FOUNDER . ' AND ug.user_pending = 0 AND ' . $db->sql_in_set('ug.user_id', $user_ids, false, true) . ' AND u.user_id = ug.user_id'; @@ -505,8 +511,12 @@ class acp_prune $user_ids = $usernames = array(); while ($row = $db->sql_fetchrow($result)) { - $user_ids[] = $row['user_id']; - $usernames[$row['user_id']] = $row['username']; + // Do not prune bots and the user currently pruning. + if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) + { + $user_ids[] = $row['user_id']; + $usernames[$row['user_id']] = $row['username']; + } } $db->sql_freeresult($result); } @@ -516,6 +526,8 @@ class acp_prune $sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.poster_id', $user_ids, false, true) . ' + AND u.user_id <> ' . ANONYMOUS . ' + AND u.user_type <> ' . USER_FOUNDER . ' AND p.post_visibility = ' . ITEM_UNAPPROVED . ' AND u.user_id = p.poster_id GROUP BY p.poster_id @@ -526,8 +538,12 @@ class acp_prune $user_ids = $usernames = array(); while ($row = $db->sql_fetchrow($result)) { - $user_ids[] = $row['user_id']; - $usernames[$row['user_id']] = $row['username']; + // Do not prune bots and the user currently pruning. + if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) + { + $user_ids[] = $row['user_id']; + $usernames[$row['user_id']] = $row['username']; + } } $db->sql_freeresult($result); } -- cgit v1.2.1 From 7da44904025fcdb2cac5555f08c72d4e5f97f1d1 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Wed, 27 Nov 2013 21:23:32 -0800 Subject: [ticket/11507] Handle empty sets correctly. Using the last parameter in $db->sql_in_set() does not give the correct behaviour expected here. The query should not be negated if the set is empty. PHPBB3-11507 --- phpBB/includes/acp/acp_prune.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 6860fa220d..78db1eff15 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -500,8 +500,8 @@ class acp_prune WHERE ug.group_id = ' . (int) $group_id . ' AND ug.user_id <> ' . ANONYMOUS . ' AND u.user_type <> ' . USER_FOUNDER . ' - AND ug.user_pending = 0 - AND ' . $db->sql_in_set('ug.user_id', $user_ids, false, true) . ' + AND ug.user_pending = 0 ' . + ((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . ' AND u.user_id = ug.user_id'; $result = $db->sql_query($sql); @@ -525,9 +525,9 @@ class acp_prune { $sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u - WHERE ' . $db->sql_in_set('p.poster_id', $user_ids, false, true) . ' - AND u.user_id <> ' . ANONYMOUS . ' - AND u.user_type <> ' . USER_FOUNDER . ' + WHERE u.user_id <> ' . ANONYMOUS . ' + AND u.user_type <> ' . USER_FOUNDER . + ((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . ' AND p.post_visibility = ' . ITEM_UNAPPROVED . ' AND u.user_id = p.poster_id GROUP BY p.poster_id -- cgit v1.2.1 From 5d69eddcf5780db9056c7ae21a110bc815679dca Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 28 Nov 2013 13:22:25 +0100 Subject: [ticket/12045] Only display group selection if there are groups Also fixed the empty option which is not allowed. PHPBB3-12045 --- phpBB/includes/acp/acp_prune.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 78db1eff15..5d9080b55b 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -331,23 +331,30 @@ class acp_prune $s_find_active_time .= ''; } - $s_group_list = ''; $sql = 'SELECT group_id, group_name FROM ' . GROUPS_TABLE . ' WHERE group_type <> ' . GROUP_SPECIAL . ' ORDER BY group_name ASC'; $result = $db->sql_query($sql); + $s_group_list = ''; while ($row = $db->sql_fetchrow($result)) { $s_group_list .= ''; } $db->sql_freeresult($result); + if ($s_group_list) + { + // Only prepend the "All groups" option if there are groups, + // otherwise we don't want to display this option at all. + $s_group_list = '' . $s_group_list; + } + $template->assign_vars(array( 'U_ACTION' => $this->u_action, 'S_ACTIVE_OPTIONS' => $s_find_active_time, - 'S_GROUP_LIST' => $s_group_list, + 'S_GROUP_LIST' => $s_group_list, 'S_COUNT_OPTIONS' => $s_find_count, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_prune&field=users'), )); -- cgit v1.2.1 From eef1b586d5b89acda9e18b2d7b2c051e10d18ef8 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Mon, 2 Dec 2013 00:53:42 -0800 Subject: [ticket/12048] Fix the regexp for language keys in custom bbcodes. PHPBB3-12048 --- phpBB/includes/bbcode.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 9356e3e9b4..f587e111f3 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -376,7 +376,7 @@ class bbcode } // Replace {L_*} lang strings - $bbcode_tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $bbcode_tpl); + $bbcode_tpl = preg_replace('/{L_([A-Z0-9_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $bbcode_tpl); if (!empty($rowset[$bbcode_id]['second_pass_replace'])) { @@ -480,7 +480,7 @@ class bbcode 'email' => array('{EMAIL}' => '$1', '{DESCRIPTION}' => '$2') ); - $tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl); + $tpl = preg_replace('/{L_([A-Z0-9_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl); if (!empty($replacements[$tpl_name])) { -- cgit v1.2.1 From a5f1dc67b9a29b80f584ca753260fb8dbe459a43 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 3 Dec 2013 10:02:53 +0100 Subject: [ticket/12026] Remove root path, its prepended later PHPBB3-12026 --- phpBB/includes/functions_module.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 0d0f79a16d..e1259eba12 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -533,9 +533,9 @@ class p_master // 0 vendor, 1 extension name, ... if (isset($module_dir[1])) { - $module_style_dir = $phpbb_root_path . 'ext/' . $module_dir[0] . '/' . $module_dir[1] . '/styles'; + $module_style_dir = 'ext/' . $module_dir[0] . '/' . $module_dir[1] . '/styles'; - if (is_dir($module_style_dir)) + if (is_dir($phpbb_root_path . $module_style_dir)) { $template->set_style(array($module_style_dir, 'styles')); } -- cgit v1.2.1 From abb2def48d7a946fd4d0a67f88682c9fa2556223 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 4 Dec 2013 15:42:17 +0100 Subject: [ticket/11842] Use avatar_data for obtaining driver that should be deleted PHPBB3-11842 --- phpBB/includes/acp/acp_groups.php | 2 +- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/ucp/ucp_groups.php | 2 +- phpBB/includes/ucp/ucp_profile.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index d36c9cda09..b36ea1a8d8 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -383,7 +383,7 @@ class acp_groups } else { - $driver = $phpbb_avatar_manager->get_driver($user->data['user_avatar_type']); + $driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']); if ($driver) { $driver->delete($avatar_data); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index fbc1cc1f14..1a7bc2d186 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1775,7 +1775,7 @@ class acp_users } else { - $driver = $phpbb_avatar_manager->get_driver($user->data['user_avatar_type']); + $driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']); if ($driver) { $driver->delete($avatar_data); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 716289eded..7c4bc8f617 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -509,7 +509,7 @@ class ucp_groups } else { - if ($driver = $phpbb_avatar_manager->get_driver($user->data['user_avatar_type'])) + if ($driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type'])) { $driver->delete($avatar_data); } diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index f7c6aca9e8..2252b2ea17 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -603,7 +603,7 @@ class ucp_profile } else { - if ($driver = $phpbb_avatar_manager->get_driver($user->data['user_avatar_type'])) + if ($driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type'])) { $driver->delete($avatar_data); } -- cgit v1.2.1 From e110d591a93b518edca00f01823d62c4d1a0ca91 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 11 Oct 2013 18:48:09 -0700 Subject: [ticket/11241] Consolidate topic actions into "Topic tools" dropdown. PHPBB3-11241 --- phpBB/includes/functions_display.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 5592aa89ba..0ff842ea6a 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1464,6 +1464,8 @@ function phpbb_gen_download_links($param_key, $param_val, $phpbb_root_path, $php } $methods = compress::methods(); + // Sort by preferred type. + $methods = array_intersect(array('.zip', '.tar.bz2', '.tar.gz', '.tar'), $methods); $links = array(); foreach ($methods as $method) -- cgit v1.2.1