Re: Function 'log in as' user

2011-05-16 Thread designv...@gmail.com
haha! brilliant! So much easier. On May 16, 10:26 am, Jeremy Burns | Class Outfit wrote: > It's very easy to spoof a user: > > $user = $this->User->findByUsername($username); > > if ($user): >         if ($this->Auth->login($user)): >                 $this->redirect(array('action' => 'view', 'ad

Re: Function 'log in as' user

2011-05-16 Thread Jeremy Burns | Class Outfit
It's very easy to spoof a user: $user = $this->User->findByUsername($username); if ($user): if ($this->Auth->login($user)): $this->redirect(array('action' => 'view', 'admin' => false)); endif; endif; Jeremy Burns Class Outfit jeremybu...@c

Re: Function 'log in as' user

2011-05-16 Thread designv...@gmail.com
If you are using roles then you could just have an option to pick a different role when you login and save that into the session instead of the one stored with your default admin record. On May 16, 10:19 am, heohni wrote: > Hi, > > I would like tow rite a function which allows me as admin to lo

Function 'log in as' user

2011-05-16 Thread heohni
Hi, I would like tow rite a function which allows me as admin to login as user using their username and their password. Is something like this possible? I have seen such a function is some CMS and I find it very useful as admin to check out the users view, without the knowing their passwords. Any