Saturday, March 10, 2012

Login error messages not showing up

The login error messages are not showing up when I enter an incorrect
username / password.

Here is the code in my app controller:
class AppController extends Controller {
...
function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('display');
$this->Auth->loginRedirect = '/'; // array('controller'=>'posts',
'action' => 'index');
$this->Auth->logoutRedirect = '/'; // array('controller'=>'posts',
'action' => 'index');
$this->Auth->authError = 'You cannot access that page.';
$this->Auth->loginError = 'Incorrect username/password.';

Also in my default.ctp body I have:
<div id="content">
<?php echo $this->Session->flash(); ?>
<?php echo $this->Session->flash('auth'); ?>
<?php echo $content_for_layout; ?>
</div>

I'm using cake 2.0. I don't know what is missing.

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate