00001 <?php
00002
00003
00004
00005
00006
00007
00008 include_once('CAS.php');
00009
00010 phpCAS::setDebug();
00011
00012
00013 phpCAS::proxy(CAS_VERSION_2_0,'sso-cas.univ-rennes1.fr',443,'');
00014
00015
00016 phpCAS::setNoCasServerValidation();
00017
00018
00019 phpCAS::setPGTStorageFile('xml',session_save_path());
00020
00021
00022 phpCAS::forceAuthentication();
00023
00024
00025
00026
00027
00028
00029
00030 $service = 'https://cas.ifsic.univ-rennes1.fr/examples/example_service.php';
00031
00032 ?>
00033 <html>
00034 <head>
00035 <title>phpCAS proxy example with PGT storage to file</title>
00036 </head>
00037 <body>
00038 <h1>phpCAS proxy example with PGT storage to file</h1>
00039 <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
00040 <h2>Response from service <?php echo $service; ?></h2><ul><hr>
00041 <?php
00042 flush();
00043 // call a service and change the color depending on the result
00044 if ( phpCAS::serviceWeb($service,$err_code,$output) ) {
00045 echo '<font color="#00FF00">';
00046 } else {
00047 echo '<font color="#FF0000">';
00048 }
00049 echo $output;
00050 echo '</font><hr></ul>';
00051 ?>
00052 </body>
00053 </html>