Go to the documentation of this file.00001 <?php
00002
00003
00004
00005 include_once('config.php');
00006
00007 include_once($phpcas_path.'/CAS.php');
00008
00009
00010 phpCAS::setDebug();
00011
00012
00013 phpCAS::proxy(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context);
00014
00015
00016
00017
00018
00019
00020
00021
00022 phpCAS::setNoCasServerValidation();
00023
00024
00025 phpCAS::setPGTStorageFile('plain',session_save_path());
00026
00027
00028 phpCAS::forceAuthentication();
00029
00030
00031
00032
00033
00034
00035
00036 ?>
00037 <html>
00038 <head>
00039 <title>phpCAS proxy example with PGT storage to file</title>
00040 <link rel="stylesheet" type='text/css' href='example.css'/>
00041 </head>
00042 <body>
00043 <h1>phpCAS proxy example with PGT storage to file</h1>
00044 <?php include 'script_info.php' ?>
00045 <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
00046 <h2>Response from service <?php echo $serviceUrl; ?></h2>
00047 <?php
00048 flush();
00049 // call a service and change the color depending on the result
00050 if ( phpCAS::serviceWeb($serviceUrl,$err_code,$output) ) {
00051 echo '<div class="success">';
00052 } else {
00053 echo '<div class="error">';
00054 }
00055 echo $output;
00056 echo '</div>';
00057 ?>
00058 </body>
00059 </html>