Envelopexmlns:
SOAP-ENV="http:
//schemas.xmlsoap.org/soap/envelope/">Header/>');
/**
*SOAPbodyforSAMLPOST
*/
define("SAML_SOAP_BODY",'Body>');
/**
*SAMLPrequest
*/
define("SAMLP_REQUEST",'Requestxmlns:
samlp="urn:
oasis:
names:
tc:
SAML:
1.0:
protocol"MajorVersion="1"MinorVersion="1"RequestID="_192.168.16.51.1024506224022"IssueInstant="2002-06-19T17:
03:
44.022Z">');
define("SAMLP_REQUEST_CLOSE",'
Request>');
/**
*SAMLPartifacttag(fortheticket)
*/
define("SAML_ASSERTION_ARTIFACT",'AssertionArtifact>');
/**
*SAMLPclose
*/
define("SAML_ASSERTION_ARTIFACT_CLOSE",'
AssertionArtifact>');
/**
*SOAPbodyclose
*/
define("SAML_SOAP_BODY_CLOSE",'
Body>');
/**
*SOAPenvelopeclose
*/
define("SAML_SOAP_ENV_CLOSE",'
Envelope>');
/**
*SAMLAttributes
*/
define("SAML_ATTRIBUTES",'SAMLATTRIBS');
/**
*SAMLAttributes
*/
define("DEFAULT_ERROR",'Internalscriptfailure');
/**@}*/
/**
*@addtogrouppublicPGTStorage
*@{
*/
//------------------------------------------------------------------------
//FILEPGTSTORAGE
//------------------------------------------------------------------------
/**
*DefaultpathusedwhenstoringPGT'stofile
*/
define("CAS_PGT_STORAGE_FILE_DEFAULT_PATH",session_save_path());
/**@}*/
//------------------------------------------------------------------------
//SERVICEACCESSERRORS
//------------------------------------------------------------------------
/**
*@addtogrouppublicServices
*@{
*/
/**
*phpCAS:
:
service()errorcodeonsuccess
*/
define("PHPCAS_SERVICE_OK",0);
/**
*phpCAS:
:
service()errorcodewhenthePTcouldnotretrievebecause
*theCASserverdidnotrespond.
*/
define("PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE",1);
/**
*phpCAS:
:
service()errorcodewhenthePTcouldnotretrievebecause
*theresponseoftheCASserverwasill-formed.
*/
define("PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE",2);
/**
*phpCAS:
:
service()errorcodewhenthePTcouldnotretrievebecause
*theCASserverdidnotwantto.
*/
define("PHPCAS_SERVICE_PT_FAILURE",3);
/**
*phpCAS:
:
service()errorcodewhentheservicewasnotavailable.
*/
define("PHPCAS_SERVICE_NOT_AVAILABLE",4);
//------------------------------------------------------------------------
//SERVICETYPES
//------------------------------------------------------------------------
/**
*phpCAS:
:
getProxiedService()typeforHTTPGET
*/
define("PHPCAS_PROXIED_SERVICE_HTTP_GET",'CAS_ProxiedService_Http_Get');
/**
*phpCAS:
:
getProxiedService()typeforHTTPPOST
*/
define("PHPCAS_PROXIED_SERVICE_HTTP_POST",'CAS_ProxiedService_Http_Post');
/**
*phpCAS:
:
getProxiedService()typeforIMAP
*/
define("PHPCAS_PROXIED_SERVICE_IMAP",'CAS_ProxiedService_Imap');
/**@}*/
//------------------------------------------------------------------------
//LANGUAGES
//------------------------------------------------------------------------
/**
*@addtogrouppublicLang
*@{
*/
define("PHPCAS_LANG_ENGLISH",'CAS_Languages_English');
define("PHPCAS_LANG_FRENCH",'CAS_Languages_French');
define("PHPCAS_LANG_GREEK",'CAS_Languages_Greek');
define("PHPCAS_LANG_GERMAN",'CAS_Languages_German');
define("PHPCAS_LANG_JAPANESE",'CAS_Languages_Japanese');
define("PHPCAS_LANG_SPANISH",'CAS_Languages_Spanish');
define("PHPCAS_LANG_CATALAN",'CAS_Languages_Catalan');
/**@}*/
/**
*@addtogroupinternalLang
*@{
*/
/**
*phpCASdefaultlanguage(whenphpCAS:
:
setLang()isnotused)
*/
define("PHPCAS_LANG_DEFAULT",PHPCAS_LANG_ENGLISH);
/**@}*/
//------------------------------------------------------------------------
//DEBUG
//------------------------------------------------------------------------
/**
*@addtogrouppublicDebug
*@{
*/
/**
*ThedefaultdirectoryforthedebugfileunderUnix.
*/
functiongettmpdir(){
if(!
empty($_ENV['TMP'])){returnrealpath($_ENV['TMP']);}
if(!
empty($_ENV['TMPDIR'])){returnrealpath($_ENV['TMPDIR']);}
if(!
empty($_ENV['TEMP'])){returnrealpath($_ENV['TEMP']);}
return"/tmp";
}
define('DEFAULT_DEBUG_DIR',gettmpdir()."/");
/**@}*/
//includetheclassautoloader
require_oncedirname(__FILE__).'/CAS/Autoload.php';
/**
*ThephpCASclassisasimplecontainerforthephpCASlibrary.ItprovidesCAS
*authenticationforwebapplicationswritteninPHP.
*
*@ingrouppublic
*@classphpCAS
*@categoryAuthentication
*@packagePhpCAS
*@authorPascalAubry
*@authorOlivierBerger
*@authorBrettBieber
*@authorJoachimFritschi
*@authorAdamFranco
*@licensehttp:
//www.apache.org/licenses/LICENSE-2.0ApacheLicense2.0
*@linkhttps:
//wiki.jasig.org/display/CASC/phpCAS
*/
classphpCAS
{
/**
*ThisvariableisusedbytheinterfaceclassphpCAS.
*
*@varCAS_Client
*@hideinitializer
*/
privatestatic$_PHPCAS_CLIENT;
/**
*Thisvariableisusedtostorewheretheinitializeriscalledfrom
*(toprintacomprehensiveerrorincaseofmultiplecalls).
*
*@hideinitializer
*/
privatestatic$_PHPCAS_INIT_CALL;
/**
*ThisvariableisusedtostorephpCASdebugmode.
*
*@hideinitializer
*/
privatestatic$_PHPCAS_DEBUG;
/**
*Thisvariableisusedtoenableverbosemode
*Thispeventsdebuginfotobeshowtotheuser.Sinceit'sasecurity
*featurethedefaultisfalse
*
*@hideinitializer
*/
privatestatic$_PHPCAS_VERBOSE=false;
//########################################################################
//INITIALIZATION
//########################################################################
/**
*@addtogrouppublicInit
*@{
*/
/**
*phpCASclientinitializer.
*
*@paramstring$server_versiontheversionoftheCASserver
*@paramstring$server_hostnamethehostnameoftheCASserver
*@paramstring$server_porttheporttheCASserverisrunningon
*@paramstring$server_uritheURItheCASserverisrespondingon
*@parambool$changeSessionIDAllowphpCAStochangethesession_id(Single
*SignOut/handleLogoutRequestsisbasedonthatchange)
*
*@returnanewlycreatedCAS_Clientobject
*@noteOnlyoneofthephpCAS:
:
client()andphpCAS:
:
proxyfunctionsshouldbe
*called,onlyonce,andbeforeallothermethods(exceptphpCAS:
:
getVersion()
*andphpCAS:
:
setDebug()).
*/
publicstaticfunctionclient($server_version,$server_hostname,
$server_port,$server_uri,$changeSessionID=true
){
phpCAS:
:
traceBegin();
if(is_object(self:
:
$_PHPCAS_CLIENT)){
phpCAS:
:
error(self:
:
$_PHPCAS_INIT_CALL['method'].'()hasalreadybeencalled(at'.self:
:
$_PHPCAS_INIT_CALL['file'].':
'.self:
:
$_PHPCAS_INIT_CALL['line'].')');
}
//storewheretheinitializeriscalledfrom
$dbg=debug_backtrace();
self:
:
$_PHPCAS_INIT_CALL