浏览代码

change password updates

m 14 年之前
父节点
当前提交
1ea6a8a8cb
共有 1 个文件被更改,包括 5 次插入1 次删除
  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;			
+		}
 	}
 
 	/**