Fixed a redirect for different user roles after password change.
authorNik Okuntseff <support@anuko.com>
Fri, 25 Mar 2016 17:33:37 +0000 (10:33 -0700)
committerNik Okuntseff <support@anuko.com>
Fri, 25 Mar 2016 17:33:37 +0000 (10:33 -0700)
WEB-INF/templates/footer.tpl
login.php
password_change.php

index d417424..eeab789 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.9.19.3441 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.9.19.3442 | 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 19b88ea..7f55853 100644 (file)
--- a/login.php
+++ b/login.php
@@ -65,16 +65,14 @@ if ($request->isPost()) {
       // Redirect, depending on user role.
       if ($user->isAdmin()) {
         header('Location: admin_teams.php');
-        exit();
       }
       else if ($user->isClient()) {
         header('Location: reports.php');
-        exit();
       }
       else {
         header('Location: time.php');
-        exit();
       }
+      exit();
     } else
       $err->add($i18n->getKey('error.auth'));
   }
index f07b8b6..62cc962 100644 (file)
@@ -81,7 +81,16 @@ if ($request->isPost()) {
 
     if ($auth->doLogin($user->login, $cl_password1)) {
       setcookie('tt_login', $user->login, time() + COOKIE_EXPIRE, '/');
-      header('Location: time.php');
+      // Redirect, depending on user role.
+      if ($user->isAdmin()) {
+        header('Location: admin_teams.php');
+      }
+      else if ($user->isClient()) {
+        header('Location: reports.php');
+      }
+      else {
+        header('Location: time.php');
+      }
       exit();
     } else {
       $err->add($i18n->getKey('error.auth'));