summaryrefslogtreecommitdiff
path: root/app/Templates
diff options
context:
space:
mode:
Diffstat (limited to 'app/Templates')
-rw-r--r--app/Templates/config_index.php174
-rw-r--r--app/Templates/layout.php10
-rw-r--r--app/Templates/user_edit.php93
-rw-r--r--app/Templates/user_external.php39
-rw-r--r--app/Templates/user_index.php35
-rw-r--r--app/Templates/user_last.php24
-rw-r--r--app/Templates/user_layout.php19
-rw-r--r--app/Templates/user_new.php6
-rw-r--r--app/Templates/user_notifications.php22
-rw-r--r--app/Templates/user_password.php23
-rw-r--r--app/Templates/user_remove.php20
-rw-r--r--app/Templates/user_sessions.php26
-rw-r--r--app/Templates/user_show.php12
-rw-r--r--app/Templates/user_sidebar.php42
14 files changed, 321 insertions, 224 deletions
diff --git a/app/Templates/config_index.php b/app/Templates/config_index.php
index 11662c87..98b8b28d 100644
--- a/app/Templates/config_index.php
+++ b/app/Templates/config_index.php
@@ -1,143 +1,67 @@
<section id="main">
- <?php if ($user['is_admin']): ?>
- <div class="page-header">
- <h2><?= t('Application settings') ?></h2>
- </div>
- <section>
- <form method="post" action="?controller=config&amp;action=save" autocomplete="off">
-
- <?= Helper\form_csrf() ?>
-
- <?= Helper\form_label(t('Language'), 'language') ?>
- <?= Helper\form_select('language', $languages, $values, $errors) ?><br/>
-
- <?= Helper\form_label(t('Timezone'), 'timezone') ?>
- <?= Helper\form_select('timezone', $timezones, $values, $errors) ?><br/>
-
- <?= Helper\form_label(t('Webhook URL for task creation'), 'webhooks_url_task_creation') ?>
- <?= Helper\form_text('webhooks_url_task_creation', $values, $errors) ?><br/>
-
- <?= Helper\form_label(t('Webhook URL for task modification'), 'webhooks_url_task_modification') ?>
- <?= Helper\form_text('webhooks_url_task_modification', $values, $errors) ?><br/>
-
- <div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- </div>
- </form>
- </section>
- <?php endif ?>
-
<div class="page-header">
- <h2><?= t('User settings') ?></h2>
+ <h2><?= t('Application settings') ?></h2>
</div>
<section>
- <h3 id="notifications"><?= t('Email notifications') ?></h3>
- <form method="post" action="?controller=config&amp;action=notifications" autocomplete="off">
+ <form method="post" action="?controller=config&amp;action=save" autocomplete="off">
- <?= Helper\form_csrf() ?>
+ <?= Helper\form_csrf() ?>
- <?= Helper\form_checkbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?><br/>
+ <?= Helper\form_label(t('Language'), 'language') ?>
+ <?= Helper\form_select('language', $languages, $values, $errors) ?><br/>
- <p><?= t('I want to receive notifications only for those projects:') ?><br/><br/></p>
+ <?= Helper\form_label(t('Timezone'), 'timezone') ?>
+ <?= Helper\form_select('timezone', $timezones, $values, $errors) ?><br/>
- <div class="form-checkbox-group">
- <?php foreach ($user_projects as $project_id => $project_name): ?>
- <?= Helper\form_checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?>
- <?php endforeach ?>
- </div>
- <div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- </div>
- </form>
- </section>
+ <?= Helper\form_label(t('Webhook URL for task creation'), 'webhooks_url_task_creation') ?>
+ <?= Helper\form_text('webhooks_url_task_creation', $values, $errors) ?><br/>
- <?php if ($user['is_admin']): ?>
- <div class="page-header">
- <h2><?= t('More information') ?></h2>
+ <?= Helper\form_label(t('Webhook URL for task modification'), 'webhooks_url_task_modification') ?>
+ <?= Helper\form_text('webhooks_url_task_modification', $values, $errors) ?><br/>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
- <section class="settings">
- <ul>
- <li><a href="?controller=config&amp;action=tokens<?= Helper\param_csrf() ?>"><?= t('Reset all tokens') ?></a></li>
- <li>
- <?= t('Webhooks token:') ?>
- <strong><?= Helper\escape($values['webhooks_token']) ?></strong>
- </li>
+ </form>
+ </section>
+
+ <div class="page-header">
+ <h2><?= t('More information') ?></h2>
+ </div>
+ <section class="settings">
+ <ul>
+ <li><a href="?controller=config&amp;action=tokens<?= Helper\param_csrf() ?>"><?= t('Reset all tokens') ?></a></li>
+ <li>
+ <?= t('Webhooks token:') ?>
+ <strong><?= Helper\escape($values['webhooks_token']) ?></strong>
+ </li>
+ <li>
+ <?= t('API token:') ?>
+ <strong><?= Helper\escape($values['api_token']) ?></strong>
+ </li>
+ <?php if (DB_DRIVER === 'sqlite'): ?>
<li>
- <?= t('API token:') ?>
- <strong><?= Helper\escape($values['api_token']) ?></strong>
+ <?= t('Database size:') ?>
+ <strong><?= Helper\format_bytes($db_size) ?></strong>
</li>
- <?php if (DB_DRIVER === 'sqlite'): ?>
- <li>
- <?= t('Database size:') ?>
- <strong><?= Helper\format_bytes($db_size) ?></strong>
- </li>
- <li>
- <a href="?controller=config&amp;action=downloadDb<?= Helper\param_csrf() ?>"><?= t('Download the database') ?></a>
- <?= t('(Gzip compressed Sqlite file)') ?>
- </li>
- <li>
- <a href="?controller=config&amp;action=optimizeDb <?= Helper\param_csrf() ?>"><?= t('Optimize the database') ?></a>
- <?= t('(VACUUM command)') ?>
- </li>
- <?php endif ?>
<li>
- <?= t('Official website:') ?>
- <a href="http://kanboard.net/" target="_blank" rel="noreferer">http://kanboard.net/</a>
+ <a href="?controller=config&amp;action=downloadDb<?= Helper\param_csrf() ?>"><?= t('Download the database') ?></a>
+ <?= t('(Gzip compressed Sqlite file)') ?>
</li>
<li>
- <?= t('Application version:') ?>
- <?= APP_VERSION ?>
+ <a href="?controller=config&amp;action=optimizeDb <?= Helper\param_csrf() ?>"><?= t('Optimize the database') ?></a>
+ <?= t('(VACUUM command)') ?>
</li>
- </ul>
- </section>
- <?php endif ?>
-
- <div class="page-header" id="last-logins">
- <h2><?= t('Last logins') ?></h2>
- </div>
- <?php if (! empty($last_logins)): ?>
- <table class="table-small table-hover">
- <tr>
- <th><?= t('Login date') ?></th>
- <th><?= t('Authentication method') ?></th>
- <th><?= t('IP address') ?></th>
- <th><?= t('User agent') ?></th>
- </tr>
- <?php foreach($last_logins as $login): ?>
- <tr>
- <td><?= dt('%B %e, %G at %k:%M %p', $login['date_creation']) ?></td>
- <td><?= Helper\escape($login['auth_type']) ?></td>
- <td><?= Helper\escape($login['ip']) ?></td>
- <td><?= Helper\escape($login['user_agent']) ?></td>
- </tr>
- <?php endforeach ?>
- </table>
- <?php endif ?>
-
- <div class="page-header" id="remember-me">
- <h2><?= t('Persistent connections') ?></h2>
- </div>
- <?php if (empty($remember_me_sessions)): ?>
- <p class="alert alert-info"><?= t('No session') ?></p>
- <?php else: ?>
- <table class="table-small table-hover">
- <tr>
- <th><?= t('Creation date') ?></th>
- <th><?= t('Expiration date') ?></th>
- <th><?= t('IP address') ?></th>
- <th><?= t('User agent') ?></th>
- <th><?= t('Action') ?></th>
- </tr>
- <?php foreach($remember_me_sessions as $session): ?>
- <tr>
- <td><?= dt('%B %e, %G at %k:%M %p', $session['date_creation']) ?></td>
- <td><?= dt('%B %e, %G at %k:%M %p', $session['expiration']) ?></td>
- <td><?= Helper\escape($session['ip']) ?></td>
- <td><?= Helper\escape($session['user_agent']) ?></td>
- <td><a href="?controller=config&amp;action=removeRememberMeToken&amp;id=<?= $session['id'].Helper\param_csrf() ?>"><?= t('Remove') ?></a></td>
- </tr>
- <?php endforeach ?>
- </table>
- <?php endif ?>
+ <?php endif ?>
+ <li>
+ <?= t('Official website:') ?>
+ <a href="http://kanboard.net/" target="_blank" rel="noreferer">http://kanboard.net/</a>
+ </li>
+ <li>
+ <?= t('Application version:') ?>
+ <?= APP_VERSION ?>
+ </li>
+ </ul>
+ </section>
</section>
diff --git a/app/Templates/layout.php b/app/Templates/layout.php
index 9bc815c9..30a4e091 100644
--- a/app/Templates/layout.php
+++ b/app/Templates/layout.php
@@ -57,12 +57,14 @@
<li <?= isset($menu) && $menu === 'users' ? 'class="active"' : '' ?>>
<a href="?controller=user"><?= t('Users') ?></a>
</li>
- <li <?= isset($menu) && $menu === 'config' ? 'class="active"' : '' ?>>
- <a href="?controller=config"><?= t('Settings') ?></a>
- </li>
+ <?php if (Helper\is_admin()): ?>
+ <li <?= isset($menu) && $menu === 'config' ? 'class="active"' : '' ?>>
+ <a href="?controller=config"><?= t('Settings') ?></a>
+ </li>
+ <?php endif ?>
<li>
<a href="?controller=user&amp;action=logout<?= Helper\param_csrf() ?>"><?= t('Logout') ?></a>
- (<?= Helper\escape(Helper\get_username()) ?>)
+ (<a class="username" href="?controller=user&amp;action=show&amp;user_id=<?= Helper\get_user_id() ?>"><?= Helper\escape(Helper\get_username()) ?></a>)
</li>
</ul>
</nav>
diff --git a/app/Templates/user_edit.php b/app/Templates/user_edit.php
index 8fba922f..14063d49 100644
--- a/app/Templates/user_edit.php
+++ b/app/Templates/user_edit.php
@@ -1,79 +1,30 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Edit user') ?></h2>
- <ul>
- <li><a href="?controller=user"><?= t('All users') ?></a></li>
- </ul>
- </div>
- <section>
- <form method="post" action="?controller=user&amp;action=update" autocomplete="off">
-
- <?= Helper\form_csrf() ?>
-
- <div class="form-column">
-
- <?= Helper\form_hidden('id', $values) ?>
- <?= Helper\form_hidden('is_ldap_user', $values) ?>
-
- <?= Helper\form_label(t('Username'), 'username') ?>
- <?= Helper\form_text('username', $values, $errors, array('required', $values['is_ldap_user'] == 1 ? 'readonly' : '')) ?><br/>
-
- <?= Helper\form_label(t('Name'), 'name') ?>
- <?= Helper\form_text('name', $values, $errors) ?><br/>
+<div class="page-header">
+ <h2><?= t('Edit user') ?></h2>
+</div>
+<form method="post" action="?controller=user&amp;action=edit&amp;user_id=<?= $user['id'] ?>" autocomplete="off">
- <?= Helper\form_label(t('Email'), 'email') ?>
- <?= Helper\form_email('email', $values, $errors) ?><br/>
+ <?= Helper\form_csrf() ?>
- <?= Helper\form_label(t('Default Project'), 'default_project_id') ?>
- <?= Helper\form_select('default_project_id', $projects, $values, $errors) ?><br/>
+ <?= Helper\form_hidden('id', $values) ?>
+ <?= Helper\form_hidden('is_ldap_user', $values) ?>
- </div>
+ <?= Helper\form_label(t('Username'), 'username') ?>
+ <?= Helper\form_text('username', $values, $errors, array('required', $values['is_ldap_user'] == 1 ? 'readonly' : '')) ?><br/>
- <div class="form-column">
+ <?= Helper\form_label(t('Name'), 'name') ?>
+ <?= Helper\form_text('name', $values, $errors) ?><br/>
- <?php if ($values['is_ldap_user'] == 0): ?>
+ <?= Helper\form_label(t('Email'), 'email') ?>
+ <?= Helper\form_email('email', $values, $errors) ?><br/>
- <?= Helper\form_label(t('Current password for the user "%s"', Helper\get_username()), 'current_password') ?>
- <?= Helper\form_password('current_password', $values, $errors) ?><br/>
+ <?= Helper\form_label(t('Default project'), 'default_project_id') ?>
+ <?= Helper\form_select('default_project_id', $projects, $values, $errors) ?><br/>
- <?= Helper\form_label(t('Password'), 'password') ?>
- <?= Helper\form_password('password', $values, $errors) ?><br/>
+ <?php if (Helper\is_admin()): ?>
+ <?= Helper\form_checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?><br/>
+ <?php endif ?>
- <?= Helper\form_label(t('Confirmation'), 'confirmation') ?>
- <?= Helper\form_password('confirmation', $values, $errors) ?><br/>
-
- <?php endif ?>
-
- <?php if (Helper\is_admin()): ?>
- <?= Helper\form_checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?><br/>
- <?php endif ?>
-
- <ul>
- <?php if (GOOGLE_AUTH && Helper\is_current_user($values['id'])): ?>
- <li>
- <?php if (empty($values['google_id'])): ?>
- <a href="?controller=user&amp;action=google<?= Helper\param_csrf() ?>"><?= t('Link my Google Account') ?></a>
- <?php else: ?>
- <a href="?controller=user&amp;action=unlinkGoogle<?= Helper\param_csrf() ?>"><?= t('Unlink my Google Account') ?></a>
- <?php endif ?>
- </li>
- <?php endif ?>
-
- <?php if (GITHUB_AUTH && Helper\is_current_user($values['id'])): ?>
- <li>
- <?php if (empty($values['github_id'])): ?>
- <a href="?controller=user&amp;action=gitHub<?= Helper\param_csrf() ?>"><?= t('Link my GitHub Account') ?></a>
- <?php else: ?>
- <a href="?controller=user&amp;action=unlinkGitHub<?= Helper\param_csrf() ?>"><?= t('Unlink my GitHub Account') ?></a>
- <?php endif ?>
- </li>
- <?php endif ?>
- </ul>
- </div>
-
- <div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <a href="?controller=user"><?= t('cancel') ?></a>
- </div>
- </form>
- </section>
-</section> \ No newline at end of file
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Templates/user_external.php b/app/Templates/user_external.php
new file mode 100644
index 00000000..727cd2bf
--- /dev/null
+++ b/app/Templates/user_external.php
@@ -0,0 +1,39 @@
+<div class="page-header">
+ <h2><?= t('External authentications') ?></h2>
+</div>
+
+<?php if (GOOGLE_AUTH): ?>
+ <h3><?= t('Google Account') ?></h3>
+
+ <p class="settings">
+ <?php if (Helper\is_current_user($user['id'])): ?>
+ <?php if (empty($user['google_id'])): ?>
+ <a href="?controller=user&amp;action=google<?= Helper\param_csrf() ?>"><?= t('Link my Google Account') ?></a>
+ <?php else: ?>
+ <a href="?controller=user&amp;action=unlinkGoogle<?= Helper\param_csrf() ?>"><?= t('Unlink my Google Account') ?></a>
+ <?php endif ?>
+ <?php else: ?>
+ <?= empty($user['google_id']) ? t('No account linked.') : t('Account linked.') ?>
+ <?php endif ?>
+ </p>
+<?php endif ?>
+
+<?php if (GITHUB_AUTH): ?>
+ <h3><?= t('Github Account') ?></h3>
+
+ <p class="settings">
+ <?php if (Helper\is_current_user($user['id'])): ?>
+ <?php if (empty($user['github_id'])): ?>
+ <a href="?controller=user&amp;action=gitHub<?= Helper\param_csrf() ?>"><?= t('Link my GitHub Account') ?></a>
+ <?php else: ?>
+ <a href="?controller=user&amp;action=unlinkGitHub<?= Helper\param_csrf() ?>"><?= t('Unlink my GitHub Account') ?></a>
+ <?php endif ?>
+ <?php else: ?>
+ <?= empty($user['github_id']) ? t('No account linked.') : t('Account linked.') ?>
+ <?php endif ?>
+ </p>
+<?php endif ?>
+
+<?php if (! GOOGLE_AUTH && ! GITHUB_AUTH): ?>
+ <p class="alert"><?= t('No external authentication enabled.') ?></p>
+<?php endif ?>
diff --git a/app/Templates/user_index.php b/app/Templates/user_index.php
index f6302a6b..7e9197b5 100644
--- a/app/Templates/user_index.php
+++ b/app/Templates/user_index.php
@@ -13,17 +13,23 @@
<?php else: ?>
<table>
<tr>
+ <th><?= t('Id') ?></th>
<th><?= t('Username') ?></th>
<th><?= t('Name') ?></th>
<th><?= t('Email') ?></th>
<th><?= t('Administrator') ?></th>
- <th><?= t('Default Project') ?></th>
- <th><?= t('Actions') ?></th>
+ <th><?= t('Default project') ?></th>
+ <th><?= t('Notifications') ?></th>
+ <th><?= t('External accounts') ?></th>
+ <th><?= t('Account type') ?></th>
</tr>
<?php foreach ($users as $user): ?>
<tr>
<td>
- <span title="user_id=<?= $user['id'] ?>"><?= Helper\escape($user['username']) ?></span>
+ <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>">#<?= $user['id'] ?></a>
+ </td>
+ <td>
+ <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= Helper\escape($user['username']) ?></a>
</td>
<td>
<?= Helper\escape($user['name']) ?>
@@ -38,15 +44,24 @@
<?= (isset($user['default_project_id']) && isset($projects[$user['default_project_id']])) ? Helper\escape($projects[$user['default_project_id']]) : t('None'); ?>
</td>
<td>
- <?php if (Helper\is_admin() || Helper\is_current_user($user['id'])): ?>
- <a href="?controller=user&amp;action=edit&amp;user_id=<?= $user['id'] ?>"><?= t('edit') ?></a>
+ <?php if ($user['notifications_enabled'] == 1): ?>
+ <?= t('Enabled') ?>
+ <?php else: ?>
+ <?= t('Disabled') ?>
<?php endif ?>
- <?php if (Helper\is_admin()): ?>
- <?php if (count($users) > 1): ?>
- <?= t('or') ?>
- <a href="?controller=user&amp;action=confirm&amp;user_id=<?= $user['id'] ?>"><?= t('remove') ?></a>
- <?php endif ?>
+ </td>
+ <td>
+ <ul class="no-bullet">
+ <?php if ($user['google_id']): ?>
+ <li><?= t('Google account linked') ?></li>
<?php endif ?>
+ <?php if ($user['github_id']): ?>
+ <li><?= t('Github account linked') ?></li>
+ <?php endif ?>
+ </ul>
+ </td>
+ <td>
+ <?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?>
</td>
</tr>
<?php endforeach ?>
diff --git a/app/Templates/user_last.php b/app/Templates/user_last.php
new file mode 100644
index 00000000..0b55b0d5
--- /dev/null
+++ b/app/Templates/user_last.php
@@ -0,0 +1,24 @@
+<div class="page-header">
+ <h2><?= t('Last logins') ?></h2>
+</div>
+
+<?php if (empty($last_logins)): ?>
+ <p class="alert"><?= t('Never connected.') ?></p>
+<?php else: ?>
+ <table class="table-small">
+ <tr>
+ <th><?= t('Login date') ?></th>
+ <th><?= t('Authentication method') ?></th>
+ <th><?= t('IP address') ?></th>
+ <th><?= t('User agent') ?></th>
+ </tr>
+ <?php foreach($last_logins as $login): ?>
+ <tr>
+ <td><?= dt('%B %e, %Y at %k:%M %p', $login['date_creation']) ?></td>
+ <td><?= Helper\escape($login['auth_type']) ?></td>
+ <td><?= Helper\escape($login['ip']) ?></td>
+ <td><?= Helper\escape(Helper\summary($login['user_agent'])) ?></td>
+ </tr>
+ <?php endforeach ?>
+ </table>
+<?php endif ?> \ No newline at end of file
diff --git a/app/Templates/user_layout.php b/app/Templates/user_layout.php
new file mode 100644
index 00000000..890b0c0a
--- /dev/null
+++ b/app/Templates/user_layout.php
@@ -0,0 +1,19 @@
+<section id="main">
+ <div class="page-header">
+ <h2><?= Helper\escape($user['name'] ?: $user['username']).' (#'.$user['id'].')' ?></h2>
+ <ul>
+ <li><a href="?controller=user&amp;action=index"><?= t('All users') ?></a></li>
+ <?php if (Helper\is_admin()): ?>
+ <li><a href="?controller=user&amp;action=create"><?= t('New user') ?></a></li>
+ <?php endif ?>
+ </ul>
+ </div>
+ <section class="user-show" id="user-section">
+
+ <?= Helper\template('user_sidebar', array('user' => $user)) ?>
+
+ <div class="user-show-main">
+ <?= $user_content_for_layout ?>
+ </div>
+ </section>
+</section> \ No newline at end of file
diff --git a/app/Templates/user_new.php b/app/Templates/user_new.php
index 3e22b7ee..48d7b6d3 100644
--- a/app/Templates/user_new.php
+++ b/app/Templates/user_new.php
@@ -21,9 +21,6 @@
<?= Helper\form_label(t('Email'), 'email') ?>
<?= Helper\form_email('email', $values, $errors) ?><br/>
- <?= Helper\form_label(t('Default Project'), 'default_project_id') ?>
- <?= Helper\form_select('default_project_id', $projects, $values, $errors) ?><br/>
-
</div>
<div class="form-column">
@@ -34,6 +31,9 @@
<?= Helper\form_label(t('Confirmation'), 'confirmation') ?>
<?= Helper\form_password('confirmation', $values, $errors, array('required')) ?><br/>
+ <?= Helper\form_label(t('Default project'), 'default_project_id') ?>
+ <?= Helper\form_select('default_project_id', $projects, $values, $errors) ?><br/>
+
<?= Helper\form_checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?>
</div>
diff --git a/app/Templates/user_notifications.php b/app/Templates/user_notifications.php
new file mode 100644
index 00000000..13dd9809
--- /dev/null
+++ b/app/Templates/user_notifications.php
@@ -0,0 +1,22 @@
+<div class="page-header">
+ <h2><?= t('Email notifications') ?></h2>
+</div>
+
+<form method="post" action="?controller=user&amp;action=notifications&amp;user_id=<?= $user['id'] ?>" autocomplete="off">
+
+ <?= Helper\form_csrf() ?>
+
+ <?= Helper\form_checkbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?><br/>
+
+ <p><?= t('I want to receive notifications only for those projects:') ?><br/><br/></p>
+
+ <div class="form-checkbox-group">
+ <?php foreach ($projects as $project_id => $project_name): ?>
+ <?= Helper\form_checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?>
+ <?php endforeach ?>
+ </div>
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?> <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Templates/user_password.php b/app/Templates/user_password.php
new file mode 100644
index 00000000..a494e42d
--- /dev/null
+++ b/app/Templates/user_password.php
@@ -0,0 +1,23 @@
+<div class="page-header">
+ <h2><?= t('Password modification') ?></h2>
+</div>
+
+<form method="post" action="?controller=user&amp;action=password&amp;user_id=<?= $user['id'] ?>" autocomplete="off">
+
+ <?= Helper\form_hidden('id', $values) ?>
+ <?= Helper\form_csrf() ?>
+
+ <?= Helper\form_label(t('Current password for the user "%s"', Helper\get_username()), 'current_password') ?>
+ <?= Helper\form_password('current_password', $values, $errors) ?><br/>
+
+ <?= Helper\form_label(t('Password'), 'password') ?>
+ <?= Helper\form_password('password', $values, $errors) ?><br/>
+
+ <?= Helper\form_label(t('Confirmation'), 'confirmation') ?>
+ <?= Helper\form_password('confirmation', $values, $errors) ?><br/>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= t('cancel') ?></a>
+ </div>
+
+</form> \ No newline at end of file
diff --git a/app/Templates/user_remove.php b/app/Templates/user_remove.php
index 45774d27..c20ccbba 100644
--- a/app/Templates/user_remove.php
+++ b/app/Templates/user_remove.php
@@ -1,14 +1,12 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Remove user') ?></h2>
- </div>
+<div class="page-header">
+ <h2><?= t('Remove user') ?></h2>
+</div>
- <div class="confirm">
- <p class="alert alert-info"><?= t('Do you really want to remove this user: "%s"?', $user['name'] ?: $user['username']) ?></p>
+<div class="confirm">
+ <p class="alert alert-info"><?= t('Do you really want to remove this user: "%s"?', $user['name'] ?: $user['username']) ?></p>
- <div class="form-actions">
- <a href="?controller=user&amp;action=remove&amp;user_id=<?= $user['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=user"><?= t('cancel') ?></a>
- </div>
+ <div class="form-actions">
+ <a href="?controller=user&amp;action=remove&amp;confirmation=yes&amp;user_id=<?= $user['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
+ <?= t('or') ?> <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= t('cancel') ?></a>
</div>
-</section> \ No newline at end of file
+</div> \ No newline at end of file
diff --git a/app/Templates/user_sessions.php b/app/Templates/user_sessions.php
new file mode 100644
index 00000000..b647d726
--- /dev/null
+++ b/app/Templates/user_sessions.php
@@ -0,0 +1,26 @@
+<div class="page-header">
+ <h2><?= t('Persistent connections') ?></h2>
+</div>
+
+<?php if (empty($sessions)): ?>
+ <p class="alert"><?= t('No session.') ?></p>
+<?php else: ?>
+ <table class="table-small">
+ <tr>
+ <th><?= t('Creation date') ?></th>
+ <th><?= t('Expiration date') ?></th>
+ <th><?= t('IP address') ?></th>
+ <th><?= t('User agent') ?></th>
+ <th><?= t('Action') ?></th>
+ </tr>
+ <?php foreach($sessions as $session): ?>
+ <tr>
+ <td><?= dt('%B %e, %Y at %k:%M %p', $session['date_creation']) ?></td>
+ <td><?= dt('%B %e, %Y at %k:%M %p', $session['expiration']) ?></td>
+ <td><?= Helper\escape($session['ip']) ?></td>
+ <td><?= Helper\escape(Helper\summary($session['user_agent'])) ?></td>
+ <td><a href="?controller=user&amp;action=removeSession&amp;user_id=<?= $user['id'] ?>&amp;id=<?= $session['id'].Helper\param_csrf() ?>"><?= t('Remove') ?></a></td>
+ </tr>
+ <?php endforeach ?>
+ </table>
+<?php endif ?>
diff --git a/app/Templates/user_show.php b/app/Templates/user_show.php
new file mode 100644
index 00000000..5d42d3cf
--- /dev/null
+++ b/app/Templates/user_show.php
@@ -0,0 +1,12 @@
+<div class="page-header">
+ <h2><?= t('Summary') ?></h2>
+</div>
+<ul class="settings">
+ <li><?= t('Username:') ?> <strong><?= Helper\escape($user['username']) ?></strong></li>
+ <li><?= t('Name:') ?> <strong><?= Helper\escape($user['name']) ?></strong></li>
+ <li><?= t('Email:') ?> <strong><?= Helper\escape($user['email']) ?></strong></li>
+ <li><?= t('Default project:') ?> <strong><?= (isset($user['default_project_id']) && isset($projects[$user['default_project_id']])) ? Helper\escape($projects[$user['default_project_id']]) : t('None'); ?></strong></li>
+ <li><?= t('Notifications:') ?> <strong><?= $user['notifications_enabled'] == 1 ? t('Enabled') : t('Disabled') ?></strong></li>
+ <li><?= t('Group:') ?> <strong><?= $user['is_admin'] ? t('Administrator') : t('Regular user') ?></strong></li>
+ <li><?= t('Account type:') ?> <strong><?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?></strong></li>
+</ul>
diff --git a/app/Templates/user_sidebar.php b/app/Templates/user_sidebar.php
new file mode 100644
index 00000000..9d8f8b46
--- /dev/null
+++ b/app/Templates/user_sidebar.php
@@ -0,0 +1,42 @@
+<div class="project-show-sidebar">
+ <h2><?= t('Actions') ?></h2>
+ <div class="user-show-actions">
+ <ul>
+ <li>
+ <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= t('Summary') ?></a>
+ </li>
+
+ <?php if (Helper\is_admin() || Helper\is_current_user($user['id'])): ?>
+ <li>
+ <a href="?controller=user&amp;action=edit&amp;user_id=<?= $user['id'] ?>"><?= t('Edit profile') ?></a>
+ </li>
+
+ <?php if ($user['is_ldap_user'] == 0): ?>
+ <li>
+ <a href="?controller=user&amp;action=password&amp;user_id=<?= $user['id'] ?>"><?= t('Change password') ?></a>
+ </li>
+ <?php endif ?>
+
+ <li>
+ <a href="?controller=user&amp;action=notifications&amp;user_id=<?= $user['id'] ?>"><?= t('Email notifications') ?></a>
+ </li>
+ <li>
+ <a href="?controller=user&amp;action=external&amp;user_id=<?= $user['id'] ?>"><?= t('External accounts') ?></a>
+ </li>
+ <li>
+ <a href="?controller=user&amp;action=last&amp;user_id=<?= $user['id'] ?>"><?= t('Last logins') ?></a>
+ </li>
+ <li>
+ <a href="?controller=user&amp;action=sessions&amp;user_id=<?= $user['id'] ?>"><?= t('Persistent connections') ?></a>
+ </li>
+ <?php endif ?>
+
+ <?php if (Helper\is_admin()): ?>
+ <li>
+ <a href="?controller=user&amp;action=remove&amp;user_id=<?= $user['id'] ?>"><?= t('Remove') ?></a>
+ </li>
+ <?php endif ?>
+
+ </ul>
+ </div>
+</div> \ No newline at end of file