you forgot to set `parent::beforeFilter()` in your callback of this
controller
`
also note that you shouldnt do this in beforeFilter() but in
beforeRender()!
On 2 Feb., 17:34, Daniel <danwgr...@gmail.com> wrote:
> I get the following error when accessing a page "persons/edit/1" when
> not logged in:
> Undefined variable: logged_in [APP\View\Layouts\default.ctp, line 43]
>
> The code in the app controller is as follows:
> function beforeFilter() {
> $this->Auth->authError = 'You cannot access that page.';
> $this->Auth->loginError = 'Incorrect username or password, please
> check!';
> $this->Auth->loginRedirect = array('controller' => 'people', 'action'
> => 'index');
> $this->Auth->logoutRedirect = '/';
> $this->set('logged_in', $this->_loggedIn());
> $this->set('username', $this->_username());
>
> }
>
> function _loggedIn() {
> if ($this->Auth->user())
> return true;
> return false;
>
> }
>
> Any ideas?
> Thanks
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment