Hello,

I have encountered a strange problem with validation where it works
when I am testing on my localhost machine but does not work on my live
server.

The following is what I am trying to do.

$params['User']['email'] = $email;
$params['User']['username'] = trim($username);
$params['User']['passwd'] = $password;

App::import('Model', 'User');
$userModel = new User();
$userModel->set($params);

$this->othAuth->auto_redirect = false;

//PROBLEM
if(!$userModel->validates() || !$userModel->userInfoValidation())
{
        return false;
}

What happens is that $userModel->validates() is always returning false
no matter what I do.

It does however return true if I use simple rule var $validate = array
('username' => VALID_NOT_EMPTY);

Anyways, the validation block in the User model is

var $validate = array(
                'username' => array(
                        'alphaNumeric' => array(
                                'rule' => 'alphaNumeric',
                                'required' => true
                        ),
                        'between' => array(
                                'rule' => array('between', 6, 20)
                        )
                )
        );

Has anybody experienced things similar?

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