Skip to content

1226 sshkey form feedback #1239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/com/gitblit/wicket/GitBlitWebApp.properties
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,8 @@ gb.emailAddressDescription = The primary email address for receiving notificatio
gb.sshKeys = SSH Keys
gb.sshKeysDescription = SSH public key authentication is a secure alternative to password authentication
gb.addSshKey = Add SSH Key
gb.addSshKeyErrorEmpty = SSH public key empty. Please provide a valid SSH public key
gb.addSshKeyErrorFormat = Not a valid SSH public key format. Please provide a valid SSH public key
gb.key = Key
gb.comment = Comment
gb.sshKeyCommentDescription = Enter an optional comment. If blank, the comment will be extracted from the key data.
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/gitblit/wicket/GitBlitWebApp_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,8 @@ gb.emailAddressDescription = Die prim\u00e4re Emailadresse f\u00fcr den Empfang
gb.sshKeys = SSH Keys
gb.sshKeysDescription = SSH Public Key Authentifizierung ist eine sichere Alternative zur Authentifizierung mit Passwort
gb.addSshKey = SSH Key hinzuf\u00fcgen
gb.addSshKeyErrorEmpty = SSH Public Key leer. Bitte geben Sie einen g\u00fltigen SSH Public Key an
gb.addSshKeyErrorFormat = SSH Public Key Format ung�ltig. Bitte geben Sie einen g\u00fltigen SSH Public Key an
gb.key = Key
gb.comment = Kommentar
gb.sshKeyCommentDescription = Geben Sie optional einen Kommentar ein. Falls Sie dies nicht tun, wird der Kommentar aus dem Key extrahiert.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/gitblit/wicket/pages/BasePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ protected void setupPage(String repositoryName, String pageName) {
add(rootLink);

// Feedback panel for info, warning, and non-fatal error messages
add(new FeedbackPanel("feedback"));
add(new FeedbackPanel("feedback").setOutputMarkupId(true));

add(new Label("gbVersion", "v" + Constants.getVersion()));
if (app().settings().getBoolean(Keys.web.aggressiveHeapManagement, false)) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/gitblit/wicket/panels/SshKeysPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
String data = keyData.getObject();
if (StringUtils.isEmpty(data)) {
// do not submit empty key
error(getString("gb.addSshKeyErrorEmpty"));
target.addComponent(getPage().get("feedback"));
return;
}

Expand All @@ -142,6 +144,8 @@ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
key.getPublicKey();
} catch (Exception e) {
// failed to parse the key
error(getString("gb.addSshKeyErrorFormat"));
target.addComponent(getPage().get("feedback"));
return;
}

Expand Down