From 98907514962d51214461614c73087dc9f0f6c2f7 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 25 Mar 2016 10:33:37 -0700 Subject: [PATCH] Fixed a redirect for different user roles after password change. --- WEB-INF/templates/footer.tpl | 2 +- login.php | 4 +--- password_change.php | 11 ++++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index d4174240..eeab7899 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.19.3441 | Copyright © Anuko | +  Anuko Time Tracker 1.9.19.3442 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/login.php b/login.php index 19b88eac..7f55853a 100644 --- 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')); } diff --git a/password_change.php b/password_change.php index f07b8b61..62cc962d 100644 --- a/password_change.php +++ b/password_change.php @@ -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')); -- 2.20.1