summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/project_index.php2
-rw-r--r--templates/user_edit.php2
-rw-r--r--templates/user_index.php20
3 files changed, 14 insertions, 10 deletions
diff --git a/templates/project_index.php b/templates/project_index.php
index 8bb09a62..0fc2468c 100644
--- a/templates/project_index.php
+++ b/templates/project_index.php
@@ -1,9 +1,11 @@
<section id="main">
<div class="page-header">
<h2><?= t('Projects') ?><span id="page-counter"> (<?= $nb_projects ?>)</span></h2>
+ <?php if ($_SESSION['user']['is_admin'] == 1): ?>
<ul>
<li><a href="?controller=project&amp;action=create"><?= t('New project') ?></a></li>
</ul>
+ <?php endif ?>
</div>
<section>
<?php if (empty($projects)): ?>
diff --git a/templates/user_edit.php b/templates/user_edit.php
index d9901e4e..66794c49 100644
--- a/templates/user_edit.php
+++ b/templates/user_edit.php
@@ -2,7 +2,7 @@
<div class="page-header">
<h2><?= t('Edit user') ?></h2>
<ul>
- <li><a href="?action=users"><?= t('All users') ?></a></li>
+ <li><a href="?controller=user"><?= t('All users') ?></a></li>
</ul>
</div>
<section>
diff --git a/templates/user_index.php b/templates/user_index.php
index c83a5417..20baac2f 100644
--- a/templates/user_index.php
+++ b/templates/user_index.php
@@ -1,9 +1,11 @@
<section id="main">
<div class="page-header">
<h2><?= t('Users') ?><span id="page-counter"> (<?= $nb_users ?>)</span></h2>
+ <?php if ($_SESSION['user']['is_admin'] == 1): ?>
<ul>
<li><a href="?controller=user&amp;action=create"><?= t('New user') ?></a></li>
</ul>
+ <?php endif ?>
</div>
<section>
<?php if (empty($users)): ?>
@@ -14,9 +16,7 @@
<th><?= t('Username') ?></th>
<th><?= t('Administrator') ?></th>
<th><?= t('Default Project') ?></th>
- <?php if ($_SESSION['user']['is_admin'] == 1): ?>
- <th><?= t('Actions') ?></th>
- <?php endif ?>
+ <th><?= t('Actions') ?></th>
</tr>
<?php foreach ($users as $user): ?>
<tr>
@@ -29,15 +29,17 @@
<td>
<?= $projects[$user['default_project_id']] ?>
</td>
- <?php if ($_SESSION['user']['is_admin'] == 1): ?>
<td>
- <a href="?controller=user&amp;action=edit&amp;user_id=<?= $user['id'] ?>"><?= t('edit') ?></a>
- <?php if (count($users) > 1): ?>
- <?= t('or') ?>
- <a href="?controller=user&amp;action=confirm&amp;user_id=<?= $user['id'] ?>"><?= t('remove') ?></a>
+ <?php if ($_SESSION['user']['is_admin'] == 1 || $_SESSION['user']['id'] == $user['id']): ?>
+ <a href="?controller=user&amp;action=edit&amp;user_id=<?= $user['id'] ?>"><?= t('edit') ?></a>
+ <?php endif ?>
+ <?php if ($_SESSION['user']['is_admin'] == 1): ?>
+ <?php if (count($users) > 1): ?>
+ <?= t('or') ?>
+ <a href="?controller=user&amp;action=confirm&amp;user_id=<?= $user['id'] ?>"><?= t('remove') ?></a>
+ <?php endif ?>
<?php endif ?>
</td>
- <?php endif ?>
</tr>
<?php endforeach ?>
</table>