Enabled OAuth/OAuth2 logins

This commit is contained in:
Deon George
2013-05-27 22:10:41 +10:00
parent 8edac5ad4a
commit ab895eab93
82 changed files with 3052 additions and 154 deletions

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
abstract class OAuth_API extends Kohana_OAuth_API {}

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_API_Profile_Linkedin extends Kohana_OAuth_API_Profile_Linkedin {}

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Consumer extends Kohana_OAuth_Consumer { }

View File

@@ -0,0 +1,19 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides 3rd party plugin authentication
*
* @package OAuth
* @category Plugins
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
abstract class OAuth_Plugin {
protected $oo; // Our OAuth Object
public function __construct(Model_Oauth $oo) {
$this->oo = $oo;
}
}
?>

View File

@@ -0,0 +1,51 @@
<?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
*/
class OAuth_Plugin_Facebook extends OAuth_Plugin {
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);
}
$(".btn-facebook").click(function() {
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');
}
}
?>

View File

@@ -0,0 +1,17 @@
<?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
*/
class OAuth_Plugin_Google extends OAuth_Plugin {
public function html() {
}
}
?>

View File

@@ -0,0 +1,17 @@
<?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
*/
class OAuth_Plugin_Linkedin extends OAuth_Plugin {
public function html() {
}
}
?>

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
abstract class OAuth_Provider extends Kohana_OAuth_Provider { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Provider_Linkedin extends Kohana_OAuth_Provider_Linkedin { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
abstract class OAuth_Request extends Kohana_OAuth_Request { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Request_Access extends Kohana_OAuth_Request_Access { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Request_Authorize extends Kohana_OAuth_Request_Authorize { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Request_Resource extends Kohana_OAuth_Request_Resource { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Request_Token extends Kohana_OAuth_Request_Token { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Response extends Kohana_OAuth_Response { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
abstract class OAuth_Signature extends Kohana_OAuth_Signature { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Signature_HMAC_SHA1 extends Kohana_OAuth_Signature_HMAC_SHA1 { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Signature_PLAINTEXT extends Kohana_OAuth_Signature_PLAINTEXT { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
abstract class OAuth_Token extends Kohana_OAuth_Token { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Token_Access extends Kohana_OAuth_Token_Access { }

View File

@@ -0,0 +1,3 @@
<?php defined('SYSPATH') or die('No direct script access.');
class OAuth_Token_Request extends Kohana_OAuth_Token_Request { }