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

<?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;
}
}
?>