/** * Handles the login. * <p> * In deferred mode, this method is called after the dummy POST request that * triggers the password manager has been completed. In direct mode (the * default setting), it is called directly when the user hits the enter key * or clicks on the login button. In the latter case, you cannot change the * URL in the method or the password manager will not be triggered. */ private void login() { Map<String, String> params = new HashMap<>(); params.put("username", getUsernameField().getValue()); params.put("password", getPasswordField().getValue()); LoginEvent event = new LoginEvent(LoginForm.this, params); fireEvent(event); }
@Override public void writeDesign(Element design, DesignContext designContext) { super.writeDesign(design, designContext); AbstractTextField def = designContext.getDefaultInstance(this); Attributes attr = design.attributes(); DesignAttributeHandler.writeAttribute("value", attr, getValue(), def.getValue(), String.class, designContext); }
/** * Returns the password 1 value.<p> * * @return the password 1 */ public String getPassword1() { return m_passwordField1.getValue(); }
/** * Returns the old password value.<p> * * @return the old password */ public String getOldPassword() { return m_oldPasswordField.getValue(); }
/** * Returns the password 2 value.<p> * * @return the password 2 */ public String getPassword2() { return m_passwordField2.getValue(); }
public String getPassword() { return this.passwordField.getValue(); }
public String getPasswordAndReset() { String value = this.passwordField.getValue(); this.passwordField.setValue(""); return value; }
/** * Called for each change of the password field. * * @return <code>true</code> if the password is valid, <code>false</code> otherwise. */ protected boolean passwordChanged() { return isPasswordValid((String) m_passwordTextField.getValue()); }
@Override protected Object getValue() throws MException { return ((PasswordField)getComponentEditor()).getValue(); }
/** * @return <code>true</code> if the current form is valid, <code>false</code> otherwise. */ protected boolean isCurrentFormValid() { String username = (String) m_usernameTextField.getValue(); if (username == null || "".equals(username.trim())) { return false; } String password = (String) m_passwordTextField.getValue(); if (password == null || "".equals(password.trim())) { return false; } String groupName = (String) m_groupSelect.getValue(); if (groupName == null || "".equals(groupName.trim())) { return false; } return true; }
public void buttonClick(ClickEvent event) { Map<String, Object> accountDetails = createAccountDetails( "alfresco", alfrescoUserName.getValue().toString(), alfrescoPassword.getValue().toString(), "server", alfrescoServer.getValue().toString() ); fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails)); } };
public void buttonClick(ClickEvent event) { Map<String, Object> accountDetails = createAccountDetails( "imap", imapUserName.getValue().toString(), imapPassword.getValue().toString(), "server", imapServer.getValue().toString(), "port", imapPort.getValue().toString(), "ssl", imapPort.getValue().toString() ); fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails)); } };
public Validator getPasswordsMatchValidator(final PasswordField newPass) { return (Validator<String>) (value,context) -> { if (!newPass.getValue().equals(value)) return ValidationResult.error(getApp().getMessage("error.passwordsMatch")); return ValidationResult.ok(); }; }
public void buttonClick(ClickEvent event) { if (login((String) m_name.getValue(), (String) m_password.getValue())) { closeWindow(); } else { // TODO provide some feedback, login failed, for now don't close the login window m_loginButton.setComponentError(new UserError("Invalid username or password.")); } } });
@Override protected boolean doAction(Action action) { result = action; if (action.equals(confirm)) txtInput = (String) textField.getValue(); if (listener != null) { if (action.equals(confirm) && !listener.validate(txtInput)) return false; listener.onClose(this); } return true; }
@Override protected boolean doAction(Action action) { result = action; if (action.equals(confirm)) txtInput = (String) textField.getValue(); if (listener != null) { if (action.equals(confirm) && !listener.validate(txtInput)) return false; listener.onClose(this); } return true; }
@Override public void buttonClick(ClickEvent event) { if ("".equals(password.getValue())) { password.focus(); return; } error.setCaption(""); if (listener != null && listener.doLogin(username.getValue(),password.getValue())) { signin.removeShortcutListener(enter); } else { // Add new error message error.setCaption(MNls.find(LoginPanel.this, "login.error=Wrong username or password.")); username.focus(); } } });
private void handleLogin() { if (multiTenancyIndicator.isMultiTenancySupported()) { final boolean textFieldsNotEmpty = hasTenantFieldText() && hasUserFieldText() && hashPasswordFieldText(); if (textFieldsNotEmpty) { login(tenant.getValue(), username.getValue(), password.getValue(), true); } } else if (!multiTenancyIndicator.isMultiTenancySupported() && hasUserFieldText() && hashPasswordFieldText()) { login(null, username.getValue(), password.getValue(), true); } }
private void handleLogin() { if (multiTenancyIndicator.isMultiTenancySupported()) { final boolean textFieldsNotEmpty = hasTenantFieldText() && hasUserFieldText() && hashPasswordFieldText(); if (textFieldsNotEmpty) { login(tenant.getValue(), username.getValue(), password.getValue(), true); } } else if (!multiTenancyIndicator.isMultiTenancySupported() && hasUserFieldText() && hashPasswordFieldText()) { login(null, username.getValue(), password.getValue(), true); } }
@Override public void buttonClick(ClickEvent clickEvent) { platformConfigurationService.saveConfigurationValue (ConfigurationConstants.DASHBOARD_BASE_URL, dashboardBaseUrl.getValue()); platformConfigurationService.saveWebServiceUsername(usernameField.getValue()); platformConfigurationService.saveWebServicePassword(passwordField.getValue()); Notification notification = new Notification( "Saved", "The configuration has been saved successfully!", Type.HUMANIZED_MESSAGE); notification.setStyleName(ValoTheme.NOTIFICATION_CLOSABLE); notification.show(Page.getCurrent()); } });