0
我使用BotDetect驗證碼在CakePHP的2.6應用程序,並已實施按照這個網頁的指示於:CakePHP的V2.6和BotDetect驗證碼
How To Add BotDetect Protection To CakePHP 2.6 Applications
的驗證碼是在工作的偉大控制器/視圖,我需要它。
但是,它似乎與某個控制器所使用的標準登錄過程有些干擾。
這是我爲它裝載BotDetect組件控制器標題:
public $components = array('RequestHandler','Epd','BotDetect.Captcha' => array(
'CaptchaId' => 'EpdCaptcha',
'UserInputId' => 'CaptchaCode'));
這是我的登錄功能:
public function login() {
$this->layout='login';
if ($this->request->is('post')) {
if ($this->Auth->login()) {
$this->redirect($this->Auth->redirectUrl());
}
else
{
$this->Session->setFlash(__('Invalid username or password, try again'));
}
}
這是我的AppController.php:
class AppController extends Controller {
public $components = array(
'Auth' => array(
'loginRedirect' => array(
'controller' => 'users',
'action' => 'selectorg'
),
'logoutRedirect' => array(
'controller' => 'users',
'action' => 'login'
),
'authenticate' => array(
'Form' => array(
)
)
),
'Session'
);}
現在當我登錄到應用程序時,auth組件不授權登錄,它只是bo退回到登錄屏幕。但是當我刪除BotDetect組件時,登錄工作完美。我試着改變加載組件的順序,看看是否有什麼區別...但無濟於事。
有什麼建議嗎?