<?php
include_once('config.php');
include_once($phpcas_path.'/CAS.php');
phpCAS::setDebug();
phpCAS::proxy(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context);
phpCAS::setNoCasServerValidation();
phpCAS::forceAuthentication();
?>
<html>
<head>
<title>phpCAS proxied proxy example (with sessioning)</title>
<link rel="stylesheet" type='text/css' href='example.css'/>
</head>
<body>
<h1>phpCAS proxied proxy example (with sessioning)</h1>
<?php include 'script_info.php' ?>
<p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
<h2>Response from service <?php echo $serviceUrl; ?></h2>
<?php
flush();
// call a service and change the color depending on the result
if ( phpCAS::serviceWeb($serviceUrl,$err_code,$output) ) {
echo '<div class="success">';
} else {
echo '<div class="error">';
}
echo $output;
echo '</div>';
?>
</body>
</html>