diff --git a/app/Template/user_modification/show.php b/app/Template/user_modification/show.php
index 396d550d2..506c91611 100644
--- a/app/Template/user_modification/show.php
+++ b/app/Template/user_modification/show.php
@@ -11,16 +11,16 @@
= $this->form->text('username', $values, $errors, array('required', isset($values['is_ldap_user']) && $values['is_ldap_user'] == 1 ? 'readonly' : '', 'maxlength="50"')) ?>
= $this->form->label(t('Name'), 'name') ?>
- = $this->form->text('name', $values, $errors) ?>
+ = $this->form->text('name', $values, $errors, array($this->user->hasAccess('UserModificationController', 'show/edit_name') ? '' : 'readonly')) ?>
= $this->form->label(t('Email'), 'email') ?>
- = $this->form->email('email', $values, $errors) ?>
+ = $this->form->email('email', $values, $errors, array($this->user->hasAccess('UserModificationController', 'show/edit_email') ? '' : 'readonly')) ?>
= $this->form->label(t('Timezone'), 'timezone') ?>
- = $this->form->select('timezone', $timezones, $values, $errors) ?>
+ = $this->form->select('timezone', $timezones, $values, $errors, array($this->user->hasAccess('UserModificationController', 'show/edit_timezone') ? '' : 'disabled')) ?>
= $this->form->label(t('Language'), 'language') ?>
- = $this->form->select('language', $languages, $values, $errors) ?>
+ = $this->form->select('language', $languages, $values, $errors, array($this->user->hasAccess('UserModificationController', 'show/edit_language') ? '' : 'disabled')) ?>
user->isAdmin()): ?>
= $this->form->label(t('Role'), 'role') ?>
diff --git a/app/Template/user_view/sidebar.php b/app/Template/user_view/sidebar.php
index d200a7f5f..3dc6b7bce 100644
--- a/app/Template/user_view/sidebar.php
+++ b/app/Template/user_view/sidebar.php
@@ -12,18 +12,26 @@
user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?>
-
app->checkMenuSelection('UserViewController', 'timesheet') ?>>
- = $this->url->link(t('Time tracking'), 'UserViewController', 'timesheet', array('user_id' => $user['id'])) ?>
-
- app->checkMenuSelection('UserViewController', 'lastLogin') ?>>
- = $this->url->link(t('Last logins'), 'UserViewController', 'lastLogin', array('user_id' => $user['id'])) ?>
-
- app->checkMenuSelection('UserViewController', 'sessions') ?>>
- = $this->url->link(t('Persistent connections'), 'UserViewController', 'sessions', array('user_id' => $user['id'])) ?>
-
- app->checkMenuSelection('UserViewController', 'passwordReset') ?>>
- = $this->url->link(t('Password reset history'), 'UserViewController', 'passwordReset', array('user_id' => $user['id'])) ?>
-
+ user->hasAccess('UserViewController', 'timesheet')): ?>
+ app->checkMenuSelection('UserViewController', 'timesheet') ?>>
+ = $this->url->link(t('Time tracking'), 'UserViewController', 'timesheet', array('user_id' => $user['id'])) ?>
+
+
+ user->hasAccess('UserViewController', 'lastLogin')): ?>
+ app->checkMenuSelection('UserViewController', 'lastLogin') ?>>
+ = $this->url->link(t('Last logins'), 'UserViewController', 'lastLogin', array('user_id' => $user['id'])) ?>
+
+
+ user->hasAccess('UserViewController', 'sessions')): ?>
+ app->checkMenuSelection('UserViewController', 'sessions') ?>>
+ = $this->url->link(t('Persistent connections'), 'UserViewController', 'sessions', array('user_id' => $user['id'])) ?>
+
+
+ user->hasAccess('UserViewController', 'passwordReset')): ?>
+ app->checkMenuSelection('UserViewController', 'passwordReset') ?>>
+ = $this->url->link(t('Password reset history'), 'UserViewController', 'passwordReset', array('user_id' => $user['id'])) ?>
+
+
= $this->hook->render('template:user:sidebar:information', array('user' => $user)) ?>
@@ -42,13 +50,13 @@
-
+ user->hasAccess('UserCredentialController', 'changePassword')): ?>
app->checkMenuSelection('UserCredentialController', 'changePassword') ?>>
= $this->url->link(t('Change password'), 'UserCredentialController', 'changePassword', array('user_id' => $user['id'])) ?>
- user->isCurrentUser($user['id'])): ?>
+ user->isCurrentUser($user['id']) && $this->user->hasAccess('TwoFactorController', 'index')): ?>
app->checkMenuSelection('TwoFactorController', 'index') ?>>
= $this->url->link(t('Two factor authentication'), 'TwoFactorController', 'index', array('user_id' => $user['id'])) ?>
@@ -58,18 +66,26 @@
- app->checkMenuSelection('UserViewController', 'share') ?>>
- = $this->url->link(t('Public access'), 'UserViewController', 'share', array('user_id' => $user['id'])) ?>
-
- app->checkMenuSelection('UserViewController', 'notifications') ?>>
- = $this->url->link(t('Notifications'), 'UserViewController', 'notifications', array('user_id' => $user['id'])) ?>
-
- app->checkMenuSelection('UserViewController', 'external') ?>>
- = $this->url->link(t('External accounts'), 'UserViewController', 'external', array('user_id' => $user['id'])) ?>
-
- app->checkMenuSelection('UserViewController', 'integrations') ?>>
- = $this->url->link(t('Integrations'), 'UserViewController', 'integrations', array('user_id' => $user['id'])) ?>
-
+ user->hasAccess('UserViewController', 'share')): ?>
+ app->checkMenuSelection('UserViewController', 'share') ?>>
+ = $this->url->link(t('Public access'), 'UserViewController', 'share', array('user_id' => $user['id'])) ?>
+
+
+ user->hasAccess('UserViewController', 'notifications')): ?>
+ app->checkMenuSelection('UserViewController', 'notifications') ?>>
+ = $this->url->link(t('Notifications'), 'UserViewController', 'notifications', array('user_id' => $user['id'])) ?>
+
+
+ user->hasAccess('UserViewController', 'external')): ?>
+ app->checkMenuSelection('UserViewController', 'external') ?>>
+ = $this->url->link(t('External accounts'), 'UserViewController', 'external', array('user_id' => $user['id'])) ?>
+
+
+ user->hasAccess('UserViewController', 'integrations')): ?>
+ app->checkMenuSelection('UserViewController', 'integrations') ?>>
+ = $this->url->link(t('Integrations'), 'UserViewController', 'integrations', array('user_id' => $user['id'])) ?>
+
+
user->hasAccess('UserCredentialController', 'changeAuthentication')): ?>