Got rid of ttUser::isAdmin() function.
authorNik Okuntseff <support@anuko.com>
Wed, 11 Apr 2018 13:43:17 +0000 (13:43 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 11 Apr 2018 13:43:17 +0000 (13:43 +0000)
WEB-INF/lib/ttUser.class.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/import.tpl
mobile/login.php

index 4c186d4..2560417 100644 (file)
@@ -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() {
index 6b0ca4e..6ba9e4f 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.17.87.4251 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.87.4252 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index b85bc75..d65b649 100644 (file)
@@ -1,9 +1,7 @@
 {$forms.importForm.open}
-
 <table cellspacing="0" cellpadding="7" border="0" width="720">
   <tr>
     <td align="center">
-{if $user->isAdmin()}
       <table border="0" width="60%">
         <tr><td colspan="2">{$i18n.form.import.hint}<br></td></tr>
         <tr><td colspan="2">&nbsp;</td></tr>
@@ -13,7 +11,6 @@
         </tr>
         <tr><td height="50" align="center" colspan="2">{$forms.importForm.btn_submit.control}</td></tr>
       </table>
-{/if}
     </td>
   </tr>
 </table>
index d1f659a..d094dfb 100644 (file)
@@ -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');