cas.docx
- 文档编号:5823853
- 上传时间:2023-01-01
- 格式:DOCX
- 页数:58
- 大小:27.88KB
cas.docx
《cas.docx》由会员分享,可在线阅读,更多相关《cas.docx(58页珍藏版)》请在冰豆网上搜索。
cas
php
/**
*LicensedtoJasigunderoneormorecontributorlicense
*agreements.SeetheNOTICEfiledistributedwiththisworkfor
*additionalinformationregardingcopyrightownership.
*
*JasiglicensesthisfiletoyouundertheApacheLicense,
*Version2.0(the"License");youmaynotusethisfileexceptin
*compliancewiththeLicense.YoumayobtainacopyoftheLicenseat:
*
*http:
//www.apache.org/licenses/LICENSE-2.0
*
*Unlessrequiredbyapplicablelaworagreedtoinwriting,software
*distributedundertheLicenseisdistributedonan"ASIS"BASIS,
*WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
*SeetheLicenseforthespecificlanguagegoverningpermissionsand
*limitationsundertheLicense.
*
*
*
*InterfaceclassofthephpCASlibrary
*PHPVersion5
*
*@fileCAS/CAS.php
*@categoryAuthentication
*@packagePhpCAS
*@authorPascalAubry
*@authorOlivierBerger
*@authorBrettBieber
*@authorJoachimFritschi
*@authorAdamFranco
*@licensehttp:
//www.apache.org/licenses/LICENSE-2.0ApacheLicense2.0
*@linkhttps:
//wiki.jasig.org/display/CASC/phpCAS
*@ingrouppublic
*/
//
//hackbyVangelisHaniotakistohandletheabsenceof$_SERVER['REQUEST_URI']
//inIIS
//
if(php_sapi_name()!
='cli'){
if(!
isset($_SERVER['REQUEST_URI'])){
$_SERVER['REQUEST_URI']=$_SERVER['SCRIPT_NAME'].'?
'.$_SERVER['QUERY_STRING'];
}
}
//AddaE_USER_DEPRECATEDforphpversions<=5.2
if(!
defined('E_USER_DEPRECATED')){
define('E_USER_DEPRECATED',E_USER_NOTICE);
}
//########################################################################
//CONSTANTS
//########################################################################
//------------------------------------------------------------------------
//CASVERSIONS
//------------------------------------------------------------------------
/**
*phpCASversion.accessiblefortheuserbyphpCAS:
:
getVersion().
*/
define('PHPCAS_VERSION','1.3.4');
/**
*@addtogrouppublic
*@{
*/
/**
*CASversion1.0
*/
define("CAS_VERSION_1_0",'1.0');
/*!
*CASversion2.0
*/
define("CAS_VERSION_2_0",'2.0');
/**
*CASversion3.0
*/
define("CAS_VERSION_3_0",'3.0');
//------------------------------------------------------------------------
//SAMLdefines
//------------------------------------------------------------------------
/**
*SAMLprotocol
*/
define("SAML_VERSION_1_1",'S1');
/**
*XMLheaderforSAMLPOST
*/
define("SAML_XML_HEADER",'
xmlversion="1.0"encoding="UTF-8"?
>');
/**
*SOAPenvelopeforSAMLPOST
*/
define("SAML_SOAP_ENV",' 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
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- cas