summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver
diff options
context:
space:
mode:
authorJonathan Bauer2017-09-08 16:54:59 +0200
committerJonathan Bauer2017-09-08 16:54:59 +0200
commitc0cbc1b3cb20b6c86d917394bdffe9c15a74a54d (patch)
tree8343a06ad4c8f3d08c03d685b6c2456dcabf8d5b /dozentenmodulserver
parent[netshare] minor layout optimizations (diff)
downloadtutor-module-c0cbc1b3cb20b6c86d917394bdffe9c15a74a54d.tar.gz
tutor-module-c0cbc1b3cb20b6c86d917394bdffe9c15a74a54d.tar.xz
tutor-module-c0cbc1b3cb20b6c86d917394bdffe9c15a74a54d.zip
[client/server] support for mountpoint/displayname
Diffstat (limited to 'dozentenmodulserver')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebServer.java30
1 files changed, 21 insertions, 9 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebServer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebServer.java
index 0975a443..4e7a2508 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebServer.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/web/WebServer.java
@@ -202,22 +202,34 @@ public class WebServer extends NanoHTTPD {
} catch (SQLException e) {
return internalServerError();
}
- // TODO format expected from the client-side to
- // handle different types of login. Currently:
- // * no username, no password => use credentials of logged in user
- // * username and optional password => user-specified credentials
+ // openslx.exe expects shares in the following format
+ // <path> <letter> <shortcut> <username> <password>
+ // letter is either a drive letter for Windows VMs,
+ // or a mount point for Linux VMs.
StringBuilder sb = new StringBuilder();
if (!list.isEmpty()) {
for (NetShare share : list) {
sb.append(share.path);
+ sb.append('\t');
+ if (share.isSetMountpoint()) {
+ sb.append(share.mountpoint);
+ } else {
+ // mark missing mount point, run-virt
+ // should assign a random one
+ sb.append("#NO_MOUNT#");
+ }
+ sb.append('\t');
+ sb.append(share.displayname);
if (share.auth == NetShareAuth.LOGIN_USER) {
- // nothing to do
+ // TODO how to mark that it should use the logged in user's credentials
}
- if (share.auth == NetShareAuth.OTHER_USER) {
- sb.append(' ');
+ if (share.auth == NetShareAuth.OTHER_USER && share.isSetUsername()) {
+ sb.append('\t');
sb.append(share.username);
- sb.append(' ');
- sb.append(share.password); // TODO fixme
+ if (share.isSetPassword()) {
+ sb.append('\t');
+ sb.append(share.password); // TODO fixme
+ }
}
sb.append("\n");
}