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::client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context);
00014
00015
00016
00017
00018
00019
00020
00021
00022 phpCAS::setNoCasServerValidation();
00023
00024 if (isset($_REQUEST['logout'])) {
00025 phpCAS::logout();
00026 }
00027 if (isset($_REQUEST['login'])) {
00028 phpCAS::forceAuthentication();
00029 }
00030
00031
00032 $auth = phpCAS::checkAuthentication();
00033
00034 ?>
00035 <html>
00036 <head>
00037 <title>phpCAS simple client</title>
00038 </head>
00039 <body>
00040 <?php
00041 if ($auth) {
00042
00043 ?>
00044 <h1>Successfull Authentication!</h1>
00045 <?php include 'script_info.php' ?>
00046 <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
00047 <p><a href="?logout=">Logout</a></p>
00048 <?php
00049 } else {
00050 ?>
00051 <h1>Guest mode</h1>
00052 <p><a href="?login=">Login</a></p>
00053 <?php
00054 }
00055 ?>
00056 <p>phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>.</p>
00057 </body>
00058 </html>