5
0
mirror of git://git.proxmox.com/git/vncterm.git synced 2024-12-22 21:33:49 +03:00
vncterm/tigerpatches/username-param.patch
2011-08-23 07:52:28 +02:00

39 lines
1.2 KiB
Diff

Index: new/java/src/com/tigervnc/vncviewer/VncViewer.java
===================================================================
--- new.orig/java/src/com/tigervnc/vncviewer/VncViewer.java 2011-01-28 13:26:51.000000000 +0100
+++ new/java/src/com/tigervnc/vncviewer/VncViewer.java 2011-01-28 13:27:04.000000000 +0100
@@ -86,6 +86,7 @@
String host;
int port;
String passwordParam;
+ String usernameParam;
boolean showControls;
boolean offerRelogin;
boolean showOfflineDesktop;
@@ -384,10 +385,12 @@
break;
case RfbProto.SecTypePlain:
showConnectionStatus("Plain authentication");
- {
- String user = askUser();
- String pw = askPassword();
- rfb.authenticatePlain(user,pw);
+ if (usernameParam != null && passwordParam != null) {
+ rfb.authenticatePlain(usernameParam, passwordParam);
+ } else {
+ String user = askUser();
+ String pw = askPassword();
+ rfb.authenticatePlain(user,pw);
}
break;
case RfbProto.SecTypeTLSNone:
@@ -822,6 +825,8 @@
// Read "ENCPASSWORD" or "PASSWORD" parameter if specified.
readPasswordParameters();
+ usernameParam = readParameter("USERNAME", false);
+
String str;
if (inAnApplet) {
str = readParameter("Open New Window", false);