See also: Writing Registry Plugins
FooConfirmer
.FooConfirmer
model and a corresponding controller (FooConfirmerController
).reply
action without authentication. This is typically done by adding $this->Auth→allow('reply');
to beforeFilter.willHandle
function to determine whether or not it will handle a given request.reply
action to handle (and typically an associated view).A sample Confirmer plugin is available in AvailablePlugin/TestConfirmer
.
Confirmer Plugins operate at the platform, not CO level. When installed, they will be available to all COs. Although more than one Confirmer Plugin can be installed, only one Plugin can handle any given confirmation request. Plugins will be queried in alphabetical order until one indicates that it wants to handle the request. At that point, control is handed over to that Plugin and only that Plugin.
The Plugin must implement a decision function in the FooConfirmer
model, with the following signature:
public function willHandle($coId, $coInvite, $coPetition) |
where
The CO Person ID will generally be available in $coInvite['co_person_id']
, and the Enrollment Flow ID (if applicable) will generally be available in $coPetition['co_enrollment_flow_id']
.
If the Plugin decides it wants to handle the request based on the information provided, it must return true
, otherwise it must return false
.
If the Plugin indicated it wanted to handle the request, control is handed to the Plugin to perform whatever action it wants to, via the reply
action. It is expected that the Plugin will provide links to the Enrollee to accept or decline the invitation, or automatically redirect to the accept or decline URLs as appropriate.
The entry point to the Confirmer Plugin will be /foo_confirmer/foo_confirmers/reply/inviteid
.
To automatically generate confirmation buttons, add the following to the view file (reply.ctp
):
include APP . DS . "View" . DS . "CoInvites" . DS . "buttons.inc"; |
The PHP variable $invite
must be set, holding the same information as was passed to willHandle()
in $coInvite
.