phpCAS version 1.3.6

Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CAS_ProxiedService_Imap Class Reference
Inheritance diagram for CAS_ProxiedService_Imap:

## Public Member Functions
| __construct ($username)
| getServiceUrl ()
| setServiceUrl ($url)
| setMailbox ($mailbox)
| setOptions ($options)
| open ()
| getStream ()
| getImapProxyTicket ()
Public Member Functions inherited from CAS_ProxiedService_Abstract
| setProxyTicket ($proxyTicket)
| setCasClient (CAS_Client $casClient)
Public Member Functions inherited from CAS_ProxiedService
| getServiceUrl ()
| setProxyTicket ($proxyTicket)

## Protected Member Functions
| hasBeenOpened ()
Protected Member Functions inherited from CAS_ProxiedService_Abstract
| getProxyTicket ()
| initializeProxyTicket ()

## Private Attributes
| $_username
| $_url
| $_mailbox
| $_options = null
| $_stream

## Detailed Description

Provides access to a proxy-authenticated IMAP stream

Definition at line 40 of file Imap.php.

## Constructor & Destructor Documentation

## ◆ __construct()

CAS_ProxiedService_Imap::__construct | ( |  | $username | ) |

Constructor.

Parameters

  string | $username | Username

Returns
  void

Definition at line 58 of file Imap.php.

## Member Function Documentation

## ◆ getImapProxyTicket()

CAS_ProxiedService_Imap::getImapProxyTicket | ( |  | ) |

CAS_Client::serviceMail() needs to return the proxy ticket for some reason, so this method provides access to it.

Returns
  string

Exceptions

  CAS_OutOfSequenceException | If called before the stream has been opened.

Definition at line 270 of file Imap.php.

## ◆ getServiceUrl()

CAS_ProxiedService_Imap::getServiceUrl | ( |  | ) |

Answer a service identifier (URL) for whom we should fetch a proxy ticket.

Returns
  string

Exceptions

  Exception | If no service url is available.

Definition at line 79 of file Imap.php.

References $_url.

## ◆ getStream()

CAS_ProxiedService_Imap::getStream | ( |  | ) |

Answer the IMAP stream

Returns
  resource

Definition at line 252 of file Imap.php.

## ◆ hasBeenOpened()

CAS_ProxiedService_Imap::hasBeenOpened | ( |  | ) |
| protected

Answer true if our request has been sent yet.

Returns
  bool

Definition at line 232 of file Imap.php.

Referenced by open(), setMailbox(), setOptions(), and setServiceUrl().

## ◆ open()

CAS_ProxiedService_Imap::open | ( |  | ) |

Open the IMAP stream (similar to imap_open()).

Returns
  resource Returns an IMAP stream on success

Exceptions

  CAS_OutOfSequenceException | If called multiple times.
  CAS_ProxyTicketException | If 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
  CAS_ProxiedService_Exception | If there is a failure sending the request to the target service.

Definition at line 192 of file Imap.php.

References hasBeenOpened(), CAS_ProxiedService_Abstract\initializeProxyTicket(), phpCAS\trace(), and phpCAS\traceBegin().

## ◆ setMailbox()

CAS_ProxiedService_Imap::setMailbox | ( |  | $mailbox | ) |

Set the mailbox to open. See the $mailbox parameter of imap_open().

Parameters

  string | $mailbox | Mailbox to set

Returns
  void

Exceptions

  CAS_OutOfSequenceException | If called after the stream has been opened.

Definition at line 131 of file Imap.php.

References hasBeenOpened().

## ◆ setOptions()

CAS_ProxiedService_Imap::setOptions | ( |  | $options | ) |

Set the options for opening the stream. See the $options parameter of imap_open().

Parameters

  int | $options | Options for the stream

Returns
  void

Exceptions

  CAS_OutOfSequenceException | If called after the stream has been opened.

Definition at line 161 of file Imap.php.

References hasBeenOpened().

## ◆ setServiceUrl()

CAS_ProxiedService_Imap::setServiceUrl | ( |  | $url | ) |

Set the URL of the service to pass to CAS for proxy-ticket retrieval.

Parameters

  string | $url | Url to set

Returns
  void

Exceptions

  CAS_OutOfSequenceException | If called after the stream has been opened.

Definition at line 102 of file Imap.php.

References hasBeenOpened().

## Member Data Documentation

## ◆ $_mailbox

string CAS_ProxiedService_Imap::$_mailbox
| private

The mailbox to open. See the $mailbox parameter of imap_open().

Definition at line 121 of file Imap.php.

## ◆ $_options

int CAS_ProxiedService_Imap::$_options = null
| private

A bit mask of options to pass to imap_open() as the $options parameter.

Definition at line 150 of file Imap.php.

## ◆ $_stream

resource CAS_ProxiedService_Imap::$_stream
| private

The IMAP stream

Definition at line 245 of file Imap.php.

## ◆ $_url

string CAS_ProxiedService_Imap::$_url
| private

The target service url.

Definition at line 71 of file Imap.php.

Referenced by getServiceUrl().

## ◆ $_username

string CAS_ProxiedService_Imap::$_username
| private

The username to send via imap_open.

Definition at line 49 of file Imap.php.