• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • Examples
  • File List
  • File Members

docs/examples/example_session_service.php

Go to the documentation of this file.
00001 <?php
00002 
00003 //
00004 // phpCAS proxied client (service) with sessioning
00005 //
00006 
00007 // import phpCAS lib
00008 include_once('CAS.php');
00009 
00010 // set debug mode
00011 phpCAS::setDebug();
00012 
00013 // initialize phpCAS
00014 phpCAS::client(CAS_VERSION_2_0,'sso-cas.univ-rennes1.fr',443,'');
00015 
00016 // no SSL validation for the CAS server
00017 phpCAS::setNoCasServerValidation();
00018 
00019 // force CAS authentication
00020 phpCAS::forceAuthentication();
00021 
00022 // at this step, the user has been authenticated by the CAS server
00023 // and the user's login name can be read with phpCAS::getUser().
00024 
00025 // for this test, simply print that the authentication was successfull
00026 echo '<p>The user\'s login is <b>'.phpCAS::getUser().'</b>.</p>';
00027 
00028 // increment the number of requests of the session and print it
00029 echo '<p>request #'.(++$_SESSION['n']).'</p>';
00030 
00031 ?>

Generated on Tue Aug 3 2010 08:38:39 for phpCAS by  doxygen 1.7.1