GT_Authen_CAS is a very simple CAS library that is based on the Case_Authen_CAS library from Case Western Reserve University.
It requires the following PEAR packages: Net_URL2, Net_Socket and HTTP_Request2.
For more information about PEAR, visit PEAR Home Page.
If you are using Zend Server, PEAR is installed automatically in the /usr/local/zend/bin directory. To install these required packages:
# /usr/local/zend/bin/pear install Net_URL2# /usr/local/zend/bin/pear install Net_Socket# /usr/local/zend/bin/pear install HTTP_Request2
//Load GT_Authen_CAS modulerequire_once('GT/Authn/CAS.php');//Create new GT_Authen_CAS object$cas = new GT_Authn_CAS();//Force a user to authenticate via GTLogin$cas->forceAuthentication();//Assign the user's GT Account to a variable$GTAccount = $cas->getGTAccount()
//Load GT_Authen_CAS modulerequire_once('GT/Authn/CAS.php');//Create new GT_Authen_CAS object$cas = new GT_Authn_CAS();//Check if a user is authenticated through GTLogin$cas->checkAuthentication();if ($cas->isLoggedIn()) {//The user is logged in via gtLogin...}
//Load GT_Authen_CAS modulerequire_once('GT/Authn/CAS.php');//Create new GT_Authen_CAS object$cas = new GT_Authn_CAS();//Destroy session cookie and send user to GTLogin to process CAS logout$cas->casLogout();