Enabled Fastbook/OAuth login
This commit is contained in:
27
modules/oauth/classes/Auth.php
Normal file
27
modules/oauth/classes/Auth.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class overrides Kohana's Auth so that we can call a specific
|
||||
* Authentication driver.
|
||||
*
|
||||
* @package OAuth
|
||||
* @category Modifications
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
abstract class Auth extends Kohana_Auth {
|
||||
public static function instance($type=NULL) {
|
||||
if (is_null($type) OR (! $type instanceof Model_Oauth))
|
||||
return parent::instance();
|
||||
|
||||
// Set the session class name
|
||||
$class = 'Auth_'.ucfirst($type->name);
|
||||
|
||||
// Create a new session instance
|
||||
Auth::$_instance = new $class($type);
|
||||
|
||||
return Auth::$_instance;
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user