ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
Access to external services
+ Collaboration diagram for Access to external services:

Functions

 phpCAS::serviceWeb ($url, & $err_code, & $output)
 This method is used to access an HTTP[S] service. More...
 
 phpCAS::serviceMail ($url, $service, $flags, & $err_code, & $err_msg, & $pt)
 This method is used to access an IMAP/POP3/NNTP service. More...
 
 phpCAS::serviceMail ($url, $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 AVAILABLE 4
 phpCAS::service() error code when the service was not available. More...
 
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 AVAILABLE 4
 phpCAS::service() error code when the service was not available. More...
 

Detailed Description

Function Documentation

◆ serviceMail() [1/2]

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

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

Parameters
$urla string giving the URL of the service, including the mailing box for IMAP URLs, as accepted by imap_open().
$flagsoptions given to imap_open().
$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.
$err_msgan error message on failure
$ptthe Proxy Ticket (PT) retrieved from the CAS server to access the URL on success, FALSE on error).
Returns
an 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 799 of file CAS.php.

References $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, $res, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

800  {
802 
804  if ( !is_object($PHPCAS_CLIENT) ) {
805  phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
806  }
807  if ( !$PHPCAS_CLIENT->isProxy() ) {
808  phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
809  }
810  if ( !$PHPCAS_AUTH_CHECK_CALL['done'] ) {
811  phpCAS::error('this method should only be called after the programmer is sure the user has been authenticated (by calling '.__CLASS__.'::checkAuthentication() or '.__CLASS__.'::forceAuthentication()');
812  }
813  if ( !$PHPCAS_AUTH_CHECK_CALL['result'] ) {
814  phpCAS::error('authentication was checked (by '.$PHPCAS_AUTH_CHECK_CALL['method'].'() at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].') but the method returned FALSE');
815  }
816  if ( gettype($url) != 'string' ) {
817  phpCAS::error('type mismatched for parameter $url (should be `string\')');
818  }
819 
820  if ( gettype($flags) != 'integer' ) {
821  phpCAS::error('type mismatched for parameter $flags (should be `integer\')');
822  }
823 
824  $res = $PHPCAS_CLIENT->serviceMail($url,$flags,$err_code,$err_msg,$pt);
825 
827  return $res;
828  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
$PHPCAS_AUTH_CHECK_CALL
This global variable is used to store where the method checking the authentication is called from (to...
Definition: CAS.php:195
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ serviceMail() [2/2]

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

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

Parameters
$urla string giving the URL of the service, including the mailing box for IMAP URLs, as accepted by imap_open().
$servicea string giving for CAS retrieve Proxy ticket
$flagsoptions given to imap_open().
$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.
$err_msgan error message on failure
$ptthe Proxy Ticket (PT) retrieved from the CAS server to access the URL on success, FALSE on error).
Returns
an 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 871 of file CAS.php.

References $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, $res, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

871  {
873 
875  if (!is_object($PHPCAS_CLIENT)) {
876  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
877  }
878  if (!$PHPCAS_CLIENT->isProxy()) {
879  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
880  }
881  if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
882  phpCAS :: error('this method should only be called after the programmer is sure the user has been authenticated (by calling ' . __CLASS__ . '::checkAuthentication() or ' . __CLASS__ . '::forceAuthentication()');
883  }
884  if (!$PHPCAS_AUTH_CHECK_CALL['result']) {
885  phpCAS :: error('authentication was checked (by ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ') but the method returned FALSE');
886  }
887  if (gettype($url) != 'string') {
888  phpCAS :: error('type mismatched for parameter $url (should be `string\')');
889  }
890 
891  if (gettype($flags) != 'integer') {
892  phpCAS :: error('type mismatched for parameter $flags (should be `integer\')');
893  }
894 
895  $res = $PHPCAS_CLIENT->serviceMail($url, $service, $flags, $err_code, $err_msg, $pt);
896 
898  return $res;
899  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
$PHPCAS_AUTH_CHECK_CALL
This global variable is used to store where the method checking the authentication is called from (to...
Definition: CAS.php:195
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ serviceWeb()

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

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

Parameters
$urlthe service to access.
$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.
$outputthe output of the service (also used to give an error message on failure).
Returns
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 828 of file CAS.php.

References $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, $res, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

828  {
830 
832  if (!is_object($PHPCAS_CLIENT)) {
833  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
834  }
835  if (!$PHPCAS_CLIENT->isProxy()) {
836  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
837  }
838  if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
839  phpCAS :: error('this method should only be called after the programmer is sure the user has been authenticated (by calling ' . __CLASS__ . '::checkAuthentication() or ' . __CLASS__ . '::forceAuthentication()');
840  }
841  if (!$PHPCAS_AUTH_CHECK_CALL['result']) {
842  phpCAS :: error('authentication was checked (by ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ') but the method returned FALSE');
843  }
844  if (gettype($url) != 'string') {
845  phpCAS :: error('type mismatched for parameter $url (should be `string\')');
846  }
847 
848  $res = $PHPCAS_CLIENT->serviceWeb($url, $err_code, $output);
849 
851  return $res;
852  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
$PHPCAS_AUTH_CHECK_CALL
This global variable is used to store where the method checking the authentication is called from (to...
Definition: CAS.php:195
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

Variable Documentation

◆ AVAILABLE [1/2]

const AVAILABLE 4

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

Definition at line 135 of file CAS.php.

◆ AVAILABLE [2/2]

const AVAILABLE 4

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

Definition at line 217 of file CAS.php.

◆ PHPCAS_SERVICE_OK [1/2]

const PHPCAS_SERVICE_OK 0

phpCAS::service() error code on success

Definition at line 116 of file CAS.php.

◆ PHPCAS_SERVICE_OK [2/2]

const PHPCAS_SERVICE_OK 0

phpCAS::service() error code on success

Definition at line 198 of file CAS.php.

◆ PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE [1/2]

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

◆ PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE [2/2]

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

◆ PHPCAS_SERVICE_PT_FAILURE [1/2]

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

◆ PHPCAS_SERVICE_PT_FAILURE [2/2]

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

◆ PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE [1/2]

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

◆ PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE [2/2]

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