OPERATION_REDIRECT
OPERATION_REDIRECT
captcha operation type
AuthorizationKey Component
キー認証画面へのリダイレクト、認証処理を行います。
利用方式、対象アクション、認証要素key名称を指定してください。
$operationType : string
利用方式
public $components = array(
'AuthorizationKeys.AuthorizationKey' => array(
'operationType' => AuthorizationKeyComponent::OPERATION_REDIRECT,
'targetAction' => 'answer'
)
)
public $components = array(
'AuthorizationKeys.AuthorizationKey' => array(
'operationType' => AuthorizationKeyComponent::OPERATION_EMBEDDING
)
)
<?php
echo $this->element('AuthorizationKeys.edit_form');
?>
public $components = array(
'AuthorizationKeys.AuthorizationKey' => array(
'operationType' => AuthorizationKeyComponent::OPERATION_POPUP,
'targetAction' => 'answer'
)
)
guard(string $operationType, string $modelName, array $data, null $additionalId = null) : void
guard リダイレクト型の場合にアクション内で実行をガードする。認証キー入力画面にリダイレクトし、認証が成功するとguard()以降のコードが実行されるようになる。
$this->AuthorizationKey->guard('redirect', 'BlogEntry', $blogEntry, 'pdf');
string | $operationType | 認証タイプ |
string | $modelName | モデル名 |
array | $data | モデルデータ |
null | $additionalId | 付加ID |
_popupStartup(\Controller $controller) : void
_popupStartup POPUP型の場合はGetアクセスをはじく POSTが来たときは、送信された認証キーとControllerが指定しているmodel, contentId, additionalIdでDBからデータを取り出し マッチするか確認する 一致しない場合は、前の画面を再度呼び出す
\Controller | $controller | Controller with components to startup |