$account['username'], 'secret' => $account['password'], 'master_domain' => $my_chamilo_server, 'master_auth_uri' => $master_auth_uri, 'lifetime' => time() + 3600, 'target' => filter_xss($_GET['sso_target']), ); $cookie = base64_encode(serialize($sso)); $url = chamilo_sso_protocol().$master_auth_uri; $params = 'sso_referer='.urlencode($url).'&sso_cookie='.urlencode($cookie); $final_url = filter_xss($_GET['sso_referer']).'?'.$params; //If your user exists redirect to chamilo and set the account in a session to check it later $_SESSION['my_server_user_session'] = $account; //3. After validating the user in the server and getting and setting the user data of chamilo in the sso_cookie variable: // Redirect to this URL header('Location: '.$final_url); exit; } else { echo '

Wrong parameters

'; } } if (isset($_POST['logout'])) { //echo do something to logout } function validate_user($user, $pass) { return true; } function filter_xss($val) { //do some cleaning return $val; } function chamilo_sso_protocol() { //get the sso_protocol from chamilo using webservices return 'http://'; } ?>
User Pass