mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Fix bug #13673 - Add confirm-box when deleting permissions
Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9652 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ffa5a33702
commit
588dd7337f
2 changed files with 43 additions and 24 deletions
|
@ -158,6 +158,7 @@
|
|||
<li>[Feature] Add new option to disable avatars board-wide (Bug #46785 - Patch by cYbercOsmOnauT and nickvergessen)</li>
|
||||
<li>[Feature] Enhance obtain_users_online_string to be able to return user-lists for other session-items (Bug #31975 - Patch by nickvergessen)</li>
|
||||
<li>[Feature] Add unapproved topic icon for moderators on forum list (Bug #46865 - Patch by nickvergessen)</li>
|
||||
<li>[Feature] Add confirm-box when deleting permissions (Bug #13673 - Patch by nickvergessen)</li>
|
||||
</ul>
|
||||
<a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3>
|
||||
|
||||
|
|
|
@ -217,43 +217,61 @@ class acp_permissions
|
|||
trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
// Handle actions
|
||||
if (strpos($mode, 'setting_') === 0 && $action)
|
||||
{
|
||||
switch ($action)
|
||||
{
|
||||
case 'delete':
|
||||
|
||||
if (!check_form_key($form_name))
|
||||
if (confirm_box(true))
|
||||
{
|
||||
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
// All users/groups selected?
|
||||
$all_users = (isset($_POST['all_users'])) ? true : false;
|
||||
$all_groups = (isset($_POST['all_groups'])) ? true : false;
|
||||
// All users/groups selected?
|
||||
$all_users = (isset($_POST['all_users'])) ? true : false;
|
||||
$all_groups = (isset($_POST['all_groups'])) ? true : false;
|
||||
|
||||
if ($all_users || $all_groups)
|
||||
{
|
||||
$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
|
||||
|
||||
if ($all_users && sizeof($items['user_ids']))
|
||||
if ($all_users || $all_groups)
|
||||
{
|
||||
$user_id = $items['user_ids'];
|
||||
}
|
||||
else if ($all_groups && sizeof($items['group_ids']))
|
||||
{
|
||||
$group_id = $items['group_ids'];
|
||||
}
|
||||
}
|
||||
$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
|
||||
|
||||
if (sizeof($user_id) || sizeof($group_id))
|
||||
{
|
||||
$this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id);
|
||||
if ($all_users && sizeof($items['user_ids']))
|
||||
{
|
||||
$user_id = $items['user_ids'];
|
||||
}
|
||||
else if ($all_groups && sizeof($items['group_ids']))
|
||||
{
|
||||
$group_id = $items['group_ids'];
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($user_id) || sizeof($group_id))
|
||||
{
|
||||
$this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
$s_hidden_fields = array(
|
||||
'i' => $id,
|
||||
'mode' => $mode,
|
||||
'action' => array($action => 1),
|
||||
'user_id' => $user_id,
|
||||
'group_id' => $group_id,
|
||||
'forum_id' => $forum_id,
|
||||
'type' => $permission_type,
|
||||
);
|
||||
if (isset($_POST['all_users']))
|
||||
{
|
||||
$s_hidden_fields['all_users'] = 1;
|
||||
}
|
||||
if (isset($_POST['all_groups']))
|
||||
{
|
||||
$s_hidden_fields['all_groups'] = 1;
|
||||
}
|
||||
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue