Re: Admin Access

2007-01-22 Thread Lemuel Formacil
On Monday 22 January 2007 06:00, indoven wrote: > Thanks Hydra. > The code was based on https://trac.cakephp.org/ticket/943. > > With the suggested changes it doesn't work. I think you also forgot to assign a value to $logged. function admin_index() {     $username = $this->Session->read('user')

Re: Admin Access

2007-01-21 Thread indoven
Thanks Hydra. The code was based on https://trac.cakephp.org/ticket/943. With the suggested changes it doesn't work. Perhaps I need to upgrade to 1.2. Anyone done this with 1.1 and have a code sample? --~--~-~--~~~---~--~~ You received this message because you a

Re: Admin Access

2007-01-21 Thread RichardAtHome
php functions can have many returns. Proccessing stops (and returns) at the first one the program logic reaches: http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---

Re: Admin Access

2007-01-21 Thread hydra12
First, in your admin_index() function, in the if statement: $this->redirect('/admin/xyz'); should be INSIDE the {} like this: if ($logged) { $this->redirect('/admin/xyz'); } Second, in the same function, in your else clause, you have 2 return statements. Unless I'm mistaken, a function can

Admin Access

2007-01-21 Thread indoven
Hello, I'm using Cake 1.1 stable. Trying to get admin access authenticated as posted by phpNut a while back. After login I get redirected back to the login page. What's wrong with my code? function admin_index() { $username = $this->Session->read('user');