Permalink
Browse files

Removed avatar changing field from management panel. Closes #80.

  • Loading branch information...
flashwave committed Dec 1, 2018
1 parent dfaf1f6 commit 550769df7a68009018c720638024c7ca08b6bfec
@@ -46,7 +46,7 @@
'manage_users_range' => $usersTake,
'manage_users_offset' => $queryQffset,
]);
echo tpl_render('manage.users.listing');
echo tpl_render('manage.users.users');
break;
case 'view':
@@ -141,12 +141,6 @@
$updateUserDetails->execute();
}
if (!empty($_POST['avatar']) && !empty($_POST['avatar']['delete'])) {
user_avatar_delete($manageUser['user_id']);
} elseif (!empty($_FILES['avatar'])) {
user_avatar_set_from_path($manageUser['user_id'], $_FILES['avatar']['tmp_name']['file']);
}
if (!empty($_POST['colour']) && is_array($_POST['colour'])) {
$userColour = null;
@@ -249,7 +243,7 @@
'view_user' => $manageUser,
'profile_fields' => user_profile_fields_get(),
]);
echo tpl_render('manage.users.view');
echo tpl_render('manage.users.user');
break;
case 'roles':
@@ -465,6 +459,6 @@
tpl_vars(['edit_role' => $editRole]);
}
echo tpl_render('manage.users.roles_create');
echo tpl_render('manage.users.role');
break;
}
@@ -132,10 +132,6 @@
}
}
tpl_add_filter('log_format', function (string $text, string $json): string {
return vsprintf($text, json_decode($json));
});
$sessions = [
'list' => [],
'active' => user_session_current('session_id'),
@@ -22,6 +22,9 @@ public function getFilters()
new Twig_Filter('bg_settings', 'user_background_settings_strings'),
new Twig_Filter('colour_contrast', 'colour_get_css_contrast'),
new Twig_Filter('colour_props', 'colour_get_properties'),
new Twig_Filter('log_format', function (string $text, string $json): string {
return vsprintf($text, json_decode($json));
}),
];
}
@@ -47,16 +47,6 @@ function tpl_sanitise_path(string $path): string
return str_replace('.', '/', $path) . MSZ_TPL_FILE_EXT;
}
function tpl_add_function(string $name, callable $callable = null): void
{
Twig::instance()->addFunction(new Twig_SimpleFunction($name, $callable === null ? $name : $callable));
}
function tpl_add_filter(string $name, callable $callable = null): void
{
Twig::instance()->addFilter(new Twig_SimpleFilter($name, $callable === null ? $name : $callable));
}
function tpl_exists(string $path): bool
{
return Twig::instance()->getLoader()->exists(tpl_sanitise_path($path));
@@ -10,6 +10,12 @@
<form method="post" enctype="multipart/form-data" action=""{% if view_user is defined %} style="{{ view_user.user_colour|html_colour('--accent-colour') }}"{% endif %}>
{{ input_csrf('users_edit') }}
<div class="warning">
<div class="warning__content">
Profile fields and avatar can be edited through a user's profile.
</div>
</div>
<div class="container">
{{ container_title('Viewing ' ~ view_user.username ~ ' (' ~ view_user.user_id ~ ')') }}
@@ -70,24 +76,6 @@
</label>
</div>
<div class="container">
{{ container_title('Avatar') }}
<label class="form__label">
<div class="form__label__text">New Avatar</div>
<div class="form__label__input">
{{ input_file('avatar[file]') }}
</div>
</label>
<label class="form__label">
<div class="form__label__text">Delete Avatar</div>
<div class="form__label__input">
{{ input_checkbox('avatar[delete]') }}
</div>
</label>
</div>
<div class="container">
{{ container_title('Password') }}

0 comments on commit 550769d

Please sign in to comment.