diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-24 08:40:16 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-24 08:40:16 -0700 |
commit | 7afb4c5c30faeb700c6d17b1746b051382e0d418 (patch) | |
tree | 55a6a99494c978df555940218136c4fb6ce1bce7 | |
parent | f0610ccaa0329866113120dbf3b2e3bd4047f3a1 (diff) |
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.
-rw-r--r-- | modules/gallery/helpers/identity.php | 18 |
1 files changed, 10 insertions, 8 deletions
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()); + } } /** |