title: CakePHP: "password" and "password_repeat" can be empty on update
body: <p>my situation is this: I have two fields for the password of the user, "password" and "password_repeat". </p>
  
  <p>On create (adding an user), both fields must be filled out obviously.<br>
  Instead, on update (editing an user), the fields can be left empty (so the user's password can remain the same). But if the "password" field is filled, then the "password_repeat" field must be filled.</p>
  
  <p>For now I solved in this way and it seems to work:</p>
  
  <pre><code>public $validate = array(
          'password' =&gt; array(
              'minLengthOnCreate' =&gt; array(
                  'allowEmpty'    =&gt; FALSE,
                  'message'       =&gt; 'Must be at least %d characters',
                  'on'            =&gt; 'create',
                  'rule'          =&gt; array('minLength', 8)
              ),
              'minLengthOnUpdate' =&gt; array(
                  'allowEmpty'    =&gt; TRUE,
                  'message'       =&gt; 'Must be at least %d characters',
                  'on'            =&gt; 'update',
                  'rule'          =&gt; array('minLength', 8)
              )
          ),
          'password_repeat' =&gt; array(
              'passwordsMatchOnCreate' =&gt; array(
                  'allowEmpty'    =&gt; FALSE,
                  'message'       =&gt; 'Passwords don\'t match',
                  'on'            =&gt; 'create',
                  'rule'          =&gt; 'passwordsMatch'
              ),
              'passwordsMatchOnUpdate' =&gt; array(
                  'allowEmpty'    =&gt; TRUE,
                  'message'       =&gt; 'Passwords don\'t match',
                  'on'            =&gt; 'update',
                  'rule'          =&gt; 'passwordsMatch'
              )
          )
      );
  </code></pre>
  
  <p>In this way, the two fields are required on "create", but not on "update".<br>
  And now I do not like this, because I think there is a way to do it better.</p>
  
  <p>But this is not enough: on "update", if the "password" field is filled in, the "password_repeat" field can be left blank. 
  So I added this: </p>
  
  <pre><code>public function beforeValidate($options = array()) {
          if(!empty($this-&gt;data[$this-&gt;alias]['password']) &amp;&amp; isset($this-&gt;data[$this-&gt;alias]['password_repeat']))        
              $this-&gt;validator()-&gt;getField('password_repeat')-&gt;getRule('passwordsMatchOnUpdate')-&gt;allowEmpty = FALSE;
  
          return TRUE;
      }
  </code></pre>
  
  <p>And also I like very little. 
  But it seems that everything works well. </p>
  
  <p>Suggestions?</p>