ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Access to external services
+ Collaboration diagram for Access to external services:

Functions

static phpCAS::getProxiedService ($type)
 Answer a proxy-authenticated service handler. More...
 
static phpCAS::initializeProxiedService (CAS_ProxiedService $proxiedService)
 Initialize a proxied-service handler with the proxy-ticket it should use. More...
 
static phpCAS::serviceWeb ($url, &$err_code, &$output)
 This method is used to access an HTTP[S] service. More...
 
static phpCAS::serviceMail ($url, $service, $flags, &$err_code, &$err_msg, &$pt)
 This method is used to access an IMAP/POP3/NNTP service. More...
 

Variables

const PHPCAS_SERVICE_OK 0
 phpCAS::service() error code on success More...
 
const PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE 1
 phpCAS::service() error code when the PT could not retrieve because the CAS server did not respond. More...
 
const PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE 2
 phpCAS::service() error code when the PT could not retrieve because the response of the CAS server was ill-formed. More...
 
const PHPCAS_SERVICE_PT_FAILURE 3
 phpCAS::service() error code when the PT could not retrieve because the CAS server did not want to. More...
 
const PHPCAS_SERVICE_NOT_AVAILABLE 4
 phpCAS::service() error code when the service was not available. More...
 
const PHPCAS_PROXIED_SERVICE_HTTP_GET 'CAS_ProxiedService_Http_Get'
 phpCAS::getProxiedService() type for HTTP GET More...
 
const PHPCAS_PROXIED_SERVICE_HTTP_POST 'CAS_ProxiedService_Http_Post'
 phpCAS::getProxiedService() type for HTTP POST More...
 
const PHPCAS_PROXIED_SERVICE_IMAP 'CAS_ProxiedService_Imap'
 phpCAS::getProxiedService() type for IMAP More...
 

Detailed Description

Function Documentation

◆ getProxiedService()

static phpCAS::getProxiedService (   $type)
static

Answer a proxy-authenticated service handler.

Parameters
string$typeThe service type. One of PHPCAS_PROXIED_SERVICE_HTTP_GET; PHPCAS_PROXIED_SERVICE_HTTP_POST; PHPCAS_PROXIED_SERVICE_IMAP
Returns
CAS_ProxiedService
Exceptions
InvalidArgumentExceptionIf the service type is unknown.

Definition at line 888 of file CAS.php.

References $res, $type, phpCAS\_validateProxyExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

889  {
892 
893  try {
894  $res = self::$_PHPCAS_CLIENT->getProxiedService($type);
895  } catch (Exception $e) {
896  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
897  }
898 
900  return $res;
901  }
$type
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
foreach($_POST as $key=> $value) $res
static _validateProxyExists()
Checks of a proxy client aready exists.
Definition: CAS.php:1848
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
+ Here is the call graph for this function:

◆ initializeProxiedService()

static phpCAS::initializeProxiedService ( CAS_ProxiedService  $proxiedService)
static

Initialize a proxied-service handler with the proxy-ticket it should use.

Parameters
CAS_ProxiedService$proxiedServiceProxied Service Handler
Returns
void
Exceptions
CAS_ProxyTicketExceptionIf there is a proxy-ticket failure. The code of the Exception will be one of: PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE PHPCAS_SERVICE_PT_FAILURE

Definition at line 915 of file CAS.php.

References phpCAS\_validateProxyExists(), and phpCAS\error().

Referenced by CAS_ProxiedService_Abstract\initializeProxyTicket().

916  {
918 
919  try {
920  self::$_PHPCAS_CLIENT->initializeProxiedService($proxiedService);
921  } catch (Exception $e) {
922  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
923  }
924  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static _validateProxyExists()
Checks of a proxy client aready exists.
Definition: CAS.php:1848
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serviceMail()

static phpCAS::serviceMail (   $url,
  $service,
  $flags,
$err_code,
$err_msg,
$pt 
)
static

This method is used to access an IMAP/POP3/NNTP service.

Parameters
string$urla string giving the URL of the service, including the mailing box for IMAP URLs, as accepted by imap_open().
string$servicea string giving for CAS retrieve Proxy ticket
string$flagsoptions given to imap_open().
string&$err_codean 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.
string&$err_msgan error message on failure
string&$ptthe Proxy Ticket (PT) retrieved from the CAS server to access the URL on success, false on error).
Returns
object IMAP stream on success, false otherwise (in this later case, $err_code gives the reason why it failed and $err_msg contains an error message).

Definition at line 975 of file CAS.php.

References $res, $url, phpCAS\_validateProxyExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

976  {
979 
980  try {
981  $res = self::$_PHPCAS_CLIENT->serviceMail($url, $service, $flags, $err_code, $err_msg, $pt);
982  } catch (Exception $e) {
983  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
984  }
985 
987  return $res;
988  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
foreach($_POST as $key=> $value) $res
static _validateProxyExists()
Checks of a proxy client aready exists.
Definition: CAS.php:1848
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
+ Here is the call graph for this function:

◆ serviceWeb()

static phpCAS::serviceWeb (   $url,
$err_code,
$output 
)
static

This method is used to access an HTTP[S] service.

Parameters
string$urlthe service to access.
string&$err_codean 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.
string&$outputthe output of the service (also used to give an error message on failure).
Returns
bool true on success, false otherwise (in this later case, $err_code gives the reason why it failed and $output contains an error message).

Definition at line 941 of file CAS.php.

References Sabre\VObject\$output, $res, $url, phpCAS\_validateProxyExists(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

942  {
945 
946  try {
947  $res = self::$_PHPCAS_CLIENT->serviceWeb($url, $err_code, $output);
948  } catch (Exception $e) {
949  phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
950  }
951 
953  return $res;
954  }
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
foreach($_POST as $key=> $value) $res
static _validateProxyExists()
Checks of a proxy client aready exists.
Definition: CAS.php:1848
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:611
$url
+ Here is the call graph for this function:

Variable Documentation

◆ PHPCAS_PROXIED_SERVICE_HTTP_GET

const PHPCAS_PROXIED_SERVICE_HTTP_GET 'CAS_ProxiedService_Http_Get'

phpCAS::getProxiedService() type for HTTP GET

Definition at line 195 of file CAS.php.

Referenced by CAS_Client\getProxiedService(), and CAS_Client\serviceWeb().

◆ PHPCAS_PROXIED_SERVICE_HTTP_POST

const PHPCAS_PROXIED_SERVICE_HTTP_POST 'CAS_ProxiedService_Http_Post'

phpCAS::getProxiedService() type for HTTP POST

Definition at line 199 of file CAS.php.

Referenced by CAS_Client\getProxiedService().

◆ PHPCAS_PROXIED_SERVICE_IMAP

const PHPCAS_PROXIED_SERVICE_IMAP 'CAS_ProxiedService_Imap'

phpCAS::getProxiedService() type for IMAP

Definition at line 203 of file CAS.php.

Referenced by CAS_Client\getProxiedService(), and CAS_Client\serviceMail().

◆ PHPCAS_SERVICE_NOT_AVAILABLE

const PHPCAS_SERVICE_NOT_AVAILABLE 4

phpCAS::service() error code when the service was not available.

Definition at line 187 of file CAS.php.

Referenced by CAS_Client\serviceMail(), and CAS_Client\serviceWeb().

◆ PHPCAS_SERVICE_OK

const PHPCAS_SERVICE_OK 0

phpCAS::service() error code on success

Definition at line 168 of file CAS.php.

Referenced by CAS_Client\serviceMail(), and CAS_Client\serviceWeb().

◆ PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE

const PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE 2

phpCAS::service() error code when the PT could not retrieve because the response of the CAS server was ill-formed.

Definition at line 178 of file CAS.php.

Referenced by CAS_ProxyTicketException\__construct().

◆ PHPCAS_SERVICE_PT_FAILURE

const PHPCAS_SERVICE_PT_FAILURE 3

phpCAS::service() error code when the PT could not retrieve because the CAS server did not want to.

Definition at line 183 of file CAS.php.

Referenced by CAS_ProxyTicketException\__construct().

◆ PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE

const PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE 1

phpCAS::service() error code when the PT could not retrieve because the CAS server did not respond.

Definition at line 173 of file CAS.php.

Referenced by CAS_ProxyTicketException\__construct().