CakePHP で BaseAuthorise を拡張し、LdapAuthenticate という名前の新しいクラスを作成しました。これは /app/Controller/Component/Auth/LdapAuthenticate 内にあり、現在は次のようになっています。
<?php
App::uses('BaseAuthorize', 'Controller/Component/Auth');
class LdapAuthenticate extends BaseAuthorize {
public function authenticate(CakeRequest $request, CakeResponse $response) {
// Do things for ldap here.
echo "Running...";
}
}
私のAppControl内に私は持っています
public $components = array(
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'posts', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'pages', 'action' => 'display', 'home'),
'authenticate' => array('Ldap')
)
);
そして、ログイン方法の中で私は持っています
public function login() {
if ($this->request->is('post')) {
$this->Auth->authorize();
}
}
しかし、私はエラーが発生しています
Error: Class LdapAuthenticate contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (BaseAuthorize::authorize)
ただし、CakePHP のドキュメントとクックブックでは、ユーザーがログインしているかどうかに応じて false のオブジェクトを返すことができる認証用の関数を使用して LdapAuthetnticate を拡張するように設定するように指示されています。
このエラーが発生する理由を誰かが提案できますか?