diff options
author | Daniel Sinn <daniel.p.sinn@gmail.com> | 2016-10-03 10:24:30 -0400 |
---|---|---|
committer | Daniel Sinn <daniel.p.sinn@gmail.com> | 2016-10-03 10:24:30 -0400 |
commit | 59b52d6312cd10631532f6d1dcdabef141081fdc (patch) | |
tree | 90e1a1a96aa94d7822e8bb501c3069453ece0f82 /phpBB/includes | |
parent | 32d569c59464a80eb8c78a98b1953de0aa1008d8 (diff) | |
parent | 85e4566223487899f3a2789983cb50e68296a982 (diff) | |
download | forums-59b52d6312cd10631532f6d1dcdabef141081fdc.tar forums-59b52d6312cd10631532f6d1dcdabef141081fdc.tar.gz forums-59b52d6312cd10631532f6d1dcdabef141081fdc.tar.bz2 forums-59b52d6312cd10631532f6d1dcdabef141081fdc.tar.xz forums-59b52d6312cd10631532f6d1dcdabef141081fdc.zip |
[ticket/14804] Merge remote-tracking branch 'upstream/3.1.x' into ticket/14804
PHPBB3-14804
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_database.php | 10 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_icons.php | 22 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 10 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 8 |
4 files changed, 37 insertions, 13 deletions
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 16655ff4cb..dd0599e06a 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -42,11 +42,6 @@ class acp_database $form_key = 'acp_database'; add_form_key($form_key); - if ($submit && !check_form_key($form_key)) - { - trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); - } - $template->assign_vars(array( 'MODE' => $mode )); @@ -70,6 +65,11 @@ class acp_database trigger_error($user->lang['TABLE_SELECT_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING); } + if (!check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $store = $download = $structure = $schema_data = false; if ($where == 'store_and_download' || $where == 'store') diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index e9bc02d88b..a0ea7dc9b1 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -45,11 +45,6 @@ class acp_icons $form_key = 'acp_icons'; add_form_key($form_key); - if ($submit && !check_form_key($form_key)) - { - trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); - } - $mode = ($mode == 'smilies') ? 'smilies' : 'icons'; $this->tpl_name = 'acp_icons'; @@ -334,6 +329,11 @@ class acp_icons case 'create': case 'modify': + if (!check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + // Get items to create/modify $images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array(); @@ -522,6 +522,11 @@ class acp_icons { $order = 0; + if (!check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak))) { trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -707,7 +712,7 @@ class acp_icons $template->assign_vars(array( 'MESSAGE_TITLE' => $user->lang['EXPORT_' . $lang], - 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $this->u_action . '&action=send">', '</a>'), + 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $this->u_action . '&action=send&hash=' . generate_link_hash('acp_icons') . '">', '</a>'), 'S_USER_NOTICE' => true, ) @@ -719,6 +724,11 @@ class acp_icons case 'send': + if (!check_link_hash($request->variable('hash', ''), 'acp_icons')) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $sql = "SELECT * FROM $table ORDER BY {$fields}_order"; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 1ea266815d..1e453e88ad 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2274,6 +2274,12 @@ class acp_users { trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } + + if (!check_link_hash($request->variable('hash', ''), 'acp_users')) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + group_user_attributes($action, $group_id, $user_id); if ($action == 'default') @@ -2431,8 +2437,8 @@ class acp_users { $template->assign_block_vars('group', array( 'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&mode=manage&action=edit&u=$user_id&g={$data['group_id']}&back_link=acp_users_groups"), - 'U_DEFAULT' => $this->u_action . "&action=default&u=$user_id&g=" . $data['group_id'], - 'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'], + 'U_DEFAULT' => $this->u_action . "&action=default&u=$user_id&g=" . $data['group_id'] . '&hash=' . generate_link_hash('acp_users'), + 'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'] . '&hash=' . generate_link_hash('acp_users'), 'U_DELETE' => $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'], 'U_APPROVE' => ($group_type == 'pending') ? $this->u_action . "&action=approve&u=$user_id&g=" . $data['group_id'] : '', diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 87f2e558f5..0fb8bf1109 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -420,9 +420,11 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) } $sync_forums = array(); + $topic_views = 0; foreach ($all_topic_data as $data) { $sync_forums[$data['forum_id']] = $data['forum_id']; + $topic_views += $data['topic_views']; } $to_topic_data = $all_topic_data[$to_topic_id]; @@ -478,6 +480,12 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) move_posts($post_id_list, $to_topic_id, false); add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $to_topic_data['topic_title']); + // Update topic views count + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_views = ' . $topic_views . ' + WHERE topic_id = ' . $to_topic_id; + $db->sql_query($sql); + // Message and return links $success_msg = 'POSTS_MERGED_SUCCESS'; |