summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/project_index.php6
-rw-r--r--templates/project_tasks.php2
-rw-r--r--templates/user_edit.php2
-rw-r--r--templates/user_index.php6
4 files changed, 8 insertions, 8 deletions
diff --git a/templates/project_index.php b/templates/project_index.php
index 8c75ef0b..4048879b 100644
--- a/templates/project_index.php
+++ b/templates/project_index.php
@@ -1,7 +1,7 @@
<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): ?>
+ <?php if (Helper\is_admin()): ?>
<ul>
<li><a href="?controller=project&amp;action=create"><?= t('New project') ?></a></li>
</ul>
@@ -18,7 +18,7 @@
<th><?= t('Tasks') ?></th>
<th><?= t('Board') ?></th>
- <?php if ($_SESSION['user']['is_admin'] == 1): ?>
+ <?php if (Helper\is_admin()): ?>
<th><?= t('Actions') ?></th>
<?php endif ?>
</tr>
@@ -56,7 +56,7 @@
<?php endforeach ?>
</ul>
</td>
- <?php if ($_SESSION['user']['is_admin'] == 1): ?>
+ <?php if (Helper\is_admin()): ?>
<td>
<ul>
<li>
diff --git a/templates/project_tasks.php b/templates/project_tasks.php
index ed244c34..5b3125f8 100644
--- a/templates/project_tasks.php
+++ b/templates/project_tasks.php
@@ -4,7 +4,7 @@
<ul>
<li><a href="?controller=board&amp;action=show&amp;project_id=<?= $project['id'] ?>"><?= t('Back to the board') ?></a></li>
<li><a href="?controller=project&amp;action=index"><?= t('List of projects') ?></a></li>
- <?php if ($_SESSION['user']['is_admin'] == 1): ?>
+ <?php if (Helper\is_admin()): ?>
<li><a href="?controller=project&amp;action=create"><?= t('New project') ?></a></li>
<?php endif ?>
</ul>
diff --git a/templates/user_edit.php b/templates/user_edit.php
index 66794c49..c65f3381 100644
--- a/templates/user_edit.php
+++ b/templates/user_edit.php
@@ -22,7 +22,7 @@
<?= Helper\form_label(t('Default Project'), 'default_project_id') ?>
<?= Helper\form_select('default_project_id', $projects, $values, $errors) ?><br/>
- <?php if ($values['is_admin'] == 1): ?>
+ <?php if (Helper\is_admin()): ?>
<?= Helper\form_checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?>
<?php endif ?>
diff --git a/templates/user_index.php b/templates/user_index.php
index ac8f086e..4b539599 100644
--- a/templates/user_index.php
+++ b/templates/user_index.php
@@ -1,7 +1,7 @@
<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): ?>
+ <?php if (Helper\is_admin()): ?>
<ul>
<li><a href="?controller=user&amp;action=create"><?= t('New user') ?></a></li>
</ul>
@@ -30,10 +30,10 @@
<?= (isset($user['default_project_id']) && isset($projects[$user['default_project_id']])) ? $projects[$user['default_project_id']] : t('None'); ?>
</td>
<td>
- <?php if ($_SESSION['user']['is_admin'] == 1 || $_SESSION['user']['id'] == $user['id']): ?>
+ <?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 endif ?>
- <?php if ($_SESSION['user']['is_admin'] == 1): ?>
+ <?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>