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 $url = $_SESSION['erp']['url']; $db = $_SESSION['erp']['db']; $username = $_SESSION['erp']['admin_user']; $password = $_SESSION['erp']['admin_password']; $user_connection = new ClassXMLRPC($url, $db, $username, $password); $common = ripcord::client($url."xmlrpc/2/common"); $uid = $common->authenticate($db, $username, $password, array()); $models = ripcord::client($url."xmlrpc/2/object"); $userPassword = $oUser->changePassword($_SESSION['user']['id'], $_POST); if($userPassword['state']=="success"){ $getUser = $oUser->getUser($_SESSION['user']['id']); if(isset($getUser['password'])){ $res = $models->execute_kw($db, $uid, $password, 'res.users', 'write', array(array($_SESSION['user']['ext_id']), array('password'=>$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']; ?> Projects Run Smoothly '.$oTrans->getTranslation('display_cookie_message', $_SESSION['config']['default_lang_code']).''; unset($display_cookie_message); } ?>
getPage("materialize", $lang_code); ?>