* @param user
*/
public void validateUserForm(HttpServletRequest request,
ActionMessages msgs, boolean reg) {
if (reg && StringUtils.isEmpty(getName()))
msgs.add("name", new ActionMessage("error.username_empty"));
else if (reg && !StringUtils.isLegalUsername(getName()))
msgs.add("name", new ActionMessage("error.illegal_username"));
else if (StringUtils.isEmpty(getNickname()))
msgs.add("nickname", new ActionMessage("error.nickname_empty"));
else if (StringUtils.isEmpty(getPassword()))
msgs.add("password", new ActionMessage("error.password_empty"));
// ��֤�û��������ϵ��Ϣ����Ч��
else if (StringUtils.isNotEmpty(getEmail())
&& !StringUtils.isEmail(getEmail()))
msgs.add("email", new ActionMessage("error.email_format"));
else if (StringUtils.isNotEmpty(getQq())
&& !StringUtils.isNumeric(getQq()))
msgs.add("qq", new ActionMessage("error.qq_format"));
else if (StringUtils.isNotEmpty(getMsn())
&& !StringUtils.isEmail(getMsn()))
msgs.add("msn", new ActionMessage("error.msn_format"));
else if (StringUtils.isNotEmpty(getMobile())
&& !StringUtils.isNumeric(getMobile()))
msgs.add("mobile", new ActionMessage("error.mobile_format"));
// У��ע����֤��
else if (reg
&& !StringUtils.equals(getVerifyCode(),
getVerifyCode(request)))
msgs.add("verifyCode", new ActionMessage("error.verified_failed"));
else if (DLOGSecurityManager.IllegalGlossary.existIllegalWord(getNickname()))
msgs.add("nickname", new ActionMessage("error.illegal_glossary"));
// �ʺŲ������ظ�
else if (reg && DLOGUserManager.getUserByName(getName().trim()) != null)
msgs.add("name", new ActionMessage("error.username_exists", getName()));
// �û��dz�Ҳ�������ظ�
else if (reg && DLOGUserManager.getUserByNickname(getNickname().trim()) != null)
msgs.add("nickname", new ActionMessage("error.nickname_exists", getNickname()));
}