public void textChange(TextChangeEvent event) { checkPasswordMatch(event.getText()); } });
public void textChange(TextChangeEvent event) { checkSecurity(event.getText()); } });
public void valueChange(ValueChangeEvent event) { clearOldPasswordError(); } });
String password2 = m_form.getPassword2(); if (validatePasswords(password1, password2)) { String oldPassword = m_form.getOldPassword(); boolean error = false; close(); } else {
setContent(m_form); if (OpenCms.getPasswordHandler() instanceof I_CmsPasswordSecurityEvaluator) { m_form.setSecurityHint( addButton(m_passwordChangeButton); m_passwordChangeButton.addClickListener(new ClickListener() { addButton(m_cancelButton); m_cancelButton.addClickListener(new ClickListener() {
CmsChangePasswordDialog passwordDialog = new CmsChangePasswordDialog( currentCms, userObj, A_CmsUI.get().getLocale()); passwordDialog.setAdditionalMessage(getPasswordChangeMessage()); A_CmsUI.get().setContentToDialog( Messages.get().getBundle(A_CmsUI.get().getLocale()).key(Messages.GUI_PWCHANGE_HEADER_0)
/** * Checks whether the passwords match.<p> * * @param password2 the password 2 value */ void checkPasswordMatch(String password2) { if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(password2)) { showPasswordMatchError(!password2.equals(m_form.getPassword1())); } }
public void buttonClick(ClickEvent event) { close(); } });
public void buttonClick(ClickEvent event) { m_context.start( CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_PWCHANGE_HEADER_0) + m_user.getSimpleName(), new CmsChangePasswordDialog(m_context)); } });
/** * Creates a new instance.<p> * * @param context the dialog context */ public CmsChangePasswordDialog(I_CmsDialogContext context) { this(context.getCms(), context.getCms().getRequestContext().getCurrentUser(), UI.getCurrent().getLocale()); m_context = context; m_cancelButton.setVisible(true); setActionHandler(new CmsOkCancelActionHandler() { private static final long serialVersionUID = 1L; @Override protected void cancel() { close(); } @Override protected void ok() { submit(); } }); }
/** * Validates the passwords, checking if they match and fulfill the requirements of the password handler.<p> * Will show the appropriate errors if necessary.<p> * * @param password1 password 1 * @param password2 password 2 * * @return <code>true</code> if valid */ boolean validatePasswords(String password1, String password2) { if (!password1.equals(password2)) { showPasswordMatchError(true); return false; } showPasswordMatchError(false); try { OpenCms.getPasswordHandler().validatePassword(password1); m_form.getPassword1Field().setComponentError(null); return true; } catch (CmsException e) { m_form.setErrorPassword1(new UserError(e.getLocalizedMessage(m_locale)), OpenCmsTheme.SECURITY_INVALID); return false; } } }
@Override protected void cancel() { close(); }
/** * Checks the security level of the given password.<p> * * @param password the password */ void checkSecurity(String password) { I_CmsPasswordHandler handler = OpenCms.getPasswordHandler(); try { handler.validatePassword(password); if (handler instanceof I_CmsPasswordSecurityEvaluator) { SecurityLevel level = ((I_CmsPasswordSecurityEvaluator)handler).evaluatePasswordSecurity(password); m_form.setErrorPassword1(null, OpenCmsTheme.SECURITY + "-" + level.name()); } else { m_form.setErrorPassword1(null, OpenCmsTheme.SECURITY_STRONG); } } catch (CmsSecurityException e) { m_form.setErrorPassword1(new UserError(e.getLocalizedMessage(m_locale)), OpenCmsTheme.SECURITY_INVALID); } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_form.getPassword2())) { showPasswordMatchError(!password.equals(m_form.getPassword2())); } }