00001 <?php
00002
00003
00004
00005
00006
00007
00008 include_once('CAS/CAS.php');
00009
00010 phpCAS::setDebug();
00011
00012
00013 phpCAS::client(CAS_VERSION_2_0,'sso-cas.univ-rennes1.fr',443,'');
00014
00015 if (isset($_REQUEST['logout'])) {
00016 phpCAS::logout();
00017 }
00018 if (isset($_REQUEST['login'])) {
00019 phpCAS::forceAuthentication();
00020 }
00021
00022
00023 $auth = phpCAS::checkAuthentication();
00024
00025 ?>
00026 <html>
00027 <head>
00028 <title>phpCAS simple client</title>
00029 </head>
00030 <body>
00031 <?php
00032 if ($auth) {
00033
00034 ?>
00035 <h1>Successfull Authentication!</h1>
00036 <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
00037 <p><a href="?logout=">Logout</a></p>
00038 <?php
00039 } else {
00040 ?>
00041 <h1>Guest mode</h1>
00042 <p><a href="?login=">Login</a></p>
00043 <?php
00044 }
00045 ?>
00046 <p>phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>.</p>
00047 </body>
00048 </html>