<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

class auth_facebook_site extends MX_Controller
{

    public function __construct()
    {
        parent::__construct();
        $this->load->model('auth_facebook/auth_facebook_model');
    }

    public function get_auth_link()
    {
        return $this->auth_facebook_model->get_auth_link();
    }

    public function auth()
    {
        if (!empty($this->input->get('code'))) {
            $this->auth_facebook_model->auth();
            redirect($this->auth_facebook_model->get_config_data('redirect_link'), 'refresh');
        }

        return '';
    }

}
