Skip to content

Instantly share code, notes, and snippets.

@co3k
Created April 16, 2010 10:50
Show Gist options
  • Save co3k/368279 to your computer and use it in GitHub Desktop.
Save co3k/368279 to your computer and use it in GitHub Desktop.
diff --git a/lib/user/opSecurityUser.class.php b/lib/user/opSecurityUser.class.php
index 60e6e45..679a889 100644
--- a/lib/user/opSecurityUser.class.php
+++ b/lib/user/opSecurityUser.class.php
@@ -18,6 +18,8 @@
*/
class opSecurityUser extends opAdaptableUser
{
+ protected $serializedMember = null;
+
/**
* Initializes the current user.
*
@@ -47,6 +49,17 @@ class opSecurityUser extends opAdaptableUser
return new opAnonymousMember();
}
+ if ($this->serializedMember)
+ {
+ return unserialize($this->serializedMember);
+ }
+
+ $result = Doctrine::getTable('Member')->find($this->getMemberId());
+
+ $this->serializedMember = serialize($result);
+
+ return $result;
+
if ($inactive)
{
return Doctrine::getTable('Member')->findInactive($this->getMemberId());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment