ILIAS
Release_4_0_x_branch Revision 61816
|
The CASClient class is a client interface that provides CAS authentication to PHP applications. More...
Public Member Functions | |
setHTMLHeader ($header) | |
This method set the HTML header used for all outputs. | |
setHTMLFooter ($footer) | |
This method set the HTML footer used for all outputs. | |
setLang ($lang) | |
This method is used to set the language used by phpCAS. | |
setExtraCurlOption ($key, $value) | |
This method is used to set additional user curl options. | |
CASClient ($server_version, $proxy, $server_hostname, $server_port, $server_uri, $start_session=true) | |
CASClient constructor. | |
setStartSession ($session) | |
getStartSession ($session) | |
renameSession ($ticket) | |
Renaming the session. | |
getUser () | |
This method returns the CAS user's login name. | |
setAttributes ($attributes) | |
getAttributes () | |
hasAttributes () | |
hasAttribute ($key) | |
getAttribute ($key) | |
renewAuthentication () | |
This method is called to renew the authentication of the user If the user is authenticated, renew the connection If not, redirect to CAS. | |
forceAuthentication () | |
This method is called to be sure that the user is authenticated. | |
setCacheTimesForAuthRecheck ($n) | |
Set the number of times authentication will be cached before rechecked. | |
checkAuthentication () | |
This method is called to check whether the user is authenticated or not. | |
isAuthenticated () | |
This method is called to check if the user is authenticated (previously or by tickets given in the URL). | |
isSessionAuthenticated () | |
This method tells if the current session is authenticated. | |
redirectToCas ($gateway=false, $renew=false) | |
This method is used to redirect the client to the CAS server. | |
logout ($params) | |
This method is used to logout from CAS. | |
handleLogoutRequests ($check_client=true, $allowed_clients=false) | |
This method handles logout requests. | |
setCasServerCert ($cert) | |
Set the certificate of the CAS server. | |
setCasServerCACert ($cert) | |
Set the CA certificate of the CAS server. | |
setNoCasServerValidation () | |
Set no SSL validation for the CAS server. | |
setPGTStorageFile ($format='', $path='') | |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests onto the filesystem. | |
setPGTStorageDB ($user, $password, $database_type, $hostname, $port, $database, $table) | |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests into a database. | |
_curl_read_headers ($ch, $header) | |
serviceWeb ($url, &$err_code, &$output) | |
This method is used to access an HTTP[S] service. | |
serviceMail ($url, $service, $flags, &$err_code, &$err_msg, &$pt) | |
This method is used to access an IMAP/POP3/NNTP service. | |
removeParameterFromQueryString ($parameterName, $queryString) | |
Removes a parameter from a query string. | |
setHTMLHeader ($header) | |
This method set the HTML header used for all outputs. | |
setHTMLFooter ($footer) | |
This method set the HTML footer used for all outputs. | |
setLang ($lang) | |
This method is used to set the language used by phpCAS. | |
CASClient ($server_version, $proxy, $server_hostname, $server_port, $server_uri, $start_session=true) | |
CASClient constructor. | |
getUser () | |
This method returns the CAS user's login name. | |
forceAuthentication () | |
This method is called to be sure that the user is authenticated. | |
checkAuthentication () | |
This method is called to check whether the ser is authenticated or not. | |
isAuthenticated () | |
This method is called to check if the user is authenticated (previously or by tickets given in the URL. | |
redirectToCas ($gateway) | |
This method is used to redirect the client to the CAS server. | |
logout ($url="") | |
This method is used to logout from CAS. | |
setPGTStorageFile ($format='', $path='') | |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests onto the filesystem. | |
setPGTStorageDB ($user, $password, $database_type, $hostname, $port, $database, $table) | |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests into a database. | |
serviceWeb ($url, &$err_code, &$output) | |
This method is used to access an HTTP[S] service. | |
serviceMail ($url, $flags, &$err_code, &$err_msg, &$pt) | |
This method is used to access an IMAP/POP3/NNTP service. | |
setHTMLHeader ($header) | |
This method set the HTML header used for all outputs. | |
setHTMLFooter ($footer) | |
This method set the HTML footer used for all outputs. | |
setLang ($lang) | |
This method is used to set the language used by phpCAS. | |
CASClient ($server_version, $proxy, $server_hostname, $server_port, $server_uri, $start_session=true) | |
CASClient constructor. | |
getUser () | |
This method returns the CAS user's login name. | |
forceAuthentication () | |
This method is called to be sure that the user is authenticated. | |
checkAuthentication () | |
This method is called to check whether the ser is authenticated or not. | |
isAuthenticated () | |
This method is called to check if the user is authenticated (previously or by tickets given in the URL. | |
redirectToCas ($gateway) | |
This method is used to redirect the client to the CAS server. | |
logout ($url="") | |
This method is used to logout from CAS. | |
setPGTStorageFile ($format='', $path='') | |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests onto the filesystem. | |
setPGTStorageDB ($user, $password, $database_type, $hostname, $port, $database, $table) | |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests into a database. | |
serviceWeb ($url, &$err_code, &$output) | |
This method is used to access an HTTP[S] service. | |
serviceMail ($url, $flags, &$err_code, &$err_msg, &$pt) | |
This method is used to access an IMAP/POP3/NNTP service. |
Data Fields | |
$_curl_options = array() | |
An array to store extra curl options. | |
$_curl_headers = array() | |
This method is the callback used by readURL method to request HTTP headers. |
Private Member Functions | |
HTMLFilterOutput ($str) | |
This method filters a string by replacing special tokens by appropriate values and prints it. | |
printHTMLHeader ($title) | |
This method prints the header of the HTML output (after filtering). | |
printHTMLFooter () | |
This method prints the footer of the HTML output (after filtering). | |
getLang () | |
This method returns the language used by phpCAS. | |
getString ($str) | |
This method returns a string depending on the language. | |
getServerVersion () | |
This method is used to retrieve the version of the CAS server. | |
getServerHostname () | |
This method is used to retrieve the hostname of the CAS server. | |
getServerPort () | |
This method is used to retrieve the port of the CAS server. | |
getServerURI () | |
This method is used to retrieve the URI of the CAS server. | |
getServerBaseURL () | |
This method is used to retrieve the base URL of the CAS server. | |
getServerLoginURL ($gateway=false, $renew=false) | |
This method is used to retrieve the login URL of the CAS server. | |
setServerLoginURL ($url) | |
This method sets the login URL of the CAS server. | |
setServerServiceValidateURL ($url) | |
This method sets the serviceValidate URL of the CAS server. | |
setServerProxyValidateURL ($url) | |
This method sets the proxyValidate URL of the CAS server. | |
setServerSamlValidateURL ($url) | |
This method sets the samlValidate URL of the CAS server. | |
getServerServiceValidateURL () | |
This method is used to retrieve the service validating URL of the CAS server. | |
getServerSamlValidateURL () | |
This method is used to retrieve the SAML validating URL of the CAS server. | |
getServerProxyValidateURL () | |
This method is used to retrieve the proxy validating URL of the CAS server. | |
getServerProxyURL () | |
This method is used to retrieve the proxy URL of the CAS server. | |
getServerLogoutURL () | |
This method is used to retrieve the logout URL of the CAS server. | |
setServerLogoutURL ($url) | |
This method sets the logout URL of the CAS server. | |
isHttps () | |
This method checks to see if the request is secured via HTTPS. | |
setUser ($user) | |
This method sets the CAS user's login name. | |
wasPreviouslyAuthenticated () | |
This method tells if the user has already been (previously) authenticated by looking into the session variables. | |
isLogoutRequest () | |
isLogoutRequestAllowed () | |
getST () | |
This method returns the Service Ticket provided in the URL of the request. | |
setST ($st) | |
This method stores the Service Ticket. | |
hasST () | |
This method tells if a Service Ticket was stored. | |
validateST ($validate_url, &$text_response, &$tree_response) | |
This method is used to validate a ST; halt on failure, and sets $validate_url, $text_reponse and $tree_response on success. | |
validateSA ($validate_url, &$text_response, &$tree_response) | |
This method is used to validate a SAML TICKET; halt on failure, and sets $validate_url, $text_reponse and $tree_response on success. | |
setSessionAttributes ($text_response) | |
This method will parse the DOM and pull out the attributes from the SAML payload and put them into an array, then put the array into the session. | |
isProxy () | |
Tells if a CAS client is a CAS proxy or not. | |
getPGT () | |
This method returns the Proxy Granting Ticket given by the CAS server. | |
setPGT ($pgt) | |
This method stores the Proxy Granting Ticket. | |
hasPGT () | |
This method tells if a Proxy Granting Ticket was stored. | |
setCallbackMode ($callback_mode) | |
This method sets/unsets callback mode. | |
isCallbackMode () | |
This method returns TRUE when the CAs client is running i callback mode, FALSE otherwise. | |
getCallbackURL () | |
This method returns the URL that should be used for the PGT callback (in fact the URL of the current request without any CGI parameter, except if phpCAS::setFixedCallbackURL() was used). | |
setCallbackURL ($url) | |
This method sets the callback url. | |
callback () | |
This method is called by CASClient::CASClient() when running in callback mode. | |
initPGTStorage () | |
This method is used to initialize the storage of PGT's. | |
storePGT ($pgt, $pgt_iou) | |
This method stores a PGT. | |
loadPGT ($pgt_iou) | |
This method reads a PGT from its Iou and deletes the corresponding storage entry. | |
validatePGT (&$validate_url, $text_response, $tree_response) | |
This method is used to validate a PGT; halt on failure. | |
retrievePT ($target_service, &$err_code, &$err_msg) | |
This method is used to retrieve PT's from the CAS server thanks to a PGT. | |
readURL ($url, $cookies, &$headers, &$body, &$err_msg) | |
This method is used to acces a remote URL. | |
buildSAMLPayload () | |
This method is used to build the SAML POST body sent to /samlValidate URL. | |
getPT () | |
This method returns the Proxy Ticket provided in the URL of the request. | |
setPT ($pt) | |
This method stores the Proxy Ticket. | |
hasPT () | |
This method tells if a Proxy Ticket was stored. | |
getSA () | |
This method returns the SAML Ticket provided in the URL of the request. | |
setSA ($sa) | |
This method stores the SAML Ticket. | |
hasSA () | |
This method tells if a SAML Ticket was stored. | |
validatePT (&$validate_url, &$text_response, &$tree_response) | |
This method is used to validate a ST or PT; halt on failure Used for all CAS 2.0 validations. | |
getURL () | |
This method returns the URL of the current request (without any ticket CGI parameter). | |
setURL ($url) | |
This method sets the URL of the current request. | |
authError ($failure, $cas_url, $no_response, $bad_response='', $cas_response='', $err_code='', $err_msg='') | |
This method is used to print the HTML output when the user was not authenticated. | |
HTMLFilterOutput ($str) | |
This method filters a string by replacing special tokens by appropriate values and prints it. | |
printHTMLHeader ($title) | |
This method prints the header of the HTML output (after filtering). | |
printHTMLFooter () | |
This method prints the footer of the HTML output (after filtering). | |
getLang () | |
This method returns the language used by phpCAS. | |
getString ($str) | |
This method returns a string depending on the language. | |
getServerVersion () | |
This method is used to retrieve the version of the CAS server. | |
getServerHostname () | |
This method is used to retrieve the hostname of the CAS server. | |
getServerPort () | |
This method is used to retrieve the port of the CAS server. | |
getServerURI () | |
This method is used to retrieve the URI of the CAS server. | |
getServerBaseURL () | |
This method is used to retrieve the base URL of the CAS server. | |
getServerLoginURL ($gateway) | |
This method is used to retrieve the login URL of the CAS server. | |
getServerServiceValidateURL () | |
This method is used to retrieve the service validating URL of the CAS server. | |
getServerProxyValidateURL () | |
This method is used to retrieve the proxy validating URL of the CAS server. | |
getServerProxyURL () | |
This method is used to retrieve the proxy URL of the CAS server. | |
getServerLogoutURL () | |
This method is used to retrieve the logout URL of the CAS server. | |
setUser ($user) | |
This method sets the CAS user's login name. | |
wasPreviouslyAuthenticated () | |
This method tells if the user has already been (previously) authenticated by looking into the session variables. | |
getST () | |
This method returns the Service Ticket provided in the URL of the request. | |
setST ($st) | |
This method stores the Service Ticket. | |
hasST () | |
This method tells if a Service Ticket was stored. | |
validateST ($validate_url, &$text_response, &$tree_response) | |
This method is used to validate a ST; halt on failure, and sets $validate_url, $text_reponse and $tree_response on success. | |
isProxy () | |
Tells if a CAS client is a CAS proxy or not. | |
getPGT () | |
This method returns the Proxy Granting Ticket given by the CAS server. | |
setPGT ($pgt) | |
This method stores the Proxy Granting Ticket. | |
hasPGT () | |
This method tells if a Proxy Granting Ticket was stored. | |
setCallbackMode ($callback_mode) | |
This method sets/unsets callback mode. | |
isCallbackMode () | |
This method returns TRUE when the CAs client is running i callback mode, FALSE otherwise. | |
getCallbackURL () | |
This method returns the URL that should be used for the PGT callback (in fact the URL of the current request without any CGI parameter, except if phpCAS::setFixedCallbackURL() was used). | |
setCallbackURL ($url) | |
This method sets the callback url. | |
callback () | |
This method is called by CASClient::CASClient() when running in callback mode. | |
initPGTStorage () | |
This method is used to initialize the storage of PGT's. | |
storePGT ($pgt, $pgt_iou) | |
This method stores a PGT. | |
loadPGT ($pgt_iou) | |
This method reads a PGT from its Iou and deletes the corresponding storage entry. | |
validatePGT (&$validate_url, $text_response, $tree_response) | |
This method is used to validate a PGT; halt on failure. | |
retrievePT ($target_service, &$err_code, &$err_msg) | |
This method is used to retrieve PT's from the CAS server thanks to a PGT. | |
readURL ($url, $cookies, &$headers, &$body, &$err_msg) | |
This method is used to acces a remote URL. | |
getPT () | |
This method returns the Proxy Ticket provided in the URL of the request. | |
setPT ($pt) | |
This method stores the Proxy Ticket. | |
hasPT () | |
This method tells if a Proxy Ticket was stored. | |
validatePT (&$validate_url, &$text_response, &$tree_response) | |
This method is used to validate a PT; halt on failure. | |
getURL () | |
This method returns the URL of the current request (without any ticket CGI parameter). | |
setURL ($url) | |
This method sets the URL of the current request. | |
authError ($failure, $cas_url, $no_response, $bad_response='', $cas_response='', $err_code='', $err_msg='') | |
This method is used to print the HTML output when the user was not authenticated. | |
HTMLFilterOutput ($str) | |
This method filters a string by replacing special tokens by appropriate values and prints it. | |
printHTMLHeader ($title) | |
This method prints the header of the HTML output (after filtering). | |
printHTMLFooter () | |
This method prints the footer of the HTML output (after filtering). | |
getLang () | |
This method returns the language used by phpCAS. | |
getString ($str) | |
This method returns a string depending on the language. | |
getServerVersion () | |
This method is used to retrieve the version of the CAS server. | |
getServerHostname () | |
This method is used to retrieve the hostname of the CAS server. | |
getServerPort () | |
This method is used to retrieve the port of the CAS server. | |
getServerURI () | |
This method is used to retrieve the URI of the CAS server. | |
getServerBaseURL () | |
This method is used to retrieve the base URL of the CAS server. | |
getServerLoginURL ($gateway) | |
This method is used to retrieve the login URL of the CAS server. | |
getServerServiceValidateURL () | |
This method is used to retrieve the service validating URL of the CAS server. | |
getServerProxyValidateURL () | |
This method is used to retrieve the proxy validating URL of the CAS server. | |
getServerProxyURL () | |
This method is used to retrieve the proxy URL of the CAS server. | |
getServerLogoutURL () | |
This method is used to retrieve the logout URL of the CAS server. | |
setUser ($user) | |
This method sets the CAS user's login name. | |
wasPreviouslyAuthenticated () | |
This method tells if the user has already been (previously) authenticated by looking into the session variables. | |
getST () | |
This method returns the Service Ticket provided in the URL of the request. | |
setST ($st) | |
This method stores the Service Ticket. | |
hasST () | |
This method tells if a Service Ticket was stored. | |
validateST ($validate_url, &$text_response, &$tree_response) | |
This method is used to validate a ST; halt on failure, and sets $validate_url, $text_reponse and $tree_response on success. | |
isProxy () | |
Tells if a CAS client is a CAS proxy or not. | |
getPGT () | |
This method returns the Proxy Granting Ticket given by the CAS server. | |
setPGT ($pgt) | |
This method stores the Proxy Granting Ticket. | |
hasPGT () | |
This method tells if a Proxy Granting Ticket was stored. | |
setCallbackMode ($callback_mode) | |
This method sets/unsets callback mode. | |
isCallbackMode () | |
This method returns TRUE when the CAs client is running i callback mode, FALSE otherwise. | |
getCallbackURL () | |
This method returns the URL that should be used for the PGT callback (in fact the URL of the current request without any CGI parameter, except if phpCAS::setFixedCallbackURL() was used). | |
setCallbackURL ($url) | |
This method sets the callback url. | |
callback () | |
This method is called by CASClient::CASClient() when running in callback mode. | |
initPGTStorage () | |
This method is used to initialize the storage of PGT's. | |
storePGT ($pgt, $pgt_iou) | |
This method stores a PGT. | |
loadPGT ($pgt_iou) | |
This method reads a PGT from its Iou and deletes the corresponding storage entry. | |
validatePGT (&$validate_url, $text_response, $tree_response) | |
This method is used to validate a PGT; halt on failure. | |
retrievePT ($target_service, &$err_code, &$err_msg) | |
This method is used to retrieve PT's from the CAS server thanks to a PGT. | |
readURL ($url, $cookies, &$headers, &$body, &$err_msg) | |
This method is used to acces a remote URL. | |
getPT () | |
This method returns the Proxy Ticket provided in the URL of the request. | |
setPT ($pt) | |
This method stores the Proxy Ticket. | |
hasPT () | |
This method tells if a Proxy Ticket was stored. | |
validatePT (&$validate_url, &$text_response, &$tree_response) | |
This method is used to validate a PT; halt on failure. | |
getURL () | |
This method returns the URL of the current request (without any ticket CGI parameter). | |
setURL ($url) | |
This method sets the URL of the current request. | |
authError ($failure, $cas_url, $no_response, $bad_response='', $cas_response='', $err_code='', $err_msg='') | |
This method is used to print the HTML output when the user was not authenticated. |
Private Attributes | |
$_output_header | |
A string used to print the header of HTML pages. | |
$_output_footer | |
A string used to print the footer of HTML pages. | |
$_lang | |
A string corresponding to the language used by phpCAS. | |
$_strings | |
array containing the strings used by phpCAS. | |
$_server | |
a record to store information about the CAS server. | |
$_start_session | |
A variable to whether phpcas will use its own session handling. | |
$_user | |
The Authenticated user. | |
$_attributes | |
The Authenticated users attributes. | |
$_cache_times_for_auth_recheck | |
An integer that gives the number of times authentication will be cached before rechecked. | |
$_st | |
the Service Ticket provided in the URL of the request if present (empty otherwise). | |
$_cas_server_cert | |
the certificate of the CAS server. | |
$_cas_server_ca_cert | |
the certificate of the CAS server CA. | |
$_no_cas_server_validation | |
Set to true not to validate the CAS server. | |
$_proxy | |
A boolean telling if the client is a CAS proxy or not. | |
$_pgt | |
the Proxy Grnting Ticket given by the CAS server (empty otherwise). | |
$_callback_mode | |
each PHP script using phpCAS in proxy mode is its own callback to get the PGT back from the CAS server. | |
$_callback_url | |
the URL that should be used for the PGT callback (in fact the URL of the current request without any CGI parameter). | |
$_pgt_storage | |
an instance of a class inheriting of PGTStorage, used to deal with PGT storage. | |
$_pt | |
the Proxy Ticket provided in the URL of the request if present (empty otherwise). | |
$_url | |
the URL of the current request (without any ticket CGI parameter). |
The CASClient class is a client interface that provides CAS authentication to PHP applications.
Definition at line 51 of file client.php.
|
private |
This method is used to print the HTML output when the user was not authenticated.
$failure | the failure that occured |
$cas_url | the URL the CAS server was asked for |
$no_response | the response from the CAS server (other parameters are ignored if TRUE) |
$bad_response | bad response from the CAS server ($err_code and $err_msg ignored if TRUE) |
$cas_response | the response of the CAS server |
$err_code | the error code given by the CAS server |
$err_msg | the error message given by the CAS server |
Definition at line 1919 of file client.php.
References $failure, CAS_STR_AUTHENTICATION_FAILED, CAS_STR_YOU_WERE_NOT_AUTHENTICATED, CAS_VERSION_1_0, CAS_VERSION_2_0, exit, phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceExit().
|
private |
This method is used to print the HTML output when the user was not authenticated.
$failure | the failure that occured |
$cas_url | the URL the CAS server was asked for |
$no_response | the response from the CAS server (other parameters are ignored if TRUE) |
$bad_response | bad response from the CAS server ($err_code and $err_msg ignored if TRUE) |
$cas_response | the response of the CAS server |
$err_code | the error code given by the CAS server |
$err_msg | the error message given by the CAS server |
Definition at line 1927 of file client4.php.
References $failure, CAS_STR_AUTHENTICATION_FAILED, CAS_STR_YOU_WERE_NOT_AUTHENTICATED, CAS_VERSION_1_0, CAS_VERSION_2_0, exit, phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceExit().
|
private |
This method is called by CASClient::CASClient() when running in callback mode.
It stores the PGT and its PGT Iou, prints its output and halts.
Definition at line 1161 of file client.php.
References $_GET, phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceExit().
|
private |
This method is called by CASClient::CASClient() when running in callback mode.
It stores the PGT and its PGT Iou, prints its output and halts.
Definition at line 1169 of file client4.php.
References $_GET, phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceExit().
CASClient::CASClient | ( | $server_version, | |
$proxy, | |||
$server_hostname, | |||
$server_port, | |||
$server_uri, | |||
$start_session = true |
|||
) |
CASClient constructor.
$server_version | the version of the CAS server |
$proxy | TRUE if the CAS client is a CAS proxy, FALSE otherwise |
$server_hostname | the hostname of the CAS server |
$server_port | the port the CAS server is running on |
$server_uri | the URI the CAS server is responding on |
$start_session | Have phpCAS start PHP sessions (default true) |
Definition at line 435 of file client.php.
References $_GET, $proxy, CAS_VERSION_1_0, CAS_VERSION_2_0, phpCAS\error(), isCallbackMode(), isProxy(), setCallbackMode(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
CASClient::CASClient | ( | $server_version, | |
$proxy, | |||
$server_hostname, | |||
$server_port, | |||
$server_uri, | |||
$start_session = true |
|||
) |
CASClient constructor.
$server_version | the version of the CAS server |
$proxy | TRUE if the CAS client is a CAS proxy, FALSE otherwise |
$server_hostname | the hostname of the CAS server |
$server_port | the port the CAS server is running on |
$server_uri | the URI the CAS server is responding on |
$start_session | Have phpCAS start PHP sessions (default true) |
Definition at line 444 of file client4.php.
References $_GET, $proxy, CAS_VERSION_1_0, CAS_VERSION_2_0, phpCAS\error(), isCallbackMode(), isProxy(), setCallbackMode(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
CASClient::checkAuthentication | ( | ) |
This method is called to check whether the ser is authenticated or not.
Definition at line 603 of file client.php.
References $_SESSION, $res, isAuthenticated(), redirectToCas(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
CASClient::checkAuthentication | ( | ) |
This method is called to check whether the ser is authenticated or not.
Definition at line 612 of file client4.php.
References $_SESSION, $res, isAuthenticated(), redirectToCas(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
CASClient::forceAuthentication | ( | ) |
This method is called to be sure that the user is authenticated.
When not authenticated, halt by redirecting to the CAS server; otherwise return TRUE.
Definition at line 579 of file client.php.
References $_SESSION, $res, isAuthenticated(), redirectToCas(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
CASClient::forceAuthentication | ( | ) |
This method is called to be sure that the user is authenticated.
When not authenticated, halt by redirecting to the CAS server; otherwise return TRUE.
Definition at line 588 of file client4.php.
References $_SESSION, $res, isAuthenticated(), redirectToCas(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
|
private |
This method returns the URL that should be used for the PGT callback (in fact the URL of the current request without any CGI parameter, except if phpCAS::setFixedCallbackURL() was used).
Definition at line 1107 of file client.php.
References $request_uri.
|
private |
This method returns the URL that should be used for the PGT callback (in fact the URL of the current request without any CGI parameter, except if phpCAS::setFixedCallbackURL() was used).
Definition at line 1116 of file client4.php.
References $request_uri.
|
private |
This method returns the language used by phpCAS.
Definition at line 165 of file client.php.
References $_lang, PHPCAS_LANG_DEFAULT, and setLang().
|
private |
This method returns the language used by phpCAS.
Definition at line 178 of file client4.php.
References $_lang, PHPCAS_LANG_DEFAULT, and setLang().
|
private |
This method returns the Proxy Granting Ticket given by the CAS server.
Definition at line 1020 of file client.php.
|
private |
This method returns the Proxy Granting Ticket given by the CAS server.
Definition at line 1029 of file client4.php.
|
private |
This method returns the Proxy Ticket provided in the URL of the request.
Definition at line 1697 of file client.php.
|
private |
This method returns the Proxy Ticket provided in the URL of the request.
Definition at line 1705 of file client4.php.
|
private |
This method is used to retrieve the base URL of the CAS server.
Definition at line 302 of file client.php.
|
private |
This method is used to retrieve the base URL of the CAS server.
Definition at line 315 of file client4.php.
|
private |
This method is used to retrieve the hostname of the CAS server.
Definition at line 278 of file client.php.
|
private |
This method is used to retrieve the hostname of the CAS server.
Definition at line 291 of file client4.php.
|
private |
This method is used to retrieve the login URL of the CAS server.
$gateway | true to check authentication, false to force it |
Definition at line 334 of file client4.php.
References getServerBaseURL(), getURL(), phpCAS\traceBegin(), and phpCAS\traceEnd().
|
private |
This method is used to retrieve the logout URL of the CAS server.
Definition at line 409 of file client.php.
References getServerBaseURL().
|
private |
This method is used to retrieve the logout URL of the CAS server.
Definition at line 418 of file client4.php.
References getServerBaseURL().
|
private |
This method is used to retrieve the port of the CAS server.
Definition at line 286 of file client.php.
|
private |
This method is used to retrieve the port of the CAS server.
Definition at line 299 of file client4.php.
|
private |
This method is used to retrieve the proxy URL of the CAS server.
Definition at line 388 of file client.php.
References CAS_VERSION_1_0, CAS_VERSION_2_0, getServerBaseURL(), and getServerVersion().
|
private |
This method is used to retrieve the proxy URL of the CAS server.
Definition at line 397 of file client4.php.
References CAS_VERSION_1_0, CAS_VERSION_2_0, getServerBaseURL(), and getServerVersion().
|
private |
This method is used to retrieve the proxy validating URL of the CAS server.
Definition at line 367 of file client.php.
References CAS_VERSION_1_0, CAS_VERSION_2_0, getServerBaseURL(), getServerVersion(), and getURL().
|
private |
This method is used to retrieve the proxy validating URL of the CAS server.
Definition at line 376 of file client4.php.
References CAS_VERSION_1_0, CAS_VERSION_2_0, getServerBaseURL(), getServerVersion(), and getURL().
|
private |
This method is used to retrieve the service validating URL of the CAS server.
Definition at line 346 of file client.php.
References CAS_VERSION_1_0, CAS_VERSION_2_0, getServerBaseURL(), getServerVersion(), and getURL().
|
private |
This method is used to retrieve the service validating URL of the CAS server.
Definition at line 355 of file client4.php.
References CAS_VERSION_1_0, CAS_VERSION_2_0, getServerBaseURL(), getServerVersion(), and getURL().
|
private |
This method is used to retrieve the URI of the CAS server.
Definition at line 294 of file client.php.
|
private |
This method is used to retrieve the URI of the CAS server.
Definition at line 307 of file client4.php.
|
private |
This method is used to retrieve the version of the CAS server.
Definition at line 268 of file client.php.
|
private |
This method is used to retrieve the version of the CAS server.
Definition at line 281 of file client4.php.
|
private |
This method returns the Service Ticket provided in the URL of the request.
Definition at line 810 of file client.php.
References $_st.
|
private |
This method returns the Service Ticket provided in the URL of the request.
Definition at line 819 of file client4.php.
References $_st.
CASClient::getStartSession | ( | $session | ) |
Definition at line 724 of file client.php.
|
private |
This method returns a string depending on the language.
$str | the index of the string in $_string. |
Definition at line 192 of file client.php.
References _strings, and getLang().
|
private |
This method returns a string depending on the language.
$str | the index of the string in $_string. |
Definition at line 205 of file client4.php.
References _strings, and getLang().
|
private |
This method returns the URL of the current request (without any ticket CGI parameter).
Definition at line 1846 of file client.php.
|
private |
This method returns the URL of the current request (without any ticket CGI parameter).
Definition at line 1854 of file client4.php.
CASClient::getUser | ( | ) |
This method returns the CAS user's login name.
Definition at line 565 of file client.php.
References $_user, and phpCAS\error().
CASClient::getUser | ( | ) |
This method returns the CAS user's login name.
Definition at line 574 of file client4.php.
References $_user, and phpCAS\error().
|
private |
This method tells if a Proxy Granting Ticket was stored.
Definition at line 1036 of file client.php.
|
private |
This method tells if a Proxy Granting Ticket was stored.
Definition at line 1045 of file client4.php.
|
private |
This method tells if a Proxy Ticket was stored.
Definition at line 1713 of file client.php.
|
private |
This method tells if a Proxy Ticket was stored.
Definition at line 1721 of file client4.php.
|
private |
This method tells if a Service Ticket was stored.
Definition at line 826 of file client.php.
|
private |
This method tells if a Service Ticket was stored.
Definition at line 835 of file client4.php.
|
private |
This method filters a string by replacing special tokens by appropriate values and prints it.
The corresponding tokens are taken into account:
Used by CASClient::PrintHTMLHeader() and CASClient::printHTMLFooter().
$str | the string to filter and output |
Definition at line 52 of file client.php.
References getServerBaseURL(), getServerVersion(), and phpCAS\getVersion().
|
private |
This method filters a string by replacing special tokens by appropriate values and prints it.
The corresponding tokens are taken into account:
Used by CASClient::PrintHTMLHeader() and CASClient::printHTMLFooter().
$str | the string to filter and output |
Definition at line 65 of file client4.php.
References getServerBaseURL(), getServerVersion(), and phpCAS\getVersion().
|
private |
This method is used to initialize the storage of PGT's.
Halts on error.
Definition at line 1200 of file client.php.
|
private |
This method is used to initialize the storage of PGT's.
Halts on error.
Definition at line 1208 of file client4.php.
CASClient::isAuthenticated | ( | ) |
This method is called to check if the user is authenticated (previously or by tickets given in the URL.
Definition at line 632 of file client.php.
References $_SESSION, $res, elseif(), getPGT(), getPT(), getST(), getUser(), hasST(), isProxy(), phpCAS\trace(), phpCAS\traceBegin(), phpCAS\traceEnd(), validatePGT(), validatePT(), and wasPreviouslyAuthenticated().
CASClient::isAuthenticated | ( | ) |
This method is called to check if the user is authenticated (previously or by tickets given in the URL.
Definition at line 641 of file client4.php.
References $_SESSION, $res, elseif(), getPGT(), getPT(), getST(), getUser(), hasST(), isProxy(), phpCAS\trace(), phpCAS\traceBegin(), phpCAS\traceEnd(), validatePGT(), validatePT(), and wasPreviouslyAuthenticated().
|
private |
This method returns TRUE when the CAs client is running i callback mode, FALSE otherwise.
Definition at line 1083 of file client.php.
|
private |
This method returns TRUE when the CAs client is running i callback mode, FALSE otherwise.
Definition at line 1092 of file client4.php.
|
private |
Tells if a CAS client is a CAS proxy or not.
Definition at line 992 of file client.php.
|
private |
Tells if a CAS client is a CAS proxy or not.
Definition at line 1001 of file client4.php.
|
private |
This method reads a PGT from its Iou and deletes the corresponding storage entry.
$pgt_iou | the PGT Iou |
Definition at line 1236 of file client.php.
|
private |
This method reads a PGT from its Iou and deletes the corresponding storage entry.
$pgt_iou | the PGT Iou |
Definition at line 1244 of file client4.php.
CASClient::logout | ( | $url = "" | ) |
This method is used to logout from CAS.
$url | a URL that will be transmitted to the CAS server (to come back to when logged out) |
Definition at line 760 of file client.php.
References CAS_STR_LOGOUT, CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED, exit, getServerLogoutURL(), getString(), printHTMLFooter(), printHTMLHeader(), phpCAS\traceBegin(), and phpCAS\traceExit().
CASClient::logout | ( | $url = "" | ) |
This method is used to logout from CAS.
$url | a URL that will be transmitted to the CAS server (to come back to when logged out) |
Definition at line 769 of file client4.php.
References CAS_STR_LOGOUT, CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED, exit, getServerLogoutURL(), getString(), printHTMLFooter(), printHTMLHeader(), phpCAS\traceBegin(), and phpCAS\traceExit().
|
private |
This method prints the footer of the HTML output (after filtering).
If CASClient::setHTMLFooter() was not used, a default footer is output.
Definition at line 107 of file client.php.
References CAS_STR_USING_SERVER, getString(), and HTMLFilterOutput().
|
private |
This method prints the footer of the HTML output (after filtering).
If CASClient::setHTMLFooter() was not used, a default footer is output.
Definition at line 120 of file client4.php.
References CAS_STR_USING_SERVER, getString(), and HTMLFilterOutput().
|
private |
This method prints the header of the HTML output (after filtering).
If CASClient::setHTMLHeader() was not used, a default header is output.
$title | the title of the page |
Definition at line 79 of file client.php.
References $title, and HTMLFilterOutput().
|
private |
This method prints the header of the HTML output (after filtering).
If CASClient::setHTMLHeader() was not used, a default header is output.
$title | the title of the page |
Definition at line 92 of file client4.php.
References $title, and HTMLFilterOutput().
|
private |
This method is used to acces a remote URL.
$url | the URL to access. |
$cookies | an array containing cookies strings such as 'name=val' |
$headers | an array containing the HTTP header lines of the response (an empty array on failure). |
$body | the body of the response, as a string (empty on failure). |
$err_msg | an error message, filled on failure. |
Definition at line 1470 of file client.php.
References $res, phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
|
private |
This method is used to acces a remote URL.
$url | the URL to access. |
$cookies | an array containing cookies strings such as 'name=val' |
$headers | an array containing the HTTP header lines of the response (an empty array on failure). |
$body | the body of the response, as a string (empty on failure). |
$err_msg | an error message, filled on failure. |
Definition at line 1478 of file client4.php.
References $res, phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
CASClient::redirectToCas | ( | $gateway | ) |
This method is used to redirect the client to the CAS server.
It is used by CASClient::forceAuthentication() and CASClient::checkAuthentication().
$gateway | true to check authentication, false to force it |
Definition at line 752 of file client4.php.
References CAS_STR_AUTHENTICATION_WANTED, CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED, exit, getServerLoginURL(), getString(), printHTMLFooter(), printHTMLHeader(), phpCAS\traceBegin(), and phpCAS\traceExit().
CASClient::renameSession | ( | $ticket | ) |
Renaming the session.
Definition at line 732 of file client.php.
References $_SESSION, phpCAS\error(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
|
private |
This method is used to retrieve PT's from the CAS server thanks to a PGT.
$target_service | the service to ask for with the PT. |
$err_code | an error code (PHPCAS_SERVICE_OK on success). |
$err_msg | an error message (empty on success). |
Definition at line 1362 of file client.php.
References domxml_open_mem(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
|
private |
This method is used to retrieve PT's from the CAS server thanks to a PGT.
$target_service | the service to ask for with the PT. |
$err_code | an error code (PHPCAS_SERVICE_OK on success). |
$err_msg | an error message (empty on success). |
Definition at line 1370 of file client4.php.
References domxml_open_mem(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
CASClient::serviceMail | ( | $url, | |
$flags, | |||
& | $err_code, | ||
& | $err_msg, | ||
& | $pt | ||
) |
This method is used to access an IMAP/POP3/NNTP service.
$url | a string giving the URL of the service, including the mailing box for IMAP URLs, as accepted by imap_open(). |
$flags | options given to imap_open(). |
$err_code | an error code Possible values are PHPCAS_SERVICE_OK (on success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, PHPCAS_SERVICE_PT_FAILURE, PHPCAS_SERVICE_NOT AVAILABLE. |
$err_msg | an error message on failure |
$pt | the Proxy Ticket (PT) retrieved from the CAS server to access the URL on success, FALSE on error). |
Definition at line 1641 of file client4.php.
CASClient::serviceWeb | ( | $url, | |
& | $err_code, | ||
& | $output | ||
) |
This method is used to access an HTTP[S] service.
$url | the service to access. |
$err_code | an error code Possible values are PHPCAS_SERVICE_OK (on success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, PHPCAS_SERVICE_PT_FAILURE, PHPCAS_SERVICE_NOT AVAILABLE. |
$output | the output of the service (also used to give an error message on failure). |
Definition at line 1553 of file client.php.
References $_SESSION, $name, $res, CAS_STR_SERVICE_UNAVAILABLE, phpCAS\trace(), and phpCAS\traceBegin().
CASClient::serviceWeb | ( | $url, | |
& | $err_code, | ||
& | $output | ||
) |
This method is used to access an HTTP[S] service.
$url | the service to access. |
$err_code | an error code Possible values are PHPCAS_SERVICE_OK (on success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, PHPCAS_SERVICE_PT_FAILURE, PHPCAS_SERVICE_NOT AVAILABLE. |
$output | the output of the service (also used to give an error message on failure). |
Definition at line 1561 of file client4.php.
References $_SESSION, $name, $res, CAS_STR_SERVICE_UNAVAILABLE, phpCAS\trace(), and phpCAS\traceBegin().
|
private |
This method sets/unsets callback mode.
$callback_mode | TRUE to set callback mode, FALSE otherwise. |
Definition at line 1070 of file client.php.
|
private |
This method sets/unsets callback mode.
$callback_mode | TRUE to set callback mode, FALSE otherwise. |
Definition at line 1079 of file client4.php.
|
private |
This method sets the callback url.
$callback_url | url to set callback |
Definition at line 1150 of file client.php.
|
private |
This method sets the callback url.
$callback_url | url to set callback |
Definition at line 1158 of file client4.php.
CASClient::setHTMLFooter | ( | $footer | ) |
This method set the HTML footer used for all outputs.
$footer | the HTML footer. |
Definition at line 133 of file client.php.
CASClient::setHTMLFooter | ( | $footer | ) |
This method set the HTML footer used for all outputs.
$footer | the HTML footer. |
Definition at line 146 of file client4.php.
CASClient::setHTMLHeader | ( | $header | ) |
This method set the HTML header used for all outputs.
$header | the HTML header. |
Definition at line 121 of file client.php.
CASClient::setHTMLHeader | ( | $header | ) |
This method set the HTML header used for all outputs.
$header | the HTML header. |
Definition at line 134 of file client4.php.
CASClient::setLang | ( | $lang | ) |
This method is used to set the language used by phpCAS.
$lang | a string representing the language. |
Definition at line 212 of file client.php.
CASClient::setLang | ( | $lang | ) |
This method is used to set the language used by phpCAS.
$lang | a string representing the language. |
Definition at line 225 of file client4.php.
|
private |
This method stores the Proxy Granting Ticket.
$pgt | The Proxy Granting Ticket. |
Definition at line 1028 of file client.php.
|
private |
This method stores the Proxy Granting Ticket.
$pgt | The Proxy Granting Ticket. |
Definition at line 1037 of file client4.php.
CASClient::setPGTStorageDB | ( | $user, | |
$password, | |||
$database_type, | |||
$hostname, | |||
$port, | |||
$database, | |||
$table | |||
) |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests into a database.
$user | the user to access the data with |
$password | the user's password |
$database_type | the type of the database hosting the data |
$hostname | the server hosting the database |
$port | the port the server is listening on |
$database | the name of the database |
$table | the name of the table storing the data |
Definition at line 1282 of file client.php.
References $password, $user, and phpCAS\error().
CASClient::setPGTStorageDB | ( | $user, | |
$password, | |||
$database_type, | |||
$hostname, | |||
$port, | |||
$database, | |||
$table | |||
) |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests into a database.
$user | the user to access the data with |
$password | the user's password |
$database_type | the type of the database hosting the data |
$hostname | the server hosting the database |
$port | the port the server is listening on |
$database | the name of the database |
$table | the name of the table storing the data |
Definition at line 1290 of file client4.php.
References $password, $user, and phpCAS\error().
CASClient::setPGTStorageFile | ( | $format = '' , |
|
$path = '' |
|||
) |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests onto the filesystem.
$format | the format used to store the PGT's (`plain' and `xml' allowed) |
$path | the path where the PGT's should be stored |
Definition at line 1253 of file client.php.
References phpCAS\error().
CASClient::setPGTStorageFile | ( | $format = '' , |
|
$path = '' |
|||
) |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests onto the filesystem.
$format | the format used to store the PGT's (`plain' and `xml' allowed) |
$path | the path where the PGT's should be stored |
Definition at line 1261 of file client4.php.
References phpCAS\error().
|
private |
This method stores the Proxy Ticket.
$pt | The Proxy Ticket. |
Definition at line 1705 of file client.php.
|
private |
This method stores the Proxy Ticket.
$pt | The Proxy Ticket. |
Definition at line 1713 of file client4.php.
|
private |
This method stores the Service Ticket.
$st | The Service Ticket. |
Definition at line 818 of file client.php.
|
private |
This method stores the Service Ticket.
$st | The Service Ticket. |
Definition at line 827 of file client4.php.
CASClient::setStartSession | ( | $session | ) |
Definition at line 719 of file client.php.
|
private |
This method sets the URL of the current request.
$url | url to set for service |
Definition at line 1896 of file client.php.
|
private |
This method sets the URL of the current request.
$url | url to set for service |
Definition at line 1904 of file client4.php.
|
private |
This method sets the CAS user's login name.
$user | the login name of the authenticated user. |
Definition at line 553 of file client.php.
References $user.
|
private |
This method sets the CAS user's login name.
$user | the login name of the authenticated user. |
Definition at line 562 of file client4.php.
References $user.
|
private |
This method stores a PGT.
Halts on error.
$pgt | the PGT to store |
$pgt_iou | its corresponding Iou |
Definition at line 1219 of file client.php.
|
private |
This method stores a PGT.
Halts on error.
$pgt | the PGT to store |
$pgt_iou | its corresponding Iou |
Definition at line 1227 of file client4.php.
|
private |
This method is used to validate a PGT; halt on failure.
$validate_url | the URL of the request to the CAS server. |
$text_response | the response of the CAS server, as is (XML text); result of CASClient::validateST() or CASClient::validatePT(). |
$tree_response | the response of the CAS server, as a DOM XML tree; result of CASClient::validateST() or CASClient::validatePT(). |
Definition at line 1318 of file client.php.
References phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
|
private |
This method is used to validate a PGT; halt on failure.
$validate_url | the URL of the request to the CAS server. |
$text_response | the response of the CAS server, as is (XML text); result of CASClient::validateST() or CASClient::validatePT(). |
$tree_response | the response of the CAS server, as a DOM XML tree; result of CASClient::validateST() or CASClient::validatePT(). |
Definition at line 1326 of file client4.php.
References phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
|
private |
This method is used to validate a PT; halt on failure.
Definition at line 1732 of file client.php.
References phpCAS\trace(), and phpCAS\traceBegin().
|
private |
This method is used to validate a PT; halt on failure.
Definition at line 1740 of file client4.php.
References phpCAS\trace(), and phpCAS\traceBegin().
|
private |
This method is used to validate a ST; halt on failure, and sets $validate_url, $text_reponse and $tree_response on success.
These parameters are used later by CASClient::validatePGT() for CAS proxies.
$validate_url | the URL of the request to the CAS server. |
$text_response | the response of the CAS server, as is (XML text). |
$tree_response | the response of the CAS server, as a DOM XML tree. |
Definition at line 852 of file client.php.
References $user, authError(), domxml_open_mem(), getServerServiceValidateURL(), getST(), isProxy(), n, readURL(), setUser(), phpCAS\trace(), and phpCAS\traceBegin().
|
private |
This method is used to validate a ST; halt on failure, and sets $validate_url, $text_reponse and $tree_response on success.
These parameters are used later by CASClient::validatePGT() for CAS proxies.
$validate_url | the URL of the request to the CAS server. |
$text_response | the response of the CAS server, as is (XML text). |
$tree_response | the response of the CAS server, as a DOM XML tree. |
Definition at line 861 of file client4.php.
References $user, authError(), domxml_open_mem(), getServerServiceValidateURL(), getST(), hnodename(), isProxy(), n, readURL(), setUser(), phpCAS\trace(), and phpCAS\traceBegin().
|
private |
This method tells if the user has already been (previously) authenticated by looking into the session variables.
Definition at line 686 of file client.php.
References $_SESSION, $auth, callback(), elseif(), isCallbackMode(), isProxy(), setPGT(), setPT(), setST(), setUser(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
|
private |
This method tells if the user has already been (previously) authenticated by looking into the session variables.
Definition at line 695 of file client4.php.
References $_SESSION, $auth, callback(), elseif(), isCallbackMode(), isProxy(), setPGT(), setPT(), setST(), setUser(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().
|
private |
A variable to whether phpcas will use its own session handling.
Default = true
Definition at line 717 of file client.php.