Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages | Examples

example_gateway.php

<?php // // phpCAS simple client // // import phpCAS lib include_once('CAS/CAS.php'); phpCAS::setDebug(); // initialize phpCAS phpCAS::client(CAS_VERSION_2_0,'sso-cas.univ-rennes1.fr',443,''); if (isset($_REQUEST['logout'])) { phpCAS::logout(); } if (isset($_REQUEST['login'])) { phpCAS::forceAuthentication(); } // check CAS authentication $auth = phpCAS::checkAuthentication(); ?> <html> <head> <title>phpCAS simple client</title> </head> <body> <?php if ($auth) { // for this test, simply print that the authentication was successfull ?> <h1>Successfull Authentication!</h1> <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p> <p><a href="?logout=">Logout</a></p> <?php } else { ?> <h1>Guest mode</h1> <p><a href="?login=">Login</a></p> <?php } ?> <p>phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>.</p> </body> </html>
00001 <?php 00002 00003 // 00004 // phpCAS simple client 00005 // 00006 00007 // import phpCAS lib 00008 include_once('CAS/CAS.php'); 00009 00010 phpCAS::setDebug(); 00011 00012 // initialize phpCAS 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 // check CAS authentication 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 // for this test, simply print that the authentication was successfull 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>

Generated on Thu Aug 17 02:03:20 2006 for phpCAS by doxygen 1.3.7