.

ConfirmationHandlerBase Class Reference
[Confirmations]

Base class for handling confirmation requests. More...

Inheritance diagram for ConfirmationHandlerBase:
IConfirmationHandler ChangeemailConfirmationHandler ChangepasswordConfirmationHandler CreateaccountConfirmationHandler OnetimeloginConfirmationHandler ValidateemailConfirmationHandler

List of all members.

Public Member Functions

  __construct ($confirmation)
  Constructor.
  confirm ()
  Confirm a Confirmation.
  created ()
  Invoked when this confirmation is created.

Public Attributes

const  EXPIRED = 'EXPIRED'
const  NOTFOUND = 'NOTFOUND'
const  SUCCESS = 'SUCCESS'

Protected Member Functions

  do_confirm ($confirmation, $success)
  Template method to be overloaded by subclasses to do what should be done on successfull confirmation.
  do_created ($confirmation)
  Template method to be overloaded by subclasses to do what should be done on creation.

Protected Attributes

  $confirmation = null

Detailed Description

Base class for handling confirmation requests.

Author:
Gerd Riesselmann

Definition at line 8 of file confirmationhandler.base.php.


Constructor & Destructor Documentation

ConfirmationHandlerBase::__construct ( confirmation  ) 

Constructor.

Parameters:
DAOConfirmations 

Definition at line 25 of file confirmationhandler.base.php.

00025                                                    {
00026                 $this->confirmation = $confirmation;
00027         }

Member Function Documentation

ConfirmationHandlerBase::confirm (  ) 

Confirm a Confirmation.

Invokes do_confirm(), which should be overloaded by subclasses

Returns:
Status

Implements IConfirmationHandler.

Definition at line 36 of file confirmationhandler.base.php.

00036                                   {
00037                 $confirmation = $this->confirmation;
00038                 $success = self::NOTFOUND;
00039                 if ($confirmation) {
00040                         $success = $confirmation->expirationdate > time() ? self::SUCCESS : self::EXPIRED; 
00041                         $temp = clone($confirmation);
00042                         $temp->delete();
00043                 }
00044                 return $this->do_confirm($confirmation, $success);
00045         }
ConfirmationHandlerBase::created (  ) 

Invoked when this confirmation is created.

INvokes do_created(), which should be overloaded by subclasses

Returns:
Status

Implements IConfirmationHandler.

Definition at line 73 of file confirmationhandler.base.php.

00073                                   {
00074                 $confirmation = $this->confirmation;
00075                 if ($confirmation) {
00076                         return $this->do_created($confirmation);
00077                 }
00078                 return new Status('Confirmation missing in creation. Wrong Confirmation Handler name?');        
00079         }
ConfirmationHandlerBase::do_confirm ( confirmation,
success  
) [protected]

Template method to be overloaded by subclasses to do what should be done on successfull confirmation.

Parameters:
DAOConfirmations  Data of confirmation, not necessarily up to date, depending on status
enum  Indicates success or failure
Returns:
Status

Reimplemented in ChangeemailConfirmationHandler, ChangepasswordConfirmationHandler, CreateaccountConfirmationHandler, OnetimeloginConfirmationHandler, and ValidateemailConfirmationHandler.

Definition at line 55 of file confirmationhandler.base.php.

00055                                                                {
00056                 switch ($success) {
00057                         case self::SUCCESS:
00058                                 return new Message(tr('Your request was confirmed', 'confirmations'));
00059                         case self::EXPIRED:
00060                                 return new Status(tr('Your request has already expired and could not be confirmed', 'confirmations'));
00061                         default:
00062                                 return new Status(tr('No confirmations found for your request', 'confirmations'));
00063                 }
00064         }
ConfirmationHandlerBase::do_created ( confirmation  )  [protected]

Template method to be overloaded by subclasses to do what should be done on creation.

Parameters:
DAOConfirmations  Data of confirmation
Returns:
Status

Reimplemented in ChangeemailConfirmationHandler, ChangepasswordConfirmationHandler, CreateaccountConfirmationHandler, OnetimeloginConfirmationHandler, and ValidateemailConfirmationHandler.

Definition at line 89 of file confirmationhandler.base.php.

00089                                                      {
00090                 return new Status();
00091         }       

Member Data Documentation

ConfirmationHandlerBase::$confirmation = null [protected]

Definition at line 18 of file confirmationhandler.base.php.


The documentation for this class was generated from the following file: