ILIAS
release_5-0 Revision 5.0.0-1144-gc4397b1f870
|
The phpCAS class is a simple container for the phpCAS library. More...
Public Member Functions | |
client ($server_version, $server_hostname, $server_port, $server_uri, $start_session=true) | |
phpCAS client initializer. More... | |
proxy ($server_version, $server_hostname, $server_port, $server_uri, $start_session=true) | |
phpCAS proxy initializer. More... | |
setDebug ($filename='') | |
Set/unset debug mode. More... | |
backtrace () | |
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4.3.0 only) More... | |
trace ($str) | |
This method is used to log something in debug mode. More... | |
traceBegin () | |
This method is used to indicate the start of the execution of a function in debug mode. More... | |
traceEnd ($res='') | |
This method is used to indicate the end of the execution of a function in debug mode. More... | |
traceExit () | |
This method is used to indicate the end of the execution of the program. More... | |
setLang ($lang) | |
This method is used to set the language used by phpCAS. More... | |
getVersion () | |
This method returns the phpCAS version. More... | |
setHTMLHeader ($header) | |
This method sets the HTML header used for all outputs. More... | |
setHTMLFooter ($footer) | |
This method sets the HTML footer used for all outputs. More... | |
setPGTStorageFile ($format='', $path='') | |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests onto the filesystem. More... | |
setPGTStorageDB ($user, $password, $database_type='', $hostname='', $port=0, $database='', $table='') | |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests into a database. More... | |
serviceWeb ($url, & $err_code, & $output) | |
This method is used to access an HTTP[S] service. More... | |
serviceMail ($url, $service, $flags, & $err_code, & $err_msg, & $pt) | |
This method is used to access an IMAP/POP3/NNTP service. More... | |
setCacheTimesForAuthRecheck ($n) | |
Set the times authentication will be cached before really accessing the CAS server in gateway mode: More... | |
checkAuthentication () | |
This method is called to check if the user is authenticated (use the gateway feature). More... | |
forceAuthentication () | |
This method is called to force authentication if the user was not already authenticated. More... | |
renewAuthentication () | |
This method is called to renew the authentication. More... | |
authenticate () | |
This method has been left from version 0.4.1 for compatibility reasons. More... | |
isAuthenticated () | |
This method is called to check if the user is authenticated (previously or by tickets given in the URL). More... | |
isSessionAuthenticated () | |
Checks whether authenticated based on $_SESSION. More... | |
getUser () | |
This method returns the CAS user's login name. More... | |
getAttributes () | |
This method returns the CAS user's login name. More... | |
handleLogoutRequests ($check_client=true, $allowed_clients=false) | |
Handle logout requests. More... | |
getServerLoginURL () | |
This method returns the URL to be used to login. More... | |
setServerLoginURL ($url='') | |
Set the login URL of the CAS server. More... | |
setServerServiceValidateURL ($url='') | |
Set the serviceValidate URL of the CAS server. More... | |
setServerProxyValidateURL ($url='') | |
Set the proxyValidate URL of the CAS server. More... | |
setServerSamlValidateURL ($url='') | |
Set the samlValidate URL of the CAS server. More... | |
getServerLogoutURL () | |
This method returns the URL to be used to login. More... | |
setServerLogoutURL ($url='') | |
Set the logout URL of the CAS server. More... | |
logout ($params="") | |
This method is used to logout from CAS. More... | |
logoutWithRedirectService ($service) | |
This method is used to logout from CAS. More... | |
logoutWithUrl ($url) | |
This method is used to logout from CAS. More... | |
logoutWithRedirectServiceAndUrl ($service, $url) | |
This method is used to logout from CAS. More... | |
setFixedCallbackURL ($url='') | |
Set the fixed URL that will be used by the CAS server to transmit the PGT. More... | |
setFixedServiceURL ($url) | |
Set the fixed URL that will be set as the CAS service parameter. More... | |
getServiceURL () | |
Get the URL that is set as the CAS service parameter. More... | |
retrievePT ($target_service, & $err_code, & $err_msg) | |
Retrieve a Proxy Ticket from the CAS server. More... | |
setCasServerCert ($cert) | |
Set the certificate of the CAS server. More... | |
setCasServerCACert ($cert) | |
Set the certificate of the CAS server CA. More... | |
setNoCasServerValidation () | |
Set no SSL validation for the CAS server. More... | |
setExtraCurlOption ($key, $value) | |
Change CURL options. More... | |
client ($server_version, $server_hostname, $server_port, $server_uri, $start_session=true) | |
phpCAS client initializer. More... | |
proxy ($server_version, $server_hostname, $server_port, $server_uri, $start_session=true) | |
phpCAS proxy initializer. More... | |
setDebug ($filename='') | |
Set/unset debug mode. More... | |
backtrace () | |
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4.3.0 only) More... | |
trace ($str) | |
This method is used to log something in debug mode. More... | |
traceBegin () | |
This method is used to indicate the start of the execution of a function in debug mode. More... | |
traceEnd ($res='') | |
This method is used to indicate the end of the execution of a function in debug mode. More... | |
traceExit () | |
This method is used to indicate the end of the execution of the program. More... | |
setLang ($lang) | |
This method is used to set the language used by phpCAS. More... | |
getVersion () | |
This method returns the phpCAS version. More... | |
setHTMLHeader ($header) | |
This method sets the HTML header used for all outputs. More... | |
setHTMLFooter ($footer) | |
This method sets the HTML footer used for all outputs. More... | |
setPGTStorageFile ($format='', $path='') | |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests onto the filesystem. More... | |
setPGTStorageDB ($user, $password, $database_type='', $hostname='', $port=0, $database='', $table='') | |
This method is used to tell phpCAS to store the response of the CAS server to PGT requests into a database. More... | |
serviceWeb ($url, &$err_code, &$output) | |
This method is used to access an HTTP[S] service. More... | |
serviceMail ($url, $flags, &$err_code, &$err_msg, &$pt) | |
This method is used to access an IMAP/POP3/NNTP service. More... | |
checkAuthentication () | |
This method is called to check if the user is authenticated (use the gateway feature). More... | |
forceAuthentication () | |
This method is called to force authentication if the user was not already authenticated. More... | |
authenticate () | |
This method has been left from version 0.4.1 for compatibility reasons. More... | |
isAuthenticated () | |
This method has been left from version 0.4.19 for compatibility reasons. More... | |
getUser () | |
This method returns the CAS user's login name. More... | |
getServerLoginURL () | |
This method returns the URL to be used to login. More... | |
getServerLogoutURL () | |
This method returns the URL to be used to login. More... | |
logout ($url="") | |
This method is used to logout from CAS. More... | |
setFixedCallbackURL ($url='') | |
Set the fixed URL that will be used by the CAS server to transmit the PGT. More... | |
setFixedServiceURL ($url) | |
Set the fixed URL that will be set as the CAS service parameter. More... | |
getServiceURL () | |
Get the URL that is set as the CAS service parameter. More... | |
retrievePT ($target_service, &$err_code, &$err_msg) | |
Retrieve a Proxy Ticket from the CAS server. More... | |
Private Member Functions | |
log ($str) | |
Logs a string in debug mode. More... | |
error ($msg) | |
This method is used by interface methods to print an error and where the function was originally called from. More... | |
log ($str) | |
Logs a string in debug mode. More... | |
error ($msg) | |
This method is used by interface methods to print an error and where the function was originally called from. More... | |
The phpCAS class is a simple container for the phpCAS library.
It provides CAS authentication for web applications written in PHP.
phpCAS::authenticate | ( | ) |
This method has been left from version 0.4.1 for compatibility reasons.
Definition at line 902 of file CAS.php.
phpCAS::backtrace | ( | ) |
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4.3.0 only)
phpCAS::checkAuthentication | ( | ) |
This method is called to check if the user is authenticated (use the gateway feature).
Definition at line 843 of file CAS.php.
References $auth, $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, backtrace(), error(), traceBegin(), and traceEnd().
phpCAS::client | ( | $server_version, | |
$server_hostname, | |||
$server_port, | |||
$server_uri, | |||
$start_session = true |
|||
) |
phpCAS client initializer.
$server_version | the version of the CAS server |
$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 270 of file CAS.php.
References $PHPCAS_CLIENT, $PHPCAS_INIT_CALL, backtrace(), error(), traceBegin(), and traceEnd().
|
private |
This method is used by interface methods to print an error and where the function was originally called from.
$msg | the message to print |
Definition at line 454 of file CAS.php.
References $file, backtrace(), exit, trace(), and traceExit().
phpCAS::forceAuthentication | ( | ) |
This method is called to force authentication if the user was not already authenticated.
If the user is not authenticated, halt by redirecting to the CAS server.
Definition at line 870 of file CAS.php.
References $auth, $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, backtrace(), error(), getUser(), trace(), and traceBegin().
phpCAS::getServerLoginURL | ( | ) |
This method returns the URL to be used to login.
Definition at line 943 of file CAS.php.
References $PHPCAS_CLIENT, and error().
phpCAS::getServerLogoutURL | ( | ) |
This method returns the URL to be used to login.
Definition at line 958 of file CAS.php.
References $PHPCAS_CLIENT, and error().
phpCAS::getServiceURL | ( | ) |
Get the URL that is set as the CAS service parameter.
Definition at line 1030 of file CAS.php.
References $PHPCAS_CLIENT, and error().
phpCAS::getUser | ( | ) |
This method returns the CAS user's login name.
Definition at line 922 of file CAS.php.
References $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, and error().
phpCAS::getVersion | ( | ) |
This method returns the phpCAS version.
Definition at line 585 of file CAS.php.
References PHPCAS_VERSION.
phpCAS::isAuthenticated | ( | ) |
This method has been left from version 0.4.19 for compatibility reasons.
Definition at line 910 of file CAS.php.
References error().
|
private |
Logs a string in debug mode.
$str | the string to write |
Definition at line 432 of file CAS.php.
References $PHPCAS_DEBUG.
phpCAS::logout | ( | $url = "" | ) |
This method is used to logout from CAS.
Halts by redirecting to the CAS server.
$url | a URL that will be transmitted to the CAS server (to come back to when logged out) |
Definition at line 971 of file CAS.php.
References $PHPCAS_CLIENT, error(), traceBegin(), and traceEnd().
phpCAS::proxy | ( | $server_version, | |
$server_hostname, | |||
$server_port, | |||
$server_uri, | |||
$start_session = true |
|||
) |
phpCAS proxy initializer.
$server_version | the version of the CAS server |
$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 321 of file CAS.php.
References $PHPCAS_CLIENT, $PHPCAS_INIT_CALL, backtrace(), error(), traceBegin(), and traceEnd().
phpCAS::retrievePT | ( | $target_service, | |
& | $err_code, | ||
& | $err_msg | ||
) |
Retrieve a Proxy Ticket from the CAS server.
Definition at line 1042 of file CAS.php.
References $PHPCAS_CLIENT, and error().
phpCAS::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 756 of file CAS.php.
References $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, $res, error(), traceBegin(), and traceEnd().
phpCAS::setDebug | ( | $filename = '' | ) |
Set/unset debug mode.
$filename | the name of the file used for logging, or FALSE to stop debugging. |
Definition at line 373 of file CAS.php.
References $filename, $PHPCAS_DEBUG, error(), and trace().
phpCAS::setExtraCurlOption | ( | $key, | |
$value | |||
) |
Change CURL options.
CURL is used to connect through HTTPS to CAS server
$key | the option key |
$value | the value to set |
Definition at line 1469 of file CAS.php.
References $PHPCAS_CLIENT, error(), traceBegin(), and traceEnd().
phpCAS::setFixedCallbackURL | ( | $url = '' | ) |
Set the fixed URL that will be used by the CAS server to transmit the PGT.
When this method is not called, a phpCAS script uses its own URL for the callback.
$url | the URL |
Definition at line 990 of file CAS.php.
References $PHPCAS_CLIENT, error(), traceBegin(), and traceEnd().
phpCAS::setFixedServiceURL | ( | $url | ) |
Set the fixed URL that will be set as the CAS service parameter.
When this method is not called, a phpCAS script uses its own URL.
$url | the URL |
Definition at line 1013 of file CAS.php.
References $PHPCAS_CLIENT, error(), traceBegin(), and traceEnd().
phpCAS::setHTMLFooter | ( | $footer | ) |
This method sets the HTML footer used for all outputs.
$footer | the HTML footer. |
Definition at line 621 of file CAS.php.
References $PHPCAS_CLIENT, and error().
phpCAS::setHTMLHeader | ( | $header | ) |
This method sets the HTML header used for all outputs.
$header | the HTML header. |
Definition at line 604 of file CAS.php.
References $PHPCAS_CLIENT, and error().
phpCAS::setLang | ( | $lang | ) |
This method is used to set the language used by phpCAS.
$lang | a string representing the language. |
Definition at line 559 of file CAS.php.
References $lang, $PHPCAS_CLIENT, and error().
phpCAS::setPGTStorageDB | ( | $user, | |
$password, | |||
$database_type = '' , |
|||
$hostname = '' , |
|||
$port = 0 , |
|||
$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 689 of file CAS.php.
References $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, error(), traceBegin(), and traceEnd().
phpCAS::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 649 of file CAS.php.
References $path, $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, error(), traceBegin(), and traceEnd().
phpCAS::trace | ( | $str | ) |
This method is used to log something in debug mode.
Definition at line 480 of file CAS.php.
References backtrace(), and log().
phpCAS::traceBegin | ( | ) |
This method is used to indicate the start of the execution of a function in debug mode.
Definition at line 489 of file CAS.php.
References $PHPCAS_DEBUG, backtrace(), and log().
phpCAS::traceEnd | ( | $res = '' | ) |
This method is used to indicate the end of the execution of a function in debug mode.
$res | the result of the function |
Definition at line 517 of file CAS.php.
References $PHPCAS_DEBUG, $res, backtrace(), and log().
phpCAS::traceExit | ( | ) |
This method is used to indicate the end of the execution of the program.
Definition at line 531 of file CAS.php.
References $PHPCAS_DEBUG, and log().