diff options
Diffstat (limited to 'modules/gallery/libraries/IdentityProvider.php')
-rw-r--r-- | modules/gallery/libraries/IdentityProvider.php | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/modules/gallery/libraries/IdentityProvider.php b/modules/gallery/libraries/IdentityProvider.php index 512f28eb..38718d4b 100644 --- a/modules/gallery/libraries/IdentityProvider.php +++ b/modules/gallery/libraries/IdentityProvider.php @@ -38,7 +38,7 @@ class IdentityProvider_Core { * @return Identity_Core */ static function & instance() { - if (!isset(self::$instance)) { + if (empty(self::$instance)) { // Create a new instance self::$instance = new IdentityProvider(); } @@ -47,14 +47,14 @@ class IdentityProvider_Core { } /** - * Returns a singleton instance of Identity. - * There can only be one Identity driver configured at a given point + * Frees the current instance of the identity provider so the next call to instance will reload * * @param string configuration * @return Identity_Core */ static function reset() { - self::$instance = new IdentityProvider(); + self::$instance = null; + Kohana::config_clear("identity"); } /** @@ -66,12 +66,12 @@ class IdentityProvider_Core { $config = module::get_var("gallery", "identity_provider", "user"); // Test the config group name - if (($this->config = Kohana::config("identity.".$config)) === NULL) { + if (($this->config = Kohana::config("identity." . $config)) === NULL) { throw new Exception("@todo NO USER LIBRARY CONFIGURATION FOR: $config"); } // Set driver name - $driver = "IdentityProvider_".ucfirst($this->config["driver"])."_Driver"; + $driver = "IdentityProvider_" . ucfirst($this->config["driver"]) ."_Driver"; // Load the driver if ( ! Kohana::auto_load($driver)) { @@ -101,20 +101,6 @@ class IdentityProvider_Core { } /** - * @see IdentityProvider_Driver::activate. - */ - public function activate() { - $this->driver->activate(); - } - - /** - * @see IdentityProvider_Driver::deactivate. - */ - public function deactivate() { - $this->driver->deactivate(); - } - - /** * @see IdentityProvider_Driver::guest. */ public function guest() { |