login($_POST); if(isset($user['email']) && $user['email'] == $username){ $_SESSION['translations'] = $oTrans->listTranslations($user['lang_code']); $_SESSION['user'] = $user; $_SESSION['features'] = $oFeat->getFeaturesOfUser($user['id'], $user['lang_code']); header("Location:".$oConf->getURLRoot()); } else { unset($_SESSION['user']); $_SESSION['message']['status'] = "orange"; $_SESSION['message']['content'] = "Bad login or password"; } } $session_lifetime = 60*60*8; if(isset($_SESSION['user']) and isset($_SESSION['user']['stay_connected']) and $_SESSION['user']['stay_connected'] == true){ $session_lifetime = 60*60*24*365*5; } setcookie(session_name(),session_id(),time() + $session_lifetime); $lang_code = (isset($_SESSION['user']['lang_code']))?$_SESSION['user']['lang_code']:$_SESSION['config']['default_lang_code']; ?>