summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-13 15:38:35 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-13 15:38:35 -0500
commit6161eaef9e107ddbfc104753eb5d48434de3b824 (patch)
tree6a689458e0705c8da272712b71358ccd992f8a8b /app/Template
parent567d623446d7e98393fb542c88d6d3b18b05cf6f (diff)
Enable/Disable users
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/user/dropdown.php27
-rw-r--r--app/Template/user/index.php33
-rw-r--r--app/Template/user/show.php1
-rw-r--r--app/Template/user/sidebar.php6
-rw-r--r--app/Template/user_status/disable.php13
-rw-r--r--app/Template/user_status/enable.php13
-rw-r--r--app/Template/user_status/remove.php (renamed from app/Template/user/remove.php)6
7 files changed, 74 insertions, 25 deletions
diff --git a/app/Template/user/dropdown.php b/app/Template/user/dropdown.php
new file mode 100644
index 00000000..b74ed6e0
--- /dev/null
+++ b/app/Template/user/dropdown.php
@@ -0,0 +1,27 @@
+<div class="dropdown">
+ <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
+ <ul>
+ <li>
+ <i class="fa fa-user fa-fw"></i>
+ <?= $this->url->link(t('View profile'), 'user', 'show', array('user_id' => $user['id'])) ?>
+ </li>
+ <?php if ($user['is_active'] == 1 && $this->user->hasAccess('UserStatus', 'disable') && ! $this->user->isCurrentUser($user['id'])): ?>
+ <li>
+ <i class="fa fa-times fa-fw"></i>
+ <?= $this->url->link(t('Disable'), 'UserStatus', 'confirmDisable', array('user_id' => $user['id']), false, 'popover') ?>
+ </li>
+ <?php endif ?>
+ <?php if ($user['is_active'] == 0 && $this->user->hasAccess('UserStatus', 'enable') && ! $this->user->isCurrentUser($user['id'])): ?>
+ <li>
+ <i class="fa fa-check-square-o fa-fw"></i>
+ <?= $this->url->link(t('Enable'), 'UserStatus', 'confirmEnable', array('user_id' => $user['id']), false, 'popover') ?>
+ </li>
+ <?php endif ?>
+ <?php if ($this->user->hasAccess('UserStatus', 'remove') && ! $this->user->isCurrentUser($user['id'])): ?>
+ <li>
+ <i class="fa fa-trash-o fa-fw"></i>
+ <?= $this->url->link(t('Remove'), 'UserStatus', 'confirmRemove', array('user_id' => $user['id']), false, 'popover') ?>
+ </li>
+ <?php endif ?>
+ </ul>
+</div> \ No newline at end of file
diff --git a/app/Template/user/index.php b/app/Template/user/index.php
index cb7416d6..494c1465 100644
--- a/app/Template/user/index.php
+++ b/app/Template/user/index.php
@@ -12,23 +12,21 @@
<?php if ($paginator->isEmpty()): ?>
<p class="alert"><?= t('No user') ?></p>
<?php else: ?>
- <table>
+ <table class="table-stripped">
<tr>
- <th><?= $paginator->order(t('Id'), 'id') ?></th>
- <th><?= $paginator->order(t('Username'), 'username') ?></th>
- <th><?= $paginator->order(t('Name'), 'name') ?></th>
- <th><?= $paginator->order(t('Email'), 'email') ?></th>
- <th><?= $paginator->order(t('Role'), 'role') ?></th>
- <th><?= $paginator->order(t('Two factor authentication'), 'twofactor_activated') ?></th>
- <th><?= $paginator->order(t('Notifications'), 'notifications_enabled') ?></th>
- <th><?= $paginator->order(t('Account type'), 'is_ldap_user') ?></th>
+ <th class="column-18"><?= $paginator->order(t('Username'), 'username') ?></th>
+ <th class="column-18"><?= $paginator->order(t('Name'), 'name') ?></th>
+ <th class="column-15"><?= $paginator->order(t('Email'), 'email') ?></th>
+ <th class="column-15"><?= $paginator->order(t('Role'), 'role') ?></th>
+ <th class="column-10"><?= $paginator->order(t('Two Factor'), 'twofactor_activated') ?></th>
+ <th class="column-10"><?= $paginator->order(t('Account type'), 'is_ldap_user') ?></th>
+ <th class="column-10"><?= $paginator->order(t('Status'), 'is_active') ?></th>
+ <th class="column-5"><?= t('Actions') ?></th>
</tr>
<?php foreach ($paginator->getCollection() as $user): ?>
<tr>
<td>
- <?= $this->url->link('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?>
- </td>
- <td>
+ <?= '#'.$user['id'] ?>&nbsp;
<?= $this->url->link($this->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?>
</td>
<td>
@@ -44,14 +42,17 @@
<?= $user['twofactor_activated'] ? t('Yes') : t('No') ?>
</td>
<td>
- <?php if ($user['notifications_enabled'] == 1): ?>
- <?= t('Enabled') ?>
+ <?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?>
+ </td>
+ <td>
+ <?php if ($user['is_active'] == 1): ?>
+ <?= t('Active') ?>
<?php else: ?>
- <?= t('Disabled') ?>
+ <?= t('Inactive') ?>
<?php endif ?>
</td>
<td>
- <?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?>
+ <?= $this->render('user/dropdown', array('user' => $user)) ?>
</td>
</tr>
<?php endforeach ?>
diff --git a/app/Template/user/show.php b/app/Template/user/show.php
index 89c6b36b..9da56666 100644
--- a/app/Template/user/show.php
+++ b/app/Template/user/show.php
@@ -5,6 +5,7 @@
<li><?= t('Username:') ?> <strong><?= $this->e($user['username']) ?></strong></li>
<li><?= t('Name:') ?> <strong><?= $this->e($user['name']) ?: t('None') ?></strong></li>
<li><?= t('Email:') ?> <strong><?= $this->e($user['email']) ?: t('None') ?></strong></li>
+ <li><?= t('Status:') ?> <strong><?= $user['is_active'] ? t('Active') : t('Inactive') ?></strong></li>
</ul>
<div class="page-header">
diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php
index 765a1e6e..2faf8220 100644
--- a/app/Template/user/sidebar.php
+++ b/app/Template/user/sidebar.php
@@ -76,11 +76,5 @@
<?php endif ?>
<?= $this->hook->render('template:user:sidebar:actions', array('user' => $user)) ?>
-
- <?php if ($this->user->hasAccess('user', 'remove') && ! $this->user->isCurrentUser($user['id'])): ?>
- <li <?= $this->app->checkMenuSelection('user', 'remove') ?>>
- <?= $this->url->link(t('Remove'), 'user', 'remove', array('user_id' => $user['id'])) ?>
- </li>
- <?php endif ?>
</ul>
</div> \ No newline at end of file
diff --git a/app/Template/user_status/disable.php b/app/Template/user_status/disable.php
new file mode 100644
index 00000000..90d8c757
--- /dev/null
+++ b/app/Template/user_status/disable.php
@@ -0,0 +1,13 @@
+<div class="page-header">
+ <h2><?= t('Disable user') ?></h2>
+</div>
+
+<div class="confirm">
+ <p class="alert alert-info"><?= t('Do you really want to disable this user: "%s"?', $user['name'] ?: $user['username']) ?></p>
+
+ <div class="form-actions">
+ <?= $this->url->link(t('Yes'), 'UserStatus', 'disable', array('user_id' => $user['id']), true, 'btn btn-red') ?>
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?>
+ </div>
+</div>
diff --git a/app/Template/user_status/enable.php b/app/Template/user_status/enable.php
new file mode 100644
index 00000000..cd3d4947
--- /dev/null
+++ b/app/Template/user_status/enable.php
@@ -0,0 +1,13 @@
+<div class="page-header">
+ <h2><?= t('Enable user') ?></h2>
+</div>
+
+<div class="confirm">
+ <p class="alert alert-info"><?= t('Do you really want to enable this user: "%s"?', $user['name'] ?: $user['username']) ?></p>
+
+ <div class="form-actions">
+ <?= $this->url->link(t('Yes'), 'UserStatus', 'enable', array('user_id' => $user['id']), true, 'btn btn-red') ?>
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?>
+ </div>
+</div>
diff --git a/app/Template/user/remove.php b/app/Template/user_status/remove.php
index 810a3a3f..cd5c09a6 100644
--- a/app/Template/user/remove.php
+++ b/app/Template/user_status/remove.php
@@ -6,8 +6,8 @@
<p class="alert alert-info"><?= t('Do you really want to remove this user: "%s"?', $user['name'] ?: $user['username']) ?></p>
<div class="form-actions">
- <?= $this->url->link(t('Yes'), 'user', 'remove', array('user_id' => $user['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
+ <?= $this->url->link(t('Yes'), 'UserStatus', 'remove', array('user_id' => $user['id']), true, 'btn btn-red') ?>
<?= t('or') ?>
- <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
+ <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?>
</div>
-</div> \ No newline at end of file
+</div>