From 3d6b6fb758fd7e0befbdd497013d33264b9111e5 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 11 Apr 2018 13:43:17 +0000 Subject: [PATCH] Got rid of ttUser::isAdmin() function. --- WEB-INF/lib/ttUser.class.php | 5 ----- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/import.tpl | 3 --- mobile/login.php | 2 +- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 4c186d4e..2560417f 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -150,11 +150,6 @@ class ttUser { return in_array($do_something, $this->rights); } - // isAdmin - determines whether current user is admin. - function isAdmin() { - return $this->can('administer_site'); - } - // isManager - determines whether current user is group manager. // This is a legacy function that we are getting rid of by replacing with rights check. function isManager() { diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 6b0ca4eb..6ba9e4fc 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.87.4251 | Copyright © Anuko | +  Anuko Time Tracker 1.17.87.4252 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/import.tpl b/WEB-INF/templates/import.tpl index b85bc757..d65b6496 100644 --- a/WEB-INF/templates/import.tpl +++ b/WEB-INF/templates/import.tpl @@ -1,9 +1,7 @@ {$forms.importForm.open} -
-{if $user->isAdmin()} @@ -13,7 +11,6 @@
{$i18n.form.import.hint}
 
{$forms.importForm.btn_submit.control}
-{/if}
diff --git a/mobile/login.php b/mobile/login.php index d1f659a9..d094dfbf 100644 --- a/mobile/login.php +++ b/mobile/login.php @@ -67,7 +67,7 @@ if ($request->isPost()) { $user = new ttUser(null, $auth->getUserId()); // Redirect, depending on user role. - if ($user->isAdmin()) { + if ($user->can('administer_site')) { header('Location: ../admin_groups.php'); } elseif ($user->isClient()) { header('Location: ../reports.php'); -- 2.20.1