ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 864 of file CAS.php.

865 {
868
869 try {
870 $res = self::$_PHPCAS_CLIENT->getProxiedService($type);
871 } catch (Exception $e) {
872 phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
873 }
874
876 return $res;
877 }
static _validateProxyExists()
Checks of a proxy client aready exists.
Definition: CAS.php:1824
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:638
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode.
Definition: CAS.php:591
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:543
$type
foreach($_POST as $key=> $value) $res

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

+ 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 891 of file CAS.php.

892 {
894
895 try {
896 self::$_PHPCAS_CLIENT->initializeProxiedService($proxiedService);
897 } catch (Exception $e) {
898 phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
899 }
900 }

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

Referenced by CAS_ProxiedService_Abstract\initializeProxyTicket().

+ 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 951 of file CAS.php.

952 {
955
956 try {
957 $res = self::$_PHPCAS_CLIENT->serviceMail($url, $service, $flags, $err_code, $err_msg, $pt);
958 } catch (Exception $e) {
959 phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
960 }
961
963 return $res;
964 }
$service
Definition: login.php:15
$url

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

+ 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 917 of file CAS.php.

918 {
921
922 try {
923 $res = self::$_PHPCAS_CLIENT->serviceWeb($url, $err_code, $output);
924 } catch (Exception $e) {
925 phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
926 }
927
929 return $res;
930 }
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output

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

+ 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().