First, why you are not using Auth component? this will make your life a lot
easier!
Second, what are your validation rules?

On Sun, Dec 19, 2010 at 8:12 AM, John Maxim <goog...@gmail.com> wrote:

> Modified function code: (NEW)
>
> function register()
>                {
>                  if (!empty($this->data))
>                  {
>                    $this->data['User']['password'] =
> md5($this->data['User']
> ['password']);
>
>                        if ($this->User->save($this->data))
>
>                                {
>                                  $this->Session->setFlash('Your
> registration information was
> accepted.');
>                                  $this->Session->write('user',
> $this->data['User']['username']);
>                                  $this->redirect(array('action' =>
> 'index'), null, true);
>
>                                }else{
>                                $this->data['User']['password'] = '';
>                $this->Session->setFlash('There was a problem saving
> this information');
>                                }
>                  }
>                }
>
> ****************************************************
> Hi guys, after modifying to suit the above codes, my register page
> does not validate the password field anymore. The previous code is as
> below:
>
> Previous function code: (OLD)
>
>
>    function register()
>        {
>                  if (!empty($this->data))
>                  {
>                                if ($this->User->save($this->data))
>                                {
>                                  $this->Session->setFlash('Your
> registration information was
> accepted.');
>                                }
>                  }
>        }
>
> *********************************************
> Using this, validations are fine. Can anyone explains where went wrong
> with the modified function code ? It's important to hash the password
> and automatically directing to index page after registering
> successfully, can't continue with this tutorial if stuck right
> here....
>
>
> 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<cake-php%2bunsubscr...@googlegroups.com>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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