問題の解決策が見つかりません。AuthコンポーネントとACLコンポーネントを使用するCakePHPWebサイトがあります。アクティブでないユーザーがログインできないようにしたい。
AuthコンポーネントのuserScopeがそれを実行できることがわかりました。したがって、beforeFilter内のAppControllerで、これを追加しました:
$this->Auth->userScope = array('User.active' => 1);
もちろん、私のUserController beforeFilterでは、親メソッドが呼び出されます。
ただし、これは問題ありません。アクティブを0に設定しているユーザーでログインできます。ACLコンポーネントが原因である可能性がありますか?
これがAppControllerのbeforFilterです
public function beforeFilter()
{
if (!$this->Session->check('Auth.User'))
$this->layout = 'identification';
$this->Auth->allow('display');
//Configure AuthComponent
$this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
$this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'welcome');
$this->Auth->userScope = array('User.active' => 1);
}
私は何が欠けていますか?