[ticket/8777] Discourage deleting user with only one group

It will still be possible from the manage groups page though is discouraged
now by hiding the delete entry when managing users.

In addition to this, the manage user page will now show that no group is
specified for the user when viewing the groups page of a user.

PHPBB3-8777
This commit is contained in:
Marc Alexander 2023-07-04 08:43:54 +02:00
parent 5f825002b6
commit cca85f648b
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
2 changed files with 6 additions and 2 deletions

View file

@ -137,9 +137,13 @@
<td><a href="{group.U_EDIT_GROUP}">{group.GROUP_NAME}</a></td>
<td><!-- IF group.S_IS_MEMBER --><!-- IF group.S_NO_DEFAULT --><a href="{group.U_DEFAULT}">{L_GROUP_DEFAULT}</a><!-- ELSE --><strong>{L_GROUP_DEFAULT}</strong><!-- ENDIF --><!-- ELSEIF not group.S_IS_MEMBER and group.U_APPROVE --><a href="{group.U_APPROVE}">{L_GROUP_APPROVE}</a><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
<td><!-- IF group.S_IS_MEMBER and not group.S_SPECIAL_GROUP --><a href="{group.U_DEMOTE_PROMOTE}">{group.L_DEMOTE_PROMOTE}</a><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
<td><a href="{group.U_DELETE}">{L_GROUP_DELETE}</a></td>
<td>{% if group.U_DELETE %}<a href="{{ group.U_DELETE }}">{{ lang('GROUP_DELETE') }}</a>{% endif %}</td>
</tr>
<!-- ENDIF -->
<!-- BEGINELSE -->
<tr>
<td class="row3 centered-text" colspan="4">{{ lang('NO_GROUP') }}</td>
</tr>
<!-- END group -->
</tbody>
</table>

View file

@ -2515,7 +2515,7 @@ class acp_users
'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g={$data['group_id']}&amp;back_link=acp_users_groups"),
'U_DEFAULT' => $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'] . '&amp;hash=' . generate_link_hash('acp_users'),
'U_DEMOTE_PROMOTE' => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'] . '&amp;hash=' . generate_link_hash('acp_users'),
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_DELETE' => count($id_ary) > 1 ? $this->u_action . "&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id'] : '',
'U_APPROVE' => ($group_type == 'pending') ? $this->u_action . "&amp;action=approve&amp;u=$user_id&amp;g=" . $data['group_id'] : '',
'GROUP_NAME' => $group_helper->get_name($data['group_name']),