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/Auth.php

28 lines
709 B
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 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 {
2013-11-28 06:41:34 +00:00
public static function instance($type=NULL) {
2013-05-23 07:00:14 +00:00
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;
}
}
?>