From 7afb4c5c30faeb700c6d17b1746b051382e0d418 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 24 Oct 2009 08:40:16 -0700 Subject: Re-enable the redirect to the root album if we can't load the active user from the session. This will most likely occur if the administrator has switch identity providers while a user was logged in. --- modules/gallery/helpers/identity.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/identity.php b/modules/gallery/helpers/identity.php index d0cba8e7..4ebc6de8 100644 --- a/modules/gallery/helpers/identity.php +++ b/modules/gallery/helpers/identity.php @@ -53,7 +53,7 @@ class identity_Core { * Make sure that we have a session and group_ids cached in the session. */ static function load_user() { - //try { + try { // Call IdentityProvider::instance() now to force the load of the user interface classes. // We are about to load the active user from the session and which needs the user definition // class, which can't be reached by Kohana's heiracrchical lookup. @@ -80,14 +80,16 @@ class identity_Core { } $session->set("group_ids", $ids); } - //} catch (Exception $e) { - // try { - // Session::instance()->destroy(); - // } catch (Exception $e) { + } catch (Exception $e) { + // Log it, so we at least have so notification that we swallowed the exception. + Kohana::log("error", "Load_user Exception: " . $e->__toString()); + try { + Session::instance()->destroy(); + } catch (Exception $e) { // We don't care if there was a problem destroying the session. - // } - // url::redirect(item::root()->abs_url()); - //} + } + url::redirect(item::root()->abs_url()); + } } /** -- cgit v1.2.3