From 60638b6c4f5fb33cd431cabdfef2de83c570b4da Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 30 Mar 2016 15:32:42 +0000 Subject: [PATCH] Wrote ttPluginEnabled() function. --- WEB-INF/lib/common.lib.php | 7 +++++++ WEB-INF/templates/footer.tpl | 2 +- time.php | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 124b78f5..3644c058 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -340,3 +340,10 @@ function ttAccessCheck($required_rights) return true; } + +// ttPluginEnabled is used to check whether a plugin is enabled for user. +function ttPluginEnabled($plugin) +{ + global $user; + return in_array($plugin, explode(',', $user->plugins)); +} diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index ce53f6d6..5a4923c3 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.20.3455 | Copyright © Anuko | +  Anuko Time Tracker 1.9.20.3456 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/time.php b/time.php index ebe6356c..d5a28bbb 100644 --- a/time.php +++ b/time.php @@ -57,7 +57,7 @@ if(!$cl_date) $_SESSION['date'] = $cl_date; // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if (ttPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); $smarty->assign('custom_fields', $custom_fields); -- 2.20.1