From 5fdf8659516ad2b07458deba8eda234e8e07c554 Mon Sep 17 00:00:00 2001 From: anuko Date: Wed, 21 Sep 2016 01:52:33 +0000 Subject: [PATCH] Work in progress adding checks for enabled plugins for pages. --- WEB-INF/templates/charts.tpl | 2 -- WEB-INF/templates/header.tpl | 34 ++++++++++++++--------------- WEB-INF/templates/mobile/header.tpl | 20 ++++++++--------- charts.php | 2 +- clients.php | 2 +- expenses.php | 2 +- mobile/clients.php | 2 +- mobile/expenses.php | 2 +- 8 files changed, 32 insertions(+), 34 deletions(-) diff --git a/WEB-INF/templates/charts.tpl b/WEB-INF/templates/charts.tpl index 22238715..4c676147 100644 --- a/WEB-INF/templates/charts.tpl +++ b/WEB-INF/templates/charts.tpl @@ -35,5 +35,3 @@ {$forms.chartForm.date.control} {$forms.chartForm.close} - - diff --git a/WEB-INF/templates/header.tpl b/WEB-INF/templates/header.tpl index ce8e229c..b307f4c8 100644 --- a/WEB-INF/templates/header.tpl +++ b/WEB-INF/templates/header.tpl @@ -27,7 +27,7 @@ With 101% height we essentially force the scrollbar to always appear. --> - + {if $user->custom_logo} @@ -54,11 +54,11 @@ With 101% height we essentially force the scrollbar to always appear. -->
- + {if $authenticated} {if $user->isAdmin()} - +
  @@ -68,9 +68,9 @@ With 101% height we essentially force the scrollbar to always appear. -->
- + - +
  @@ -79,9 +79,9 @@ With 101% height we essentially force the scrollbar to always appear. -->
- + {else} - +
  @@ -92,9 +92,9 @@ With 101% height we essentially force the scrollbar to always appear. -->
- + - +
  @@ -130,10 +130,10 @@ With 101% height we essentially force the scrollbar to always appear. -->
- + {/if} {else} - +
  @@ -149,16 +149,16 @@ With 101% height we essentially force the scrollbar to always appear. --> {/if}
- + {if $title}
{$title}{if $timestring}: {$timestring}{/if}
{$user->name|escape:'html'}{if $user->isAdmin()} {$i18n.label.role_admin}{elseif $user->isManager()} {$i18n.label.role_manager}{elseif $user->canManageTeam()} {$i18n.label.role_comanager}{/if}{if $user->behalf_id > 0} {$i18n.label.on_behalf} {$user->behalf_name|escape:'html'}{/if}{if $user->team}, {$user->team|escape:'html'}{/if}
{/if} - + - + {if $err->yes()} @@ -170,9 +170,9 @@ With 101% height we essentially force the scrollbar to always appear. -->
{/if} - + - + {if $msg->yes()} @@ -184,4 +184,4 @@ With 101% height we essentially force the scrollbar to always appear. -->
{/if} - + diff --git a/WEB-INF/templates/mobile/header.tpl b/WEB-INF/templates/mobile/header.tpl index cd266aeb..7a48f5e9 100644 --- a/WEB-INF/templates/mobile/header.tpl +++ b/WEB-INF/templates/mobile/header.tpl @@ -25,7 +25,7 @@
- + {if $user->custom_logo} @@ -52,12 +52,12 @@
- + {if $authenticated} {if $user->isAdmin()} - +
  @@ -66,10 +66,10 @@
- + {else} - +
  @@ -94,11 +94,11 @@
- + {/if} {/if} - + {if $err->yes()} @@ -110,9 +110,9 @@
{/if} - + - + {if $msg->yes()} @@ -124,4 +124,4 @@
{/if} - + diff --git a/charts.php b/charts.php index 9dec840a..3ef76e52 100644 --- a/charts.php +++ b/charts.php @@ -38,7 +38,7 @@ import('ttUserHelper'); import('ttTeamHelper'); // Access check. -if (!ttAccessCheck(right_view_charts)) { +if (!ttAccessCheck(right_view_charts) || !$user->isPluginEnabled('ch')) { header('Location: access_denied.php'); exit(); } diff --git a/clients.php b/clients.php index 6dcfe4a5..0a027b8b 100644 --- a/clients.php +++ b/clients.php @@ -31,7 +31,7 @@ import('form.Form'); import('ttTeamHelper'); // Access check. -if (!ttAccessCheck(right_manage_team)) { +if (!ttAccessCheck(right_manage_team) || !$user->isPluginEnabled('cl')) { header('Location: access_denied.php'); exit(); } diff --git a/expenses.php b/expenses.php index 4c2b7b27..0f4265aa 100644 --- a/expenses.php +++ b/expenses.php @@ -34,7 +34,7 @@ import('DateAndTime'); import('ttExpenseHelper'); // Access check. -if (!ttAccessCheck(right_data_entry)) { +if (!ttAccessCheck(right_data_entry) || !$user->isPluginEnabled('ex')) { header('Location: access_denied.php'); exit(); } diff --git a/mobile/clients.php b/mobile/clients.php index d6ebbe40..6312c2dd 100644 --- a/mobile/clients.php +++ b/mobile/clients.php @@ -31,7 +31,7 @@ import('form.Form'); import('ttTeamHelper'); // Access check. -if (!ttAccessCheck(right_manage_team)) { +if (!ttAccessCheck(right_manage_team) || !$user->isPluginEnabled('cl')) { header('Location: access_denied.php'); exit(); } diff --git a/mobile/expenses.php b/mobile/expenses.php index 4246f589..fafe1373 100644 --- a/mobile/expenses.php +++ b/mobile/expenses.php @@ -34,7 +34,7 @@ import('DateAndTime'); import('ttExpenseHelper'); // Access check. -if (!ttAccessCheck(right_data_entry)) { +if (!ttAccessCheck(right_data_entry) || !$user->isPluginEnabled('ex')) { header('Location: access_denied.php'); exit(); } -- 2.20.1