X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=login.php;h=f193aa2e90c69dcc1b467ac0655b9c8d9b2b0b36;hb=b027832862272283d9203c994ec8fd39f6196887;hp=a6195b28617f78789bc9aa38d447bead4ce2ba8b;hpb=5ef582473f6b329be18ad83c61e053fdcd9c6ed5;p=timetracker.git diff --git a/login.php b/login.php index a6195b28..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'));