Enabled Fastbook/OAuth login
This commit is contained in:
32
modules/oauth/classes/Model/Oauth.php
Normal file
32
modules/oauth/classes/Model/Oauth.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* OSB OAuth Model
|
||||
*
|
||||
* @package OAuth
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Oauth extends ORM_OSB {
|
||||
// Relationships
|
||||
protected $_has_many = array(
|
||||
'account_oauth' => array('far_key'=>'id'),
|
||||
);
|
||||
|
||||
/**
|
||||
* Return the object of the OAuth plugin
|
||||
*/
|
||||
public function plugin($type='') {
|
||||
$c = Kohana::classname('Oauth_Plugin_'.$this->name);
|
||||
|
||||
if (! $this->name OR ! class_exists($c))
|
||||
return NULL;
|
||||
|
||||
$o = new $c($this);
|
||||
|
||||
return $type ? $o->$type : $o;
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user