X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=login.php;h=f193aa2e90c69dcc1b467ac0655b9c8d9b2b0b36;hb=b027832862272283d9203c994ec8fd39f6196887;hp=c9ddc8170167548fe40a2a63e685e9f11128686c;hpb=098a79f0819ebb89b7d48df4a6b154af4560f68e;p=timetracker.git diff --git a/login.php b/login.php index c9ddc817..f193aa2e 100644 --- a/login.php +++ b/login.php @@ -46,21 +46,21 @@ if ($request->getMethod() == 'POST') { // Validate user input. if (!ttValidString($cl_login)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.login')); if (!ttValidString($cl_password)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.password')); - + if ($errors->isEmpty()) { - // Use the "limit" plugin if we have one. Ignore include errors. + // Use the "limit" plugin if we have one. Ignore include errors. // The "limit" plugin is not required for normal operation of Time Tracker. @include('plugins/limit/access_check.php'); - + if ($auth->doLogin($cl_login, $cl_password)) { // Set current user date (as determined by user browser) into session. $current_user_date = $request->getParameter('browser_today', null); if ($current_user_date) $_SESSION['date'] = $current_user_date; - + // Remember user login in a cookie. setcookie('tt_login', $cl_login, time() + COOKIE_EXPIRE, '/'); - + $user = new ttUser(null, $auth->getUserId()); // Redirect, depending on user role. if ($user->isAdmin()) { @@ -69,7 +69,7 @@ if ($request->getMethod() == 'POST') { } else if ($user->isClient()) { header('Location: reports.php'); - exit(); + exit(); } else { header('Location: time.php'); @@ -78,7 +78,7 @@ if ($request->getMethod() == 'POST') { } else $errors->add($i18n->getKey('error.auth')); } -} +} // POST if(!isTrue(MULTITEAM_MODE) && !ttTeamHelper::getTeams()) $errors->add($i18n->getKey('error.no_teams')); @@ -93,4 +93,3 @@ $smarty->assign('title', $i18n->getKey('title.login')); $smarty->assign('content_page_name', 'login.tpl'); $smarty->assign('about_text', $i18n->getKey('form.login.about')); $smarty->display('index.tpl'); -?> \ No newline at end of file