diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 4 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 17 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_groups.php | 29 | ||||
-rw-r--r-- | phpBB/language/en/acp/groups.php | 4 |
4 files changed, 40 insertions, 14 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7cba0361a5..109801c4d4 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -234,6 +234,10 @@ p a { <li>[Fix] Do not permit the decimal as a valid prefix character (Bug #11967)</li> <li>[Fix] Account for the fact that the IM fields might hold non-IM information</li> <li>[Fix] Make the queue function on post details</li> + <li>[Fix] Check if there are active styles left before deleting a style</li> + <li>[Fix] Correctly update styles after the deletion of an imageset.</li> + <li>[Sec] Adding confirm boxes to UCP group actions</li> + </ul> diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 582b25f5c5..89dcf2005d 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -1462,12 +1462,14 @@ parse_css_file = {PARSE_CSS_FILE} $new_id = request_var('new_id', 0); $update = (isset($_POST['update'])) ? true : false; + $sql_where = ''; switch ($mode) { case 'style': $sql_from = STYLES_TABLE; $sql_select = 'style_name'; + $sql_where = 'AND style_active = 1'; break; case 'template': @@ -1502,7 +1504,8 @@ parse_css_file = {PARSE_CSS_FILE} $sql = "SELECT {$mode}_id, {$mode}_name FROM $sql_from - WHERE {$mode}_id <> $style_id + WHERE {$mode}_id <> $style_id + $sql_where ORDER BY {$mode}_name ASC"; $result = $db->sql_query($sql); @@ -1545,14 +1548,14 @@ parse_css_file = {PARSE_CSS_FILE} set_config('default_style', $new_id); } } - else if ($mode == 'imageset') - { - $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " - WHERE imageset_id = $style_id"; - $db->sql_query($sql); - } else { + if ($mode == 'imageset') + { + $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " + WHERE imageset_id = $style_id"; + $db->sql_query($sql); + } $sql = 'UPDATE ' . STYLES_TABLE . " SET {$mode}_id = $new_id WHERE {$mode}_id = $style_id"; diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 99371d2024..4789da1f5a 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -943,14 +943,14 @@ class ucp_groups $user->add_lang(array('acp/groups', 'acp/common')); - $name_ary = request_var('usernames', '', true); + $names = request_var('usernames', '', true); if (!$group_id) { trigger_error($user->lang['NO_GROUP'] . $return_page); } - if (!$name_ary) + if (!$names) { trigger_error($user->lang['NO_USERS'] . $return_page); } @@ -966,15 +966,30 @@ class ucp_groups trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); } - $name_ary = array_unique(explode("\n", $name_ary)); + $name_ary = array_unique(explode("\n", $names)); $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; $default = request_var('default', 0); - - // Add user/s to group - if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row)) + + if (confirm_box(true)) + { + // Add user/s to group + if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row)) + { + trigger_error($user->lang[$error] . $return_page); + } + } + else { - trigger_error($user->lang[$error] . $return_page); + $s_hidden_fields = array( + 'default' => $default, + 'usernames' => $names, + 'g' => $group_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action + ); + confirm_box(false, sprintf($user->lang['GROUP_CONFIRM_ADD_USER' . ((sizeof($name_ary) == 1) ? '' : 'S')], implode(', ', $name_ary)), build_hidden_fields($s_hidden_fields)); } trigger_error($user->lang['GROUP_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>')); diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index c831a87981..668195c6b6 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -41,6 +41,7 @@ $lang = array_merge($lang, array( 'GROUPS_NO_MEMBERS' => 'This group has no members', 'GROUPS_NO_MODS' => 'No group leaders defined', + 'GROUP_APPROVE' => 'Approve member', 'GROUP_APPROVED' => 'Approved members', 'GROUP_AVATAR' => 'Group avatar', @@ -48,6 +49,8 @@ $lang = array_merge($lang, array( 'GROUP_CLOSED' => 'Closed', 'GROUP_COLOR' => 'Group colour', 'GROUP_COLOR_EXPLAIN' => 'Defines the colour members usernames will appear in, leave blank for user default.', + 'GROUP_CONFIRM_ADD_USER' => 'Are you sure that you want to add the user %1$s to the group?', + 'GROUP_CONFIRM_ADD_USERS' => 'Are you sure that you want to add the users %1$s to the group?', 'GROUP_CREATED' => 'Group has been created successfully.', 'GROUP_DEFAULT' => 'Make group default for member', 'GROUP_DEFS_UPDATED' => 'Default group set for all selected members.', @@ -90,6 +93,7 @@ $lang = array_merge($lang, array( 'GROUP_TYPE' => 'Group type', 'GROUP_TYPE_EXPLAIN' => 'This determines which users can join or view this group.', 'GROUP_UPDATED' => 'Group preferences updated successfully.', + 'GROUP_USERS_ADDED' => 'New users added to group successfully.', 'GROUP_USERS_EXIST' => 'The selected users are already members.', 'GROUP_USERS_REMOVE' => 'Users removed from group and new defaults set successfully.', |