I have moved a few of my functions to a new controller and trying to get
them to work.
 
I have my passwords_controller where User can update thier password / forgot
or what not
 
var $uses = array('User'); 
//does not have its own model
 
now in my function 
 

      function forgot() {
          $this->pageTitle = 'Forgot Password';
          $this->layout = 'default_right';
          //can not access this if they are logged in
          if (isset($_SESSION['Auth']['User']['username'])) {
              $this->redirect(array('controller' => 'jobs', 'action' =>
'index'));
          }
          //forgot password function sends out email
          if (!empty($this->data)) {
              debug($this->data);
              debug($userInfo =
$this->User->getUserInfo($this->data['User']['email']));
              $this->User->unbindValidation('keep', array('email'), true);
              $this->User->set($this->data['User']['email']);
              if ($this->User->validates()) {
                  if (!empty($userInfo)) {
                      $userInfo['User']['reset'] = string::uuid();
                      $this->sendEmail($userInfo, 'Reset Password',
'forgot');
                      $this->User->id = $userInfo['User']['id'];
                      $this->User->saveField('reset',
$userInfo['User']['reset']);
                      
                  }
              } else {
                  $errors = $this->User->invalidFields();
                  debug($errors);
                  $this->data = null;
                                }
          }
      }

The User never validates $errors always comes back 'empty'.
Array
(
    [email] => empty.
)

Validation set:

'email' => array(
                        'email-notempty' => array(
                                'rule' => array('notempty'),
                                'required' => true,
                                'allowEmpty' => false,
                                'message' => 'empty.',
                                'last' => true,),
        

                        'email-validEmail' => array(
                                'rule' => array('email', true),
                                'last' => true,
                                'message' => 'not an email.'),
                        
                        ),
 
 
Where am I going wrong here?


--~--~---------~--~----~------------~-------~--~----~
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