2010年11月1日星期一

Re: [fw-auth] Mimic a user

On Tue, Nov 2, 2010 at 12:55 AM, monk.e.boy <john@teethgrinder.co.uk> wrote:

>
> Hi,
>
> When I log in as admin I would like to be able to choose a user and then
> sort of be them, but with an extra admin tool bar.
>
> I do a lot of this:
>
> $u = Doctrine::getTable('User')
> ->createQuery('u')
> ->where('u.email=?');
>
> $user = $u->fetchOne(array(
> Zend_Auth::getInstance()->getIdentity()
> ), Doctrine_Core::HYDRATE_RECORD);
>
> I was thinking of extending Zend_Auth_Adapter_DbTable so it would respond
> with the user name when I am mimicing them? Should I be looking at ACL?
>
> How do you guys solve this?
>
> Many thanks,
>
> monk.e.boy
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Mimic-a-user-tp3023001p3023001.html
> Sent from the Zend Auth mailing list archive at Nabble.com.
>
>
Hi my solution is not ZF specific.
For this functionality, we just save your original session object into a
custom session variable, and fill your session for the given user.
We have a little piece of code, which can revert your original session
object from the custom session variable.

With this solution, you will be seen by the system as the original user.

Tyrael

没有评论: