/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php class User extends AppModel { var $name = 'User'; var $displayField = 'username'; 'message' => 'This username is already registered.' ), 'message' => 'Your username has to be between 4 and 30 characters.' ) ), 'message' => 'These passwords aren\'t the same.' ), 'message' => 'The password must be at least 6 characters and should contain at least one digit.' ), 'message' => 'The password must be at least 6 characters and should contain at least one digit.' ) ), 'message' => 'This is not a valid e-mail address.' ), 'message' => 'This e-mail address is already registered.' ), 'message' => 'These e-mail addresses aren\'t the same.' ) ), 'message' => 'This is not a valid e-mail address.', 'last' => true ) )/*, 'email_for_credentials' => array( 'email' => array( 'rule' => array('email'), 'message' => 'This is not a valid e-mail address.' ), )*/ ); //The Associations below have been created with all possible keys, those that are not needed can be removed 'className' => 'Bike', 'foreignKey' => 'user_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ), 'className' => 'Part', 'foreignKey' => 'user_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ), 'className' => 'Company', 'foreignKey' => 'user_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ), 'className' => 'Vote', 'foreignKey' => 'user_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ), 'className' => 'Ownership', 'foreignKey' => 'user_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ) ); 'joinTable' => 'groups_users', 'foreignKey' => 'user_id', 'associationForeignKey' => 'group_id', 'unique' => true ) ); $method = $options[0][0]; $options[0][0] = $this->data[$this->alias][$options[1][0]]; $valid = $this->{$method}($value); } else { } if (!$valid) { foreach($options[1] as $field) { $this->invalidate($field, $rule['message']); } } return $valid; } if (!$valid) { } return $valid; } } ?>