Re: fw-auth Digest 26 Sep 2012 21:13:34 -0000 Issue 369

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: fw-auth Digest 26 Sep 2012 21:13:34 -0000 Issue 369

Matt Bingham
On Wed, Sep 26, 2012 at 10:13 PM,  <[hidden email]> wrote:

>
> fw-auth Digest 26 Sep 2012 21:13:34 -0000 Issue 369
>
> Topics (messages 1172 through 1172):
>
> Storing a Model with an Input Filter in the AuthorizationService default Storage
>         1172 by: Mat Howard
>
> Administrivia:
>
> To subscribe to the digest, e-mail:
>         <[hidden email]>
>
> To unsubscribe from the digest, e-mail:
>         <[hidden email]>
>
> To post to the list, e-mail:
>         <[hidden email]>
>
>
> ----------------------------------------------------------------------
>
>
>
> ---------- Forwarded message ----------
> From: Mat Howard <[hidden email]>
> To: [hidden email]
> Cc:
> Date: Wed, 26 Sep 2012 17:13:31 -0400
> Subject: Storing a Model with an Input Filter in the AuthorizationService default Storage
> Hi All,
>
> I'm experiencing an odd issue. I've gone through the Getting Started Guide
> for ZF2 (http://framework.zend.com/manual/2.0/en/user-guide/overview.html)
> so my code is based on this example. I also went through the Authentication
> guide (
> http://framework.zend.com/manual/2.0/en/modules/zend.authentication.intro.html
> ).
>
> In the Authentication example, for DB Authentication, it demonstrates using
> $auth->getStorage()->write() to save mixed data with the authorization
> session. We can then later use $auth->getStorage()->read() to get that
> mixed data.
>
> I'm trying to use this method so I can save my User model with the Auth
> session. I've setup my User model similar to the getting starting guide, so
> I have an input filter which is not created until I call the getInputFilter
> method of my model.
>
> I'm calling getInputFilter from my model so I can assign it to the form
> before validation. After validation and authentication, I call
> $auth->getStorage()->write($user) to save the user object with the session.
> As soon as I call $auth->getStorage()->read(), I get a PHP Fatal Error "PHP
> Fatal error:  Exception thrown without a stack frame in Unknown on line 0,
> referer: http://zf2-test.localcent.com/user".
>
> If I comment the line that calls getInputFilter, everything works fine. Is
> there a reason why I can't retrieve a model with an input filter from the
> AuthenticationService's default Storage?
>
> An easy way to solve it is to create a second User object and assign the
> properties so I can use that in the Authentication session, but I dont see
> why I should need to do that. Any insight is appreciated.
>
> Thanks,
> Mat
>

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]