login($_POST); if(isset($user['email'])){ $_SESSION['translations'] = $oTrans->listTranslations($user['lang_code']); $_SESSION['user'] = $user; $_SESSION['features'] = $oFeat->getFeaturesOfUser($user['id'], $user['lang_code']); header("Location:".$oConf->getURLRoot()); } else { $_SESSION['message'] = $user; } } if(isset($_POST['submit_change_password'])){ // Open connection with Globsi Backend $userPassword = $oUser->changePassword($_SESSION['user']['id'], $_POST); if($userPassword['state']=="success"){ $getUser = $oUser->getUser($_SESSION['user']['id']); if(isset($getUser['password'])){ unset($_SESSION); header("Location:".$oConf->getURLRoot('scripts/logout.php')); } } } $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']; ?>