example_file.php
<?php
include_once('CAS.php');
phpCAS::setDebug();
phpCAS::proxy(CAS_VERSION_2_0,'sso-cas.univ-rennes1.fr',443,'');
phpCAS::setNoCasServerValidation();
phpCAS::setPGTStorageFile('xml',session_save_path());
phpCAS::forceAuthentication();
$service = 'https://cas.ifsic.univ-rennes1.fr/examples/example_service.php';
?>
<html>
<head>
<title>phpCAS proxy example with PGT storage to file</title>
</head>
<body>
<h1>phpCAS proxy example with PGT storage to file</h1>
<p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
<h2>Response from service <?php echo $service; ?></h2><ul><hr>
<?php
flush();
// call a service and change the color depending on the result
if ( phpCAS::serviceWeb($service,$err_code,$output) ) {
echo '<font color="#00FF00">';
} else {
echo '<font color="#FF0000">';
}
echo $output;
echo '</font><hr></ul>';
?>
</body>
</html>