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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to