Public Member Functions | Protected Member Functions | Private Attributes

CAS_ProxiedService_Imap Class Reference

Inheritance diagram for CAS_ProxiedService_Imap:
CAS_ProxiedService_Abstract CAS_ProxiedService CAS_ProxiedService_Testable

List of all members.

Public Member Functions

 __construct ($username)
 getServiceUrl ()
 setServiceUrl ($url)
 setMailbox ($mailbox)
 setOptions ($options)
 open ()
 getStream ()
 getImapProxyTicket ()

Protected Member Functions

 hasBeenOpened ()

Private Attributes

 $_username
 $_url
 $_mailbox
 $_options = NULL
 $_stream

Detailed Description

Provides access to a proxy-authenticated IMAP stream

Definition at line 39 of file Imap.php.


Constructor & Destructor Documentation

CAS_ProxiedService_Imap::__construct ( username  ) 

Constructor.

Parameters:
string $username
Returns:
void

Definition at line 56 of file Imap.php.


Member Function Documentation

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 228 of file Imap.php.

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 75 of file Imap.php.

CAS_ProxiedService_Imap::getStream (  ) 

Answer the IMAP stream

Returns:
resource

Definition at line 214 of file Imap.php.

CAS_ProxiedService_Imap::hasBeenOpened (  )  [protected]

Answer true if our request has been sent yet.

Returns:
boolean

Definition at line 195 of file Imap.php.

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

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 163 of file Imap.php.

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

CAS_ProxiedService_Imap::setMailbox ( mailbox  ) 

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

Parameters:
string $mailbox
Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the stream has been opened.

Definition at line 116 of file Imap.php.

References hasBeenOpened().

CAS_ProxiedService_Imap::setOptions ( options  ) 

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

Parameters:
int $options
Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the stream has been opened.

Definition at line 139 of file Imap.php.

References hasBeenOpened().

CAS_ProxiedService_Imap::setServiceUrl ( url  ) 

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

Parameters:
string $url
Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the stream has been opened.

Definition at line 93 of file Imap.php.

References hasBeenOpened().


Member Data Documentation

string CAS_ProxiedService_Imap::$_mailbox [private]

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

Definition at line 107 of file Imap.php.

int CAS_ProxiedService_Imap::$_options = NULL [private]

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

Definition at line 130 of file Imap.php.

resource CAS_ProxiedService_Imap::$_stream [private]

The IMAP stream

Definition at line 207 of file Imap.php.

string CAS_ProxiedService_Imap::$_url [private]

The target service url.

Definition at line 67 of file Imap.php.

string CAS_ProxiedService_Imap::$_username [private]

The username to send via imap_open.

Definition at line 48 of file Imap.php.