Fixed mobile menu no longer working.
This commit is contained in:
parent
c30d29faf0
commit
ff93ddf20e
4 changed files with 9 additions and 12 deletions
|
@ -18,10 +18,7 @@ if($userId < 1) {
|
||||||
$isSuperUser = user_check_super($currentUserId);
|
$isSuperUser = user_check_super($currentUserId);
|
||||||
$canEdit = $isSuperUser || user_check_authority($currentUserId, $userId);
|
$canEdit = $isSuperUser || user_check_authority($currentUserId, $userId);
|
||||||
$canEditPerms = $canEdit && perms_check_user(MSZ_PERMS_USER, $currentUserId, MSZ_PERM_USER_MANAGE_PERMS);
|
$canEditPerms = $canEdit && perms_check_user(MSZ_PERMS_USER, $currentUserId, MSZ_PERM_USER_MANAGE_PERMS);
|
||||||
|
$permissions = manage_perms_list(perms_get_user_raw($userId));
|
||||||
if($canEditPerms) {
|
|
||||||
$permissions = manage_perms_list(perms_get_user_raw($userId));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(csrf_verify('users_edit', $_POST['csrf'] ?? '') && $canEdit) {
|
if(csrf_verify('users_edit', $_POST['csrf'] ?? '') && $canEdit) {
|
||||||
if(!empty($_POST['roles']) && is_array($_POST['roles']) && array_test($_POST['roles'], 'ctype_digit')) {
|
if(!empty($_POST['roles']) && is_array($_POST['roles']) && array_test($_POST['roles'], 'ctype_digit')) {
|
||||||
|
@ -188,7 +185,7 @@ if(csrf_verify('users_edit', $_POST['csrf'] ?? '') && $canEdit) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($permissions) && !empty($_POST['perms']) && is_array($_POST['perms'])) {
|
if($canEditPerms && !empty($_POST['perms']) && is_array($_POST['perms'])) {
|
||||||
$perms = manage_perms_apply($permissions, $_POST['perms']);
|
$perms = manage_perms_apply($permissions, $_POST['perms']);
|
||||||
|
|
||||||
if($perms !== null) {
|
if($perms !== null) {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
{% macro input_checkbox_raw(name, checked, class, value, radio, attributes, disabled) %}
|
{% macro input_checkbox_raw(name, checked, class, value, radio, attributes, disabled) %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
<input type="{{ radio ? 'radio' : 'checkbox' }}" class="{{ class|length > 0 ? class : 'input__checkbox__input' }}"
|
<input type="{{ radio ? 'radio' : 'checkbox' }}" class="{{ class|length > 0 ? class : 'input__checkbox__input' }}"
|
||||||
{% if name|length > 0 %}name="{{ name }}"{% else %}readonly onclick="return false"{% endif %}
|
{% if name|length > 0 %}name="{{ name }}"{% endif %}
|
||||||
{% if checked %}checked{% endif %}
|
{% if checked %}checked{% endif %}
|
||||||
{% if disabled %}disabled{% endif %}
|
{% if disabled %}disabled{% endif %}
|
||||||
{% if value|length > 0 %}value="{{ value }}"{% endif %}
|
{% if value|length > 0 %}value="{{ value }}"{% endif %}
|
||||||
|
|
|
@ -40,13 +40,13 @@
|
||||||
{{ perm.title }}
|
{{ perm.title }}
|
||||||
</div>
|
</div>
|
||||||
<div class="permissions__choice__wrapper">
|
<div class="permissions__choice__wrapper">
|
||||||
{{ input_checkbox(readonly ? '' : 'perms[' ~ perms.section ~ '][' ~ perm.section ~ '][value]', '', perm.value == 'yes', 'permissions__choice permissions__choice--radio permissions__choice--yes', 'yes', true) }}
|
{{ input_checkbox('perms[' ~ perms.section ~ '][' ~ perm.section ~ '][value]', '', perm.value == 'yes', 'permissions__choice permissions__choice--radio permissions__choice--yes', 'yes', true, null, readonly) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="permissions__choice__wrapper">
|
<div class="permissions__choice__wrapper">
|
||||||
{{ input_checkbox(readonly ? '' : 'perms[' ~ perms.section ~ '][' ~ perm.section ~ '][value]', '', perm.value == 'no', 'permissions__choice permissions__choice--radio permissions__choice--no', 'no', true) }}
|
{{ input_checkbox('perms[' ~ perms.section ~ '][' ~ perm.section ~ '][value]', '', perm.value == 'no', 'permissions__choice permissions__choice--radio permissions__choice--no', 'no', true, null, readonly) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="permissions__choice__wrapper">
|
<div class="permissions__choice__wrapper">
|
||||||
{{ input_checkbox(readonly ? '' : 'perms[' ~ perms.section ~ '][' ~ perm.section ~ '][value]', '', perm.value == 'never', 'permissions__choice permissions__choice--radio permissions__choice--never', 'never', true) }}
|
{{ input_checkbox('perms[' ~ perms.section ~ '][' ~ perm.section ~ '][value]', '', perm.value == 'never', 'permissions__choice permissions__choice--radio permissions__choice--never', 'never', true, null, readonly) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
<label class="form__label">
|
<label class="form__label">
|
||||||
<div class="form__label__text">Custom Colour</div>
|
<div class="form__label__text">Custom Colour</div>
|
||||||
<div class="form__label__input">
|
<div class="form__label__input">
|
||||||
{{ input_checkbox(can_edit_user ? 'colour[enable]' : '', '', manage_user.user_colour is not null and not manage_user.user_colour|colour_inherit) }}
|
{{ input_checkbox('colour[enable]', '', manage_user.user_colour is not null and not manage_user.user_colour|colour_inherit, '', '', false, null, not can_edit_user) }}
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
@ -113,11 +113,11 @@
|
||||||
<label class="manage__tag" style="{{ role.role_colour|html_colour('--accent-colour') }}">
|
<label class="manage__tag" style="{{ role.role_colour|html_colour('--accent-colour') }}">
|
||||||
<div class="manage__tag__background"></div>
|
<div class="manage__tag__background"></div>
|
||||||
<div class="manage__tag__content">
|
<div class="manage__tag__content">
|
||||||
{{ input_checkbox(can_edit_user ? 'roles[]' : '', '', role.has_role, 'manage__tag__checkbox', role.role_id) }}
|
{{ input_checkbox('roles[]', '', role.has_role, 'manage__tag__checkbox', role.role_id, false, null, not can_edit_user) }}
|
||||||
<div class="manage__tag__title">
|
<div class="manage__tag__title">
|
||||||
{{ role.role_name }}
|
{{ role.role_name }}
|
||||||
</div>
|
</div>
|
||||||
{{ input_checkbox(can_edit_user ? 'user[display_role]' : '', '', role.role_id == manage_user.display_role, 'manage__tag__checkbox', role.role_id, true) }}
|
{{ input_checkbox('user[display_role]', '', role.role_id == manage_user.display_role, 'manage__tag__checkbox', role.role_id, true, null, not can_edit_user) }}
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Add table
Reference in a new issue