I am also have the same problem

I get login page every time I write correct Username and Password
What is the problem ?!?!


We need help here



On Dec 20, 10:00 am, John Maxim <goog...@gmail.com> wrote:
> My Register page:
>
> <p>Please fill out the form below to register an account.</p>
> <?php echo $form->create('User', array('action' => 'register'));?>
>
> <?php
>     echo $form->input('first_name');
>     echo $form->input('last_name');
>     echo $form->input('username');
>     echo $form->input('email');
>     echo $form->input('password');
> ?>
>
> <?php echo $form->end('Register');?>
>
> My knownusers page:
>
> <table>
> <?php
>
> echo $html->tableHeaders(array_keys($knownusers[0]['User']));
>
> foreach ($knownusers as $thisuser)
> {
>         echo $html->tableCells($thisuser['User']);
>
> }
>
> ?>
> </table>
>
> ******
>
> Is it something I have to add in both register and knownusers page ?
>
> On Dec 20, 2:47 pm, John Maxim <goog...@gmail.com> wrote:
>
> > If I removed the Auth component from the controller pager, I can view
> > my register and knownusers page.
>
> > But that defeats the reason of hashing password using Auth component.
>
> > On Dec 20, 2:45 pm, John Maxim <goog...@gmail.com> wrote:
>
> > > I included this built-in in my controller:
>
> > > var $components = array('Auth');
>
> > > so now my controller looks like this:
>
> > > class UsersController extends AppController
> > > {
>
> > >         var $name = 'Users';
>
> > >     var $helpers = array('Html', 'Form' );
>
> > >         var $components = array('Auth');
>
> > >     function register()
> > >         {
> > >                   if (!empty($this->data))
> > >                   {
> > >                                 if ($this->User->save($this->data))
> > >                                 {
> > >                                   $this->Session->setFlash('Your 
> > > registration information was
> > > accepted.');
> > >                                 }
> > >                   }
> > >         }
>
> > >         function knownusers()
> > >         {
>
> > >                 $this->set('knownusers',
> > >                 $this->User->find('all', array('order' => array('User.id 
> > > DESC')),
> > > array('fields' => array('User.id', 'User.username', 'User.first_name',
> > > 'User.last_name')))
> > >                 );
> > >         }
>
> > >         function login()
> > >     {
>
> > >     }
>
> > >         function logout() {
> > >         $this->redirect($this->Auth->logout());
> > >         }
>
> > > }
>
> > > ***************
>
> > > I can't view my register and knownusers page now, it redirects me to
> > > login page.
>
> > > My login page is as follow:
>
> > > <?php
> > >     echo $session->flash('auth');
> > >     echo $this->Form->create('User', array('action' => 'login'));
> > >     echo $this->Form->input('username');
> > >     echo $this->Form->input('password');
> > >     echo $this->Form->end('Login');
> > >    ?>
>
> > > Why is it redirected each time I view register and knownusers
> > > page ...to login page ?
>
> > > How do I know if the hash password is already working now ?? since I
> > > can't register ..?
>
> > > On Dec 20, 11:25 am, John Maxim <goog...@gmail.com> wrote:
>
> > > > My controller is here:
>
> > > > class UsersController extends AppController
> > > > {
>
> > > >         var $name = 'Users';
>
> > > >     var $helpers = array('Html', 'Form' );
>
> > > >     function register()
> > > >         {
> > > >                   if (!empty($this->data))
> > > >                   {
> > > >                                 if ($this->User->save($this->data))
> > > >                                 {
> > > >                                   $this->Session->setFlash('Your 
> > > > registration information was
> > > > accepted.');
> > > >                                 }
> > > >                   }
> > > >         }
>
> > > > Do I add this in?:
>
> > > > var $components = array('Auth');
>
> > > > or can I add into   var $helpers = array('Html', 'Form',
> > > > 'Auth' );    ?
>
> > > > Sorry my password validation is here:
>
> > > > 'password' => array(
> > > >                         'notEmpty' => array(
> > > >                                 'rule' => 'notEmpty',
> > > >                                 'message' => 'This field cannot be 
> > > > blank.',
> > > >                                 'last' => true,
> > > >                         ),
>
> > > > ***
>
> > > > and no, I didn't get any error, the only problem was the validation
> > > > for password can't be triggered after I used the code I posted from
> > > > the first post (NEW). After editing back to my (OLD) code it works
> > > > fine now except with no HASHING and AUTO-LOGIN feature.
>
> > > > Can you point me to AUTO-LOGIN coding ? how should I go about? I'm
> > > > still not done with hashing yet, as I'm not sure how to use AUTH
> > > > component.
>
> > > > On Dec 20, 3:10 am, cricket <zijn.digi...@gmail.com> wrote:
>
> > > > > On Sun, Dec 19, 2010 at 2:07 AM, John Maxim <goog...@gmail.com> wrote:
> > > > > > What are Auth component ?
>
> > > > >http://book.cakephp.org/view/1250/Authentication
>
> > > > > Just note that Auth will hash your password for you, so there's no
> > > > > need to cal md5().
>
> > > > > > My validation rules are here:
>
> > > > > There's no password validation there. What, exactly, is the problem
> > > > > you're seeing? Could you post the validation rules?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to