webtechnick / CakePHP-Facebook-Plugin

CakePHP Facebook Plugin
http://facebook.webtechnick.com
445 stars 138 forks source link

Facebook registration problum #143

Open srinathm opened 11 years ago

srinathm commented 11 years ago

Hello every one, i have registration problum please anyone help to me

in my appcontroller public $components = array( 'Session',
'Auth' => array( //'authenticate' => array( 'Form' => array( 'fields' => array('username' => 'email') ), 'loginRedirect' => array('controller' => 'users', 'action' => 'index'), 'logoutRedirect' => array('controller' => 'users', 'action' => 'login'), 'authorize' => array('Controller') //) ), 'Facebook.Connect' => array('model' => 'User') );

public function beforeFilter() {

    $this->Auth->allow('index', 'view');
}

public function isAuthorized($user) { // Admin can access every action if (isset($user['role']) && $user['role'] === 'admin') { return true; }

  // Default deny
  return false;

}

in my userscontroller

function beforeFilter() { Security::setHash('md5'); $this->Auth->allow('add','createimage','registration'); //$this->Auth->loginRedirect = array('action' => 'index'); //3 //$this->Auth->loginRedirect = array('action' => 'index'); $this->layout='facebook'; //4
}

function beforeFacebookSave(){
$this->Connect->authUser['User']['email'] = $this->Connect->user('email');
return true; //Must return true or will not save.

}

function logout() {                                 //7
    $this->Session->destroy();
    $this->redirect($this->Auth->logout());
}

public function registration(){

//echo "sdfsdf"; exit; //if($this->request->post){ //pr($this->request->data); exit;

  $this->layout='facebook';

//if($user = $this->Connect->registrationData()){ //We have a registered user, look at it and do something with it. //print_r($user); //} }

after clicking Register button it gives registering for app dialog and when clicks continue it redirecting to my redirect-uri but gives below error

Error: Database table app_models for model AppModel was not found.

give solution for this

thanks

aaganja commented 7 years ago

@srinathm did you find the solution for this?