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

example_simple.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,''); // force CAS authentication phpCAS::forceAuthentication(); // at this step, the user has been authenticated by the CAS server // and the user's login name can be read with phpCAS::getUser(). // logout if desired if (isset($_REQUEST['logout'])) { phpCAS::logout(); } // for this test, simply print that the authentication was successfull ?> <html> <head> <title>phpCAS simple client</title> </head> <body> <h1>Successfull Authentication!</h1> <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p> <p>phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>.</p> <p><a href="?logout=">Logout</a></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 // force CAS authentication 00016 phpCAS::forceAuthentication(); 00017 00018 // at this step, the user has been authenticated by the CAS server 00019 // and the user's login name can be read with phpCAS::getUser(). 00020 00021 // logout if desired 00022 if (isset($_REQUEST['logout'])) { 00023 phpCAS::logout(); 00024 } 00025 00026 // for this test, simply print that the authentication was successfull 00027 ?> 00028 <html> 00029 <head> 00030 <title>phpCAS simple client</title> 00031 </head> 00032 <body> 00033 <h1>Successfull Authentication!</h1> 00034 <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p> 00035 <p>phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>.</p> 00036 <p><a href="?logout=">Logout</a></p> 00037 </body> 00038 </html>

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