Improve avatar upload form
This commit is contained in:
@@ -14,6 +14,7 @@ New features:
|
|||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
|
* Improve Avatar upload form
|
||||||
* User roles are synced with LDAP at each login
|
* User roles are synced with LDAP at each login
|
||||||
* Added support for Mysql SSL connection
|
* Added support for Mysql SSL connection
|
||||||
* Improve web page title on the task view
|
* Improve web page title on the task view
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ class RouteProvider implements ServiceProviderInterface
|
|||||||
$container['route']->addRoute('user/:user_id/integrations', 'user', 'integrations');
|
$container['route']->addRoute('user/:user_id/integrations', 'user', 'integrations');
|
||||||
$container['route']->addRoute('user/:user_id/authentication', 'user', 'authentication');
|
$container['route']->addRoute('user/:user_id/authentication', 'user', 'authentication');
|
||||||
$container['route']->addRoute('user/:user_id/2fa', 'twofactor', 'index');
|
$container['route']->addRoute('user/:user_id/2fa', 'twofactor', 'index');
|
||||||
|
$container['route']->addRoute('user/:user_id/avatar', 'AvatarFile', 'show');
|
||||||
|
|
||||||
// Groups
|
// Groups
|
||||||
$container['route']->addRoute('groups', 'group', 'index');
|
$container['route']->addRoute('groups', 'group', 'index');
|
||||||
|
|||||||
@@ -4,17 +4,20 @@
|
|||||||
|
|
||||||
<?= $this->avatar->render($user['id'], $user['username'], $user['name'], $user['email'], $user['avatar_path'], '') ?>
|
<?= $this->avatar->render($user['id'], $user['username'], $user['name'], $user['email'], $user['avatar_path'], '') ?>
|
||||||
|
|
||||||
|
<div class="form-actions">
|
||||||
|
<?php if (! empty($user['avatar_path'])): ?>
|
||||||
|
<?= $this->url->link(t('Remove my image'), 'AvatarFile', 'remove', array('user_id' => $user['id']), true, 'btn btn-red') ?>
|
||||||
|
<?php endif ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h3><?= t('Upload my avatar image') ?></h3>
|
||||||
<form method="post" enctype="multipart/form-data" action="<?= $this->url->href('AvatarFile', 'upload', array('user_id' => $user['id'])) ?>">
|
<form method="post" enctype="multipart/form-data" action="<?= $this->url->href('AvatarFile', 'upload', array('user_id' => $user['id'])) ?>">
|
||||||
<?= $this->form->csrf() ?>
|
<?= $this->form->csrf() ?>
|
||||||
<?= $this->form->label(t('Upload my avatar image'), 'avatar') ?>
|
|
||||||
<?= $this->form->file('avatar') ?>
|
<?= $this->form->file('avatar') ?>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<?php if (! empty($user['avatar_path'])): ?>
|
<button type="submit" class="btn btn-blue"><?= t('Upload my avatar image') ?></button>
|
||||||
<?= $this->url->link(t('Remove my image'), 'AvatarFile', 'remove', array('user_id' => $user['id']), true, 'btn btn-red') ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
|
||||||
<?= t('or') ?>
|
|
||||||
<?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user