Skip to content

Commit

Permalink
Display unkown auth.method
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmipt committed Mar 22, 2024
1 parent 08f1321 commit 640c08b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/studio/ui/ServerForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,19 @@ public ServerForm(Window frame, String title, Server server) {
DefaultComboBoxModel<String> dcbm = (DefaultComboBoxModel<String>) authenticationMechanism.getModel();
String[] am;
am = AuthenticationManager.getInstance().getAuthenticationMechanisms();
boolean foundAuth = false;
for (int i = 0; i < am.length; i++) {
dcbm.addElement(am[i]);
if (this.server.getAuthenticationMechanism().equals(am[i]))
if (this.server.getAuthenticationMechanism().equals(am[i])) {
dcbm.setSelectedItem(am[i]);
foundAuth = true;
}
}

if (!foundAuth) {
String authMethod = server.getAuthenticationMechanism();
dcbm.addElement(authMethod);
dcbm.setSelectedItem(authMethod);
}

authenticationMechanism.addItemListener(e -> {
Expand Down

0 comments on commit 640c08b

Please sign in to comment.