This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/oauth/classes/OAuth/Plugin/Facebook.php

52 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2013-05-23 07:00:14 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides Facebook Authentication
*
* @package OAuth
* @category Plugins
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
2013-05-27 12:10:41 +00:00
class OAuth_Plugin_Facebook extends OAuth_Plugin {
2013-05-23 07:00:14 +00:00
public function html() {
// @todo Needs to work with https
Script::factory()
->type('src')
->data('http://connect.facebook.net/en_US/all.js');
Script::factory()
->type('stdin')
->data('
$(document).ready(function(){
window.fbAsyncInit = function() {
// Initialize the Facebook JavaScript SDK
FB.init({
appId: '.$this->oo->app_id.',
xfbml: false,
status: true,
cookie: true,
});
// Check if the current user is logged in and has authorized the app
//FB.getLoginStatus(checkLoginStatus);
}
2013-05-27 12:10:41 +00:00
$(".btn-facebook").click(function() {
2013-05-23 07:00:14 +00:00
FB.login(checkLoginStatus, {scope:"email"});
// We stop the click, but pick up the href in the javascript
return false;
});
});
');
Script::factory()
->type('file')
->data('media/js/facebook.js');
}
}
?>