phpCAS  version 1.4.0
Functions | Variables
Miscellaneous

Functions

 CAS_Client::_readURL ($url, &$headers, &$body, &$err_msg)
 
 CAS_Client::_buildSAMLPayload ()
 
 CAS_Client::setURL ($url)
 
 CAS_Client::getURL ()
 
 CAS_Client::setBaseURL ($url)
 
 CAS_Client::_getClientUrl ()
 
 CAS_Client::_isHttps ()
 
 CAS_Client::_removeParameterFromQueryString ($parameterName, $queryString)
 
 CAS_Client::_buildQueryUrl ($url, $query)
 
 CAS_Client::_startsWith ($text, $char)
 
 CAS_Client::_endsWith ($text, $char)
 
 CAS_Client::_sessionIdForTicket ($ticket)
 
 CAS_Client::setSessionIdSalt ($salt)
 
 CAS_Client::_authError ( $failure, $cas_url, $no_response=false, $bad_response=false, $cas_response='', $err_code=-1, $err_msg='')
 
 CAS_Client::_getNodeType ($nodeURL)
 
 CAS_Client::addRebroadcastNode ($rebroadcastNodeUrl)
 
 CAS_Client::addRebroadcastHeader ($header)
 
 CAS_Client::_rebroadcast ($type)
 

Variables

 CAS_Client::$_url
 
 CAS_Client::$_sessionIdSalt = ''
 
 CAS_Client::$_rebroadcast = false
 
 CAS_Client::$_rebroadcast_nodes = array()
 
const CAS_Client::HOSTNAME = 0
 
const CAS_Client::IP = 1
 
 CAS_Client::$_rebroadcast_headers = array()
 
const CAS_Client::LOGOUT = 0
 
const CAS_Client::PGTIOU = 1
 

Detailed Description

Function Documentation

◆ _authError()

CAS_Client::_authError (   $failure,
  $cas_url,
  $no_response = false,
  $bad_response = false,
  $cas_response = '',
  $err_code = -1,
  $err_msg = '' 
)
private

This method is used to print the HTML output when the user was not authenticated.

Parameters
string$failurethe failure that occured
string$cas_urlthe URL the CAS server was asked for
bool$no_responsethe response from the CAS server (other parameters are ignored if true)
bool$bad_responsebad response from the CAS server ($err_code and $err_msg ignored if true)
string$cas_responsethe response of the CAS server
int$err_codethe error code given by the CAS server
string$err_msgthe error message given by the CAS server
Returns
void

Definition at line 4138 of file Client.php.

References $cas_url, CAS_VERSION_1_0, CAS_VERSION_2_0, CAS_VERSION_3_0, CAS_Client\getLangObj(), CAS_Client\getServerVersion(), CAS_Client\getURL(), CAS_Client\printHTMLFooter(), CAS_Client\printHTMLHeader(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceExit().

◆ _buildQueryUrl()

CAS_Client::_buildQueryUrl (   $url,
  $query 
)
private

This method is used to append query parameters to an url. Since the url might already contain parameter it has to be detected and to build a proper URL

Parameters
string$urlbase url to add the query params to
string$queryparams in query form with & separated
Returns
string url with query params

Definition at line 4050 of file Client.php.

Referenced by CAS_Client\getServerLoginURL(), CAS_Client\getServerProxyValidateURL(), CAS_Client\getServerSamlValidateURL(), and CAS_Client\getServerServiceValidateURL().

◆ _buildSAMLPayload()

CAS_Client::_buildSAMLPayload ( )
private

This method is used to build the SAML POST body sent to /samlValidate URL.

Returns
string the SOAP-encased SAMLP artifact (the ticket).

Definition at line 3062 of file Client.php.

References CAS_Client\getTicket(), SAML_SOAP_ENV, phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\_readURL().

◆ _endsWith()

CAS_Client::_endsWith (   $text,
  $char 
)
private

This method tests if a string ends with a given character

Parameters
string$texttext to test
string$charcharacter to test for
Returns
bool true if the $text ends with $char

Definition at line 4078 of file Client.php.

Referenced by CAS_Client\_flatten_array(), and CAS_Client\_parse_json_like_array_value().

◆ _getClientUrl()

CAS_Client::_getClientUrl ( )
private

Try to figure out the phpCAS client URL with possible Proxys / Ports etc.

Returns
string Server URL with domain:port

Definition at line 3966 of file Client.php.

References CAS_Client\_isHttps().

Referenced by CAS_Client\_getCallbackURL(), and CAS_Client\getURL().

◆ _getNodeType()

CAS_Client::_getNodeType (   $nodeURL)
private

Determine the node type from the URL.

Parameters
String$nodeURLThe node URL.
Returns
int hostname

Definition at line 4210 of file Client.php.

References phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\_rebroadcast().

◆ _isHttps()

CAS_Client::_isHttps ( )
private

This method checks to see if the request is secured via HTTPS

Returns
bool true if https, false otherwise

Definition at line 4005 of file Client.php.

Referenced by CAS_Client\__construct(), CAS_Client\_getClientUrl(), and CAS_Client\getURL().

◆ _readURL()

CAS_Client::_readURL (   $url,
$headers,
$body,
$err_msg 
)
private

This method is used to acces a remote URL.

Parameters
string$urlthe URL to access.
string&$headersan array containing the HTTP header lines of the response (an empty array on failure).
string&$bodythe body of the response, as a string (empty on failure).
string&$err_msgan error message, filled on failure.
Returns
bool true on success, false otherwise (in this later case, $err_msg contains an error message).

Definition at line 3007 of file Client.php.

References CAS_Client\$_requestImplementation, CAS_Client\_buildSAMLPayload(), phpCAS\error(), CAS_Client\getServerVersion(), SAML_VERSION_1_1, phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\retrievePT(), CAS_Client\validateCAS10(), and CAS_Client\validateCAS20().

◆ _rebroadcast()

CAS_Client::_rebroadcast (   $type)
private

This method rebroadcasts logout/pgtIou requests. Can be LOGOUT,PGTIOU

Parameters
int$typetype of rebroadcasting.
Returns
void

Definition at line 4274 of file Client.php.

References CAS_Client\$_rebroadcast_nodes, CAS_Client\$_requestImplementation, CAS_Client\_getNodeType(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by CAS_Client\_wasPreviouslyAuthenticated(), CAS_Client\addRebroadcastNode(), and CAS_Client\handleLogoutRequests().

◆ _removeParameterFromQueryString()

CAS_Client::_removeParameterFromQueryString (   $parameterName,
  $queryString 
)
private

Removes a parameter from a query string

Parameters
string$parameterNamename of parameter
string$queryStringquery string
Returns
string new query string

http://stackoverflow.com/questions/1842681/regular-expression-to-remove-one-parameter-from-query-string

Definition at line 4031 of file Client.php.

Referenced by CAS_Client\getURL().

◆ _sessionIdForTicket()

CAS_Client::_sessionIdForTicket (   $ticket)
private

Answer a valid session-id given a CAS ticket.

The output must be deterministic to allow single-log-out when presented with the ticket to log-out.

Parameters
string$ticketname of the ticket
Returns
string

Definition at line 4094 of file Client.php.

Referenced by CAS_Client\_renameSession(), and CAS_Client\handleLogoutRequests().

◆ _startsWith()

CAS_Client::_startsWith (   $text,
  $char 
)
private

This method tests if a string starts with a given character.

Parameters
string$texttext to test
string$charcharacter to test for
Returns
bool true if the $text starts with $char

Definition at line 4065 of file Client.php.

Referenced by CAS_Client\_flatten_array(), and CAS_Client\_parse_json_like_array_value().

◆ addRebroadcastHeader()

CAS_Client::addRebroadcastHeader (   $header)

This method is used to add header parameters when rebroadcasting pgtIou/pgtId or logoutRequest.

Parameters
string$headerHeader to send when rebroadcasting.
Returns
void

Definition at line 4253 of file Client.php.

◆ addRebroadcastNode()

CAS_Client::addRebroadcastNode (   $rebroadcastNodeUrl)

Store the rebroadcast node for pgtIou/pgtId and logout requests.

Parameters
string$rebroadcastNodeUrlThe rebroadcast node URL.
Returns
void

Definition at line 4229 of file Client.php.

References CAS_Client\_rebroadcast().

◆ getURL()

CAS_Client::getURL ( )

◆ setBaseURL()

CAS_Client::setBaseURL (   $url)

This method sets the base URL of the CAS server.

Parameters
string$urlthe base URL
Returns
string base url

Definition at line 3951 of file Client.php.

◆ setSessionIdSalt()

CAS_Client::setSessionIdSalt (   $salt)

Set a salt/seed for the session-id hash to make it harder to guess.

Parameters
string$salt
Returns
void

Definition at line 4115 of file Client.php.

◆ setURL()

CAS_Client::setURL (   $url)

This method sets the URL of the current request

Parameters
string$urlurl to set for service
Returns
void

Definition at line 3899 of file Client.php.

Referenced by CAS_Client\getURL().

Variable Documentation

◆ $_rebroadcast

CAS_Client::$_rebroadcast = false
private

Boolean of whether to rebroadcast pgtIou/pgtId and logoutRequest, and array of the nodes.

Definition at line 4193 of file Client.php.

◆ $_rebroadcast_headers

CAS_Client::$_rebroadcast_headers = array()
private

An array to store extra rebroadcast curl options.

Definition at line 4243 of file Client.php.

◆ $_rebroadcast_nodes

CAS_Client::$_rebroadcast_nodes = array()
private

Definition at line 4194 of file Client.php.

Referenced by CAS_Client\_rebroadcast().

◆ $_sessionIdSalt

string CAS_Client::$_sessionIdSalt = ''
private

Set a salt/seed for the session-id hash to make it harder to guess.

Definition at line 4106 of file Client.php.

◆ $_url

CAS_Client::$_url
private

the URL of the current request (without any ticket CGI parameter). Written and read by CAS_Client::getURL().

Definition at line 3889 of file Client.php.

Referenced by CAS_Client\getURL().

◆ HOSTNAME

const CAS_Client::HOSTNAME = 0

Constants used for determining rebroadcast node type.

Definition at line 4199 of file Client.php.

◆ IP

const CAS_Client::IP = 1

Definition at line 4200 of file Client.php.

◆ LOGOUT

const CAS_Client::LOGOUT = 0

Constants used for determining rebroadcast type (logout or pgtIou/pgtId).

Definition at line 4264 of file Client.php.

◆ PGTIOU

const CAS_Client::PGTIOU = 1

Definition at line 4265 of file Client.php.