Browse Source

change password updates

m 14 years ago
parent
commit
1ea6a8a8cb
1 changed files with 5 additions and 1 deletions
  1. 5 1
      models/behaviors/change_password.php

+ 5 - 1
models/behaviors/change_password.php

@@ -53,7 +53,7 @@ class ChangePasswordBehavior extends ModelBehavior {
 		'form_field_current' => 'pwd_current',
 		'hashType' => null,
 		'hashSalt' => true,
-		'auth' => 'Auth',
+		'auth' => 'Auth', # which component
 	);
 	
 	var $_validationRules = array(
@@ -143,6 +143,10 @@ class ChangePasswordBehavior extends ModelBehavior {
 			$Model->validate[$formFieldRepeat] = $this->_validationRules[$formFieldRepeat];
 			$Model->validate[$formFieldRepeat]['validateIdentical']['rule'][1] = $formField;			
 		}
+		# allowEmpty?
+		if (!empty($this->settings[$Model->alias]['allowEmpty'])) {
+			$Model->validate[$formField]['between']['rule'][1] = 0;			
+		}
 	}
 
 	/**