Created
January 7, 2011 19:52
-
-
Save gurkanoluc/769997 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Main extends MY_Controller { | |
function __construct() { | |
parent::__construct(); | |
} | |
function index() | |
{ | |
$session = $this->facebook_client->getSession(); | |
if(!$session) | |
{ | |
echo $this->facebook_client->redirect(); | |
return; | |
} | |
$user = $this->User_model->findUserByFbUid($session['uid']); | |
if(!$user) | |
{ | |
redirect('/user/callback'); | |
} | |
else | |
{ | |
$this->beLoggedIn($user->id); | |
redirect('main/dashboard'); | |
} | |
} | |
public function dashboard() | |
{ | |
$this->render('main/dashboard'); | |
} | |
} | |
/* End of file welcome.php */ | |
/* Location: ./system/application/controllers/welcome.php */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment