application/controllers/Oauth_login.php
// Store user information and send to profile page
Store user information and send to profile page
Store user information and send to profile page
public function index() {
if ($this->user) {
$data['user_profile'] = $this->facebook->api('/me/');
$data['logout_url'] = $this->facebook->getLogoutUrl(array('next' => base_url() . 'index.php/oauth_login/logout'));
$this->load->view('profile', $data);
} else {
$data['login_url'] = $this->facebook->getLoginUrl();
$this->load->view('loginfb_view', $data);
}
}
public function index ( ) { if ( $ this -> user ) { $ data [ 'user_profile' ] = $ this -> facebook -> api ( '/me/' ) ; $ data [ 'logout_url' ] = $ this -> facebook -> getLogoutUrl ( array ( 'next' => base_url ( ) . 'index.php/oauth_login/logout' ) ) ; $ this -> load -> view ( 'profile' , $ data ) ; } else { $ data [ 'login_url' ] = $ this -> facebook -> getLoginUrl ( ) ; $ this -> load -> view ( 'loginfb_view' , $ data ) ; } }
Store user information and send to profile page
Store user information and send to profile page
// Get logout url of facebook // Send data to profile page // Store users facebook login url