after I tried finding a solution using Google's search, I still haven't found anything which helped me. The problem is simple, I want to use another Model for the user authentication. The way the manual shows us does, somehow, not work.
My AppController looks like the follow:
public $components = array(
'Auth',
'DebugKit.Toolbar'
);
public function beforeFilter()
{
parent::beforeFilter();
if (isset($this->request->params["intranet"]) && $this->request->params["intranet"] == 1) {
$this->Auth = array(
"loginAction" => array(
"intranet" => true,
"controller" => "employees",
"action" => "login"
),
"authenticate" => array(AuthComponent::ALL => array("userModel" => "Employee"))
);
$this->layout = "intranet";
}
}
It does not matter what url I open, CakePHP always redirects me to /users/login. Of course I run parent::beforeFilter() in the Controllers.
Edit: Okay seems like I missunderstand userModel, loginAction seem to be the right keyword here, but after I changed it to array("controller" => "employees", "action" => "login") it still redirects me to /users/login...
parent::beforeFilter()
at the end of your method? – thaJeztah