A bit of ongoing cleanup after roles revamp.
authorNik Okuntseff <support@anuko.com>
Wed, 11 Apr 2018 13:32:44 +0000 (13:32 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 11 Apr 2018 13:32:44 +0000 (13:32 +0000)
WEB-INF/lib/ttUserHelper.class.php
WEB-INF/templates/footer.tpl

index 3d4ead9..848c953 100644 (file)
@@ -240,35 +240,16 @@ class ttUserHelper {
     $mdb2 = getConnection();
     global $user;
 
-    // Preliminary checks. Only managers, co-managers, and admin can do this.
-    if (!$user->canManageTeam() && !$user->isAdmin())
+    // Preliminary checks. Only managers and co-managers can do this.
+    if (!$user->canManageTeam())
       return false;
 
     // Tho logic is different depending on who is doing the operation.
-    // Co-manager and admin - mark user deleted.
+    // Co-manager - mark user deleted.
     // Manager - mark user deleted. If manager is the only account in group, mark group items deleted.
 
-    // admin part.
-    if ($user->isAdmin()) {
-      // Mark user binds as deleted.
-      $sql = "update tt_user_project_binds set status = NULL where user_id = $user_id";
-      $affected = $mdb2->exec($sql);
-      if (is_a($affected, 'PEAR_Error'))
-        return false;
-
-      // Mark favorite reports as deleted.
-      $sql = "update tt_fav_reports set status = NULL where user_id = $user_id";
-      $affected = $mdb2->exec($sql);
-      if (is_a($affected, 'PEAR_Error'))
-        return false;
-
-      // Mark user as deleted.
-      $sql = "update tt_users set status = NULL where id = $user_id";
-      $affected = $mdb2->exec($sql);
-      if (is_a($affected, 'PEAR_Error'))
-        return false;
-
-    } elseif ($user->isCoManager()) {
+    // Co-manager part.
+    if ($user->isCoManager()) {
       // Mark user binds as deleted.
       $sql = "update tt_user_project_binds set status = NULL where user_id = $user_id";
       $affected = $mdb2->exec($sql);
index 8eed912..6b0ca4e 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.4250 | 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.4251 | 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>