mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
Adding a few safeguards to stop people from breaking their own boards ;)
Translators, I'm sorry but this means some work for you. git-svn-id: file:///svn/phpbb/trunk@7713 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
498b87df10
commit
22f5b1aff6
4 changed files with 40 additions and 14 deletions
|
@ -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>
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
trigger_error($user->lang[$error] . $return_page);
|
||||
// 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
|
||||
{
|
||||
$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>'));
|
||||
|
|
|
@ -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.',
|
||||
|
|
Loading…
Add table
Reference in a new issue