當我提交登錄 我得到
錯誤:無法找到LoginsController。當我提交登錄時cakephp auth組件
這AppController的
class AppController extends Controller {
var $helpers = array('Html','Form','Ajax','Javascript','Session');
var $components = array('Auth','Session');
function beforeFilter() {
//parent::beforeFilter();
$this->Auth->userModel = 'Member';
$this->Auth->allow('*');
$this->Auth->authError='Please Login for view this page';
$this->Auth->loginError = 'Username or Password does not match';
$this->Auth->loginRedirect = array('Controller'=>'Members','action'=>'dashboard');
$this->Auth->logoutRedirect = array('Controller'=>'Members','action'=>'index');
($this->set('admin',$this->isadmin()));
($this->set('logged_in',$this->logged_in()));
($this->set('userUsername',$this->userUsername()));
}
function isadmin(){
$admin = FALSE;
if($this->Auth->user('priority') == 'admin')
{
$admin = TRUE;
}
return $admin;
}
function logged_in(){
$logged_in = FALSE;
if ($this->Auth->user())
{
$logged_in = TRUE;
}
return $logged_in;
}
function userUsername(){
$userUsername = NULL;
if($this->Auth->user())
{
$userUsername = $this->Auth->Member('username');
}
return $userUsername;
}
}
我嘗試在計算器進行搜索,但我無法找到答案謝謝
我應該切換到authsome還是不行,因爲我開始討厭auth組件,但是使用ACL時沒有問題或難度增加。 – krissanawat 2011-05-10 18:22:29
顯示您的用戶控制器。不需要你的'LoginsController'。另外,控制器名稱應該始終是單數! – Tim 2011-05-11 09:38:00