diff options
author | Jonathan Bauer | 2017-12-18 13:36:25 +0100 |
---|---|---|
committer | Jonathan Bauer | 2017-12-18 13:36:25 +0100 |
commit | 015ae330d5d912525e43621df8b93ddbb740adc6 (patch) | |
tree | 0d8ae4c6d9ce4c8cfdf2dc88613699076cb03fa6 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetshareConfigurator.java | |
parent | [server] Fix NPE if no existing config in DB (diff) | |
download | tutor-module-015ae330d5d912525e43621df8b93ddbb740adc6.tar.gz tutor-module-015ae330d5d912525e43621df8b93ddbb740adc6.tar.xz tutor-module-015ae330d5d912525e43621df8b93ddbb740adc6.zip |
[netshare] do not allow empty usernames anymore
since 1) it does not really make sense to support them and 2) it caused
openslx.exe to try with the logged in user's credentials which would
probably not be expected by the users configuring a specific (empty)
user.
+ Fixed a bug where editing a existing share to the values of another
existing one would delete it from the list without refreshing it, giving
the impression that the share is still there where, in fact, it was not.
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetshareConfigurator.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetshareConfigurator.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetshareConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetshareConfigurator.java index 816331a0..8c9e5149 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetshareConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetshareConfigurator.java @@ -149,10 +149,8 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout { case OTHER_USER: // save given username/password input.username = tfUsername.getText(); - char[] inputPassword = tfPassword.getPassword(); - input.password = new String(inputPassword); - // if password is set but no username, error - if (!input.password.isEmpty() && input.username.isEmpty()) { + input.password = new String(tfPassword.getPassword()); + if (input.username.isEmpty()) { lblError.setText("Kein Nutzername angegeben!"); return; } @@ -162,7 +160,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout { break; } if (input == null) { - lblError.setText("Interner Fehler"); + lblError.setText("Fehlerhafte Eingabe"); LOGGER.debug("Bad input, aborting."); return; } @@ -180,9 +178,10 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout { // editing existing one, delete it from the internal data if (!tblNetshareData.remove(oldEntry)) { lblError.setText("Änderung fehlgeschlagen!"); - LOGGER.debug("Failed to remove selected share for replacement!"); + LOGGER.debug("Failed to remove selected share for replacement: " + oldEntry); return; } + tblNetshare.getModel().setData(tblNetshareData); } // either we delete the existing share from the data or we are // creating a new one, either way add it to the list and update @@ -199,7 +198,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout { "Das eingebene Passwort wird im Klartext gespeichert " + "und ist in der VM für jeden Nutzer sichtbar.\n" + "Verwenden Sie auf keinen Fall sicherheitskritische Passwörter!" - + "\n\nMöchten Sie diesen Netzwerk-Share trotzdem hinzufügen?", + + "\n\nMöchten Sie diesen Netzlaufwerk trotzdem hinzufügen?", MessageType.QUESTION_YESNO, LOGGER, null)) { return; } |