나는 웹 사이트 사이트 계정과 페이스 북 사용자에 로그인 두 가지 유형의 .. 암호 필드가 비어있을 것 페이스 북의 사용자에 대해
을 허용하고 있습니다.
로그인 작업에서 이와 같은 질문을 통해 사용자가 페이스 북 사용자인지 확인합니다.
if(!empty($this->data)){
$this->User->recursive = -1;
$facebook_user = $this->User->find('count', array('conditions' => array('email' => $this->data['User']['email'], 'password' => null)));
if($facebook_user == 1){
$this->Auth->loginError = "Looks like you have used Facebook connect to Login to the website.";
}
}
$ facebook_user == 1이면 특정 LoginError를 표시하고 싶습니다. 내가 $의 facebook_user가 사용자의 컨트롤러에 1
으로, beforeFilter로 설정되어있는 경우에도 할당받을 나던
$this->Auth->loginError = "Please check the Username and Passwords";
그러나 페이스 북 LoginError에 필터 이전에 LoginError을 설정하고 기본으로
function beforeFilter() {
$this->Auth->fields = array('username' => 'email', 'password' => 'password');
$this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'harsha');
$this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'killer');
$this->Auth->loginError = "Please check the Username and Passwords";
$this->Auth->authError = "You are not authorized to be here Bitch.";
$this->Auth->allow('*');
}
전에 응용 프로그램 컨트롤러의 필터()
function beforeFilter() {
$this->Auth->allow('*');
//$this->Auth->userScope = array('User.status' => 'active');
// Setting Admin Template
if(isset($this->params['admin'])) {
$this->layout = 'admin';
}
}
리디렉션 이후 당신의 페이스 북의 메시지를 삭제하는 일이 때의 AppController가 호출되기 때문에이 될 수 있습니다. 세션으로 옮기고 거기에서 당길 수도 있습니다. – JohnP
로그인 액션의 시작 부분에있는 if 문에서 값을 할당하고 작동하는지 확인하십시오. – Headshota
@ 존이 컨트롤러의 메소드보다 먼저 BeforeFilter를 실행하지 않습니까? –