X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=password_change.php;h=b6fd4dd9a5adfce2b5c0e9ee1db708a2d9b2e457;hb=b0e8ffd3af439b5dc6dd5044a46a906d9833932b;hp=0c51280035ee21697b75d4aa21cf9a56754bc84d;hpb=9e82b53fc5d8cb1e54b5fde774fa68a916f28b4c;p=timetracker.git diff --git a/password_change.php b/password_change.php index 0c512800..b6fd4dd9 100644 --- a/password_change.php +++ b/password_change.php @@ -81,13 +81,20 @@ 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'); + } elseif ($user->isClient()) { + header('Location: reports.php'); + } else { + header('Location: time.php'); + } exit(); } else { $err->add($i18n->getKey('error.auth')); } } -} // POST +} // isPost $smarty->assign('forms', array($form->getName() => $form->toArray())); $smarty->assign('title', $i18n->getKey('title.change_password'));