| | |
| | | // no authentication enabled
|
| | | throw new RestartResponseException(getApplication().getHomePage());
|
| | | }
|
| | | setupPage(getString("gb.changePassword"), GitBlitWebSession.get().getUser().username);
|
| | | |
| | | if (!GitBlit.self().supportsCredentialChanges()) {
|
| | | error(MessageFormat.format(getString("gb.userServiceDoesNotPermitPasswordChanges"),
|
| | | GitBlit.getString(Keys.realm.userService, "users.conf")), true);
|
| | | }
|
| | | |
| | | setupPage(getString("gb.changePassword"), GitBlitWebSession.get().getUsername());
|
| | |
|
| | | StatelessForm<Void> form = new StatelessForm<Void>("passwordForm") {
|
| | |
|
| | |
| | | String confirmPassword = ChangePasswordPage.this.confirmPassword.getObject();
|
| | | // ensure passwords match
|
| | | if (!password.equals(confirmPassword)) {
|
| | | error("Passwords do not match!");
|
| | | error(getString("gb.passwordsDoNotMatch"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | minLength = 4;
|
| | | }
|
| | | if (password.length() < minLength) {
|
| | | error(MessageFormat.format(
|
| | | "Password is too short. Minimum length is {0} characters.", minLength));
|
| | | error(MessageFormat.format(getString("gb.passwordTooShort"), minLength));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | | setRedirect(false);
|
| | | info("Password successfully changed.");
|
| | | info(getString("gb.passwordChanged"));
|
| | | setResponsePage(RepositoriesPage.class);
|
| | | }
|
| | | };
|
| | |
| | | @Override
|
| | | public void onSubmit() {
|
| | | setRedirect(false);
|
| | | error("Password change aborted.");
|
| | | error(getString("gb.passwordChangeAborted"));
|
| | | setResponsePage(RepositoriesPage.class);
|
| | | }
|
| | | };
|