Checkin VNC module
authorJamie Cameron <jcameron@webmin.com>
Sun, 30 Sep 2007 19:59:06 +0000 (19:59 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sun, 30 Sep 2007 19:59:06 +0000 (19:59 +0000)
19 files changed:
vnc/config [new file with mode: 0644]
vnc/config.info [new file with mode: 0644]
vnc/config.info.sk [new file with mode: 0644]
vnc/config.info.zh_TW.Big5 [new file with mode: 0644]
vnc/config.info.zh_TW.UTF-8 [new file with mode: 0644]
vnc/images/icon.gif [new file with mode: 0644]
vnc/images/smallicon.gif [new file with mode: 0644]
vnc/index.cgi [new file with mode: 0755]
vnc/lang/en [new file with mode: 0644]
vnc/lang/ja_JP.UTF-8 [new file with mode: 0644]
vnc/lang/ja_JP.euc [new file with mode: 0644]
vnc/lang/ko_KR.UTF-8 [new file with mode: 0644]
vnc/lang/ko_KR.euc [new file with mode: 0644]
vnc/lang/sk [new file with mode: 0644]
vnc/lang/zh_TW.Big5 [new file with mode: 0644]
vnc/lang/zh_TW.UTF-8 [new file with mode: 0644]
vnc/module.info [new file with mode: 0644]
vnc/shared.vnc [new file with mode: 0644]
vnc/vncviewer.jar [new file with mode: 0644]

diff --git a/vnc/config b/vnc/config
new file mode 100644 (file)
index 0000000..fd5b4b6
--- /dev/null
@@ -0,0 +1,3 @@
+port=5901
+width=800
+height=600
diff --git a/vnc/config.info b/vnc/config.info
new file mode 100644 (file)
index 0000000..ae7dae8
--- /dev/null
@@ -0,0 +1,5 @@
+port=Port to connect to,0
+host=Host to connect to,3,Webmin server
+width=Applet width,0
+height=Applet height,0
+program=X application to connect to,3,Normal VNC server
diff --git a/vnc/config.info.sk b/vnc/config.info.sk
new file mode 100644 (file)
index 0000000..cd89e71
--- /dev/null
@@ -0,0 +1,4 @@
+port=Port na spojenie,0
+host=Kam sa pripoji»,3,Webmin server
+width=©írka appletu,0
+height=Vý¹ka appletu,0
diff --git a/vnc/config.info.zh_TW.Big5 b/vnc/config.info.zh_TW.Big5
new file mode 100644 (file)
index 0000000..7dfa525
--- /dev/null
@@ -0,0 +1,3 @@
+port=­n³s±µªº³q°T°ð,0
+width=Applet ¼e«×,0
+height=Applet °ª«×,0
diff --git a/vnc/config.info.zh_TW.UTF-8 b/vnc/config.info.zh_TW.UTF-8
new file mode 100644 (file)
index 0000000..a1d77cf
--- /dev/null
@@ -0,0 +1,3 @@
+height=Applet 高度,0
+port=要連接的通訊埠,0
+width=Applet 寬度,0
diff --git a/vnc/images/icon.gif b/vnc/images/icon.gif
new file mode 100644 (file)
index 0000000..45cbe61
Binary files /dev/null and b/vnc/images/icon.gif differ
diff --git a/vnc/images/smallicon.gif b/vnc/images/smallicon.gif
new file mode 100644 (file)
index 0000000..5258e8a
Binary files /dev/null and b/vnc/images/smallicon.gif differ
diff --git a/vnc/index.cgi b/vnc/index.cgi
new file mode 100755 (executable)
index 0000000..26628e2
--- /dev/null
@@ -0,0 +1,94 @@
+#!/usr/local/bin/perl
+# index.cgi
+# Display the vnc applet
+
+require '../web-lib.pl';
+use Socket;
+&init_config();
+&header($text{'index_title'}, "", undef, &get_product_name() eq 'webmin', 1);
+print "<hr>\n";
+
+if ($config{'program'}) {
+       # Check if Xvnc is installed
+       if (!&has_command("Xvnc")) {
+               &error_exit(&text('index_ecmd', "<tt>Xvnc</tt>"));
+               }
+
+       # Pick a free VNC number
+       for($num=1; $num<1000; $num++) {
+               $port = 5900+$num;
+               last;
+               # XXX need to test
+               }
+
+       # Generate a password using vncpasswd
+       # XXX
+
+       # Start Xvnc in a background process, and kill it after one client
+       if (!fork()) {
+               close(STDIN);
+               close(STDOUT);
+               local $pid = open(VNC, "Xvnc :$num 2>&1 |");
+               while(<VNC>) {
+                       if (/Client\s+(\S+)\s+gone/i) {
+                               kill(TERM, $pid);
+                               last;
+                               }
+                       }
+               close(VNC);
+               exit;
+               }
+
+       # Run the specified program, using the selected display
+       $ENV{'DISPLAY'} = "localhost:$num";
+       system("$config{'program'} >/dev/null 2>&1 </dev/null &");
+
+       # XXX what about security?
+       # XXX how to ensure exit?       -rfbwait
+       # XXX what about window manager? or none?
+       # XXX what user to run program as? need option for current user
+       # XXX need to generate random password, and pass to java
+       }
+else {
+       $addr = $config{'host'} ? $config{'host'} :
+               $ENV{'SERVER_NAME'} ? $ENV{'SERVER_NAME'} :
+                                     &to_ipaddress(&get_system_hostname());
+       socket(STEST, PF_INET, SOCK_STREAM, getprotobyname("tcp"));
+       $SIG{ALRM} = "connect_timeout";
+       alarm(10);
+       $rv = connect(STEST, pack_sockaddr_in($config{'port'}, inet_aton($addr)));
+       close(STEST);
+       $rv || &error_exit(&text('index_esocket', $addr, $config{'port'}));
+       $port = $config{'port'};
+       }
+
+if ($ENV{'HTTPS'} eq 'ON') {
+       print "<center><font color=#ff0000>$text{'index_warn'}",
+             "</font></center><br>\n";
+       }
+
+print "<center><applet archive=vncviewer.jar code=vncviewer.class ",
+      "width=$config{'width'} height=$config{'height'}>\n";
+print "<param name=port value='$port'>\n";
+if ($config{'host'}) {
+       print "<param name=host value='$config{'host'}'>\n";
+       }
+print "$text{'index_nojava'} <p>\n";
+print "</applet><br>\n";
+print "$text{'index_credits'}</center>\n";
+
+print "<hr>\n";
+&footer("/", $text{'index'});
+
+sub connect_timeout
+{
+}
+
+sub error_exit
+{
+print "<p>",@_,"<p>\n";
+print "<hr>\n";
+&footer("/", $text{'index'});
+exit;
+}
+
diff --git a/vnc/lang/en b/vnc/lang/en
new file mode 100644 (file)
index 0000000..4a52020
--- /dev/null
@@ -0,0 +1,6 @@
+index_title=VNC Client
+index_warn=Warning! This VNC session is <b>not</b> encrypted.
+index_nojava=This module requires java to function, but your browser does not support java
+index_credits=VNC client applet created by AT&amp;T. See <a href=http://www.uk.research.att.com/vnc>http://www.uk.research.att.com/vnc</a> for more information.
+index_esocket=There is no VNC server running on $1 port $2.
+index_ecmd=The VNC server program $1 needed for running a specific program is not installed.
diff --git a/vnc/lang/ja_JP.UTF-8 b/vnc/lang/ja_JP.UTF-8
new file mode 100644 (file)
index 0000000..644d9ee
--- /dev/null
@@ -0,0 +1,5 @@
+index_title=VNC クライアント
+index_warn=警告この VNC セッションは<b>暗号化されていません</b>。
+index_nojava=このモジュールは動作するのに Java を必要としますが、ご使用のブラウザは Java をサポートしていません
+index_credits=VNC クライアント アプレットは AT&amp;T により作成されました。詳細は <a href=http://www.uk.research.att.com/vnc>http://www.uk.research.att.com/vnc</a> をご覧ください。
+index_esocket=$1 ポート $2 上で実行中の VNC サーバはありません。
diff --git a/vnc/lang/ja_JP.euc b/vnc/lang/ja_JP.euc
new file mode 100644 (file)
index 0000000..1c0e274
--- /dev/null
@@ -0,0 +1,5 @@
+index_title=VNC ¥¯¥é¥¤¥¢¥ó¥È
+index_warn=·Ù¹ð¤³¤Î VNC ¥»¥Ã¥·¥ç¥ó¤Ï<b>°Å¹æ²½¤µ¤ì¤Æ¤¤¤Þ¤»¤ó</b>¡£
+index_nojava=¤³¤Î¥â¥¸¥å¡¼¥ë¤ÏÆ°ºî¤¹¤ë¤Î¤Ë Java ¤òɬÍפȤ·¤Þ¤¹¤¬¡¢¤´»ÈÍѤΥ֥饦¥¶¤Ï Java ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó
+index_credits=VNC ¥¯¥é¥¤¥¢¥ó¥È ¥¢¥×¥ì¥Ã¥È¤Ï AT&amp;T ¤Ë¤è¤êºîÀ®¤µ¤ì¤Þ¤·¤¿¡£¾ÜºÙ¤Ï <a href=http://www.uk.research.att.com/vnc>http://www.uk.research.att.com/vnc</a> ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£
+index_esocket=$1 ¥Ý¡¼¥È $2 ¾å¤Ç¼Â¹ÔÃæ¤Î VNC ¥µ¡¼¥Ð¤Ï¤¢¤ê¤Þ¤»¤ó¡£
diff --git a/vnc/lang/ko_KR.UTF-8 b/vnc/lang/ko_KR.UTF-8
new file mode 100644 (file)
index 0000000..8473b22
--- /dev/null
@@ -0,0 +1,5 @@
+index_title=VNC 適虞戚情闘
+index_warn=井壱! 戚 VNC 室芝精 章硲鉢鞠走 <b>省紹柔艦陥</b>.
+index_nojava=戚 乞汲精 切郊人 敗臆 紫遂背醤 馬走幻 薄仙 崎虞酔煽拭辞澗 切郊研 走据馬走 省柔艦陥.  
+index_credits=AT&T拭辞 拙失廃 VNC 適虞戚情闘 蕉巴鹸脊艦陥.  切室廃 鎧遂精 <a href=http://www.uk.research.att.com/vnc>http://www.uk.research.att.com/vnc</a>研 凧繕馬淑獣神.
+index_esocket= $1 匂闘 $2聖(研) 叔楳 掻昔 VNC 辞獄亜 蒸柔艦陥.
diff --git a/vnc/lang/ko_KR.euc b/vnc/lang/ko_KR.euc
new file mode 100644 (file)
index 0000000..1e865ee
--- /dev/null
@@ -0,0 +1,5 @@
+index_title=VNC Å¬¶óÀ̾ðÆ®
+index_warn=°æ°í! ÀÌ VNC ¼¼¼ÇÀº ¾ÏȣȭµÇÁö <b>¾Ê¾Ò½À´Ï´Ù</b>.
+index_nojava=ÀÌ ¸ðµâÀº ÀÚ¹Ù¿Í ÇÔ²² »ç¿ëÇؾߠÇÏÁö¸¸ ÇöÀç ºê¶ó¿ìÀú¿¡¼­´Â ÀÚ¹Ù¸¦ Áö¿øÇÏÁö ¾Ê½À´Ï´Ù.  
+index_credits=AT&T¿¡¼­ ÀÛ¼ºÇÑ VNC Å¬¶óÀ̾ðÆ® ¾ÖÇø´ÀÔ´Ï´Ù.  ÀÚ¼¼ÇÑ ³»¿ëÀº <a href=http://www.uk.research.att.com/vnc>http://www.uk.research.att.com/vnc</a>¸¦ ÂüÁ¶ÇϽʽÿÀ.
+index_esocket= $1 Æ÷Æ® $2À»(¸¦) ½ÇÇà ÁßÀΠVNC ¼­¹ö°¡ ¾ø½À´Ï´Ù.
diff --git a/vnc/lang/sk b/vnc/lang/sk
new file mode 100644 (file)
index 0000000..07286a6
--- /dev/null
@@ -0,0 +1,5 @@
+index_credits=VNC klientský applet vytvorený AT&amp;T. Viac informácií nájdete na <a href=http://www.uk.research.att.com/vnc>http://www.uk.research.att.com/vnc</a>
+index_esocket=Na $1 a porte $2 nebe¾í ¾iadny VNC server.
+index_nojava=Tento modul potrebuje pre svoje fungovanie Javu, no Vá¹ prehliadaè nepodporuje Javu.
+index_title=VNC klient
+index_warn=Upozornenie! Toto VNC spojenie <b>nie je</b> ¹ifrované.
diff --git a/vnc/lang/zh_TW.Big5 b/vnc/lang/zh_TW.Big5
new file mode 100644 (file)
index 0000000..037a13b
--- /dev/null
@@ -0,0 +1,4 @@
+index_title=VNC «È¤áºÝ
+index_warn=ĵ§i! ³o­Ó VNC ¤u§@¶¥¬q<b>¨S¦³</b>¸g¹L½s½X.
+index_nojava=³o­Ó¼Ò²Õ»Ý­n Java ¤~¯à¥¿±`¤u§@, ¦ý¬O±zªºÂsÄý¾¹¤£¤ä´© Java
+index_credits=VNC «È¤áºÝ¤pµ{¦¡ (applet) ¬O¥Ñ AT&amp;T ¼g§@. °Ñ¦Ò <a href=http://www.uk.research.att.com/vnc>http://www.uk.research.att.com/vnc</a> ¥H±o¨ì§ó¦h°T®§.
diff --git a/vnc/lang/zh_TW.UTF-8 b/vnc/lang/zh_TW.UTF-8
new file mode 100644 (file)
index 0000000..0db9551
--- /dev/null
@@ -0,0 +1,4 @@
+index_title=VNC 客戶端
+index_warn=警告! 這個 VNC 工作階段<b>沒有</b>經過編碼.
+index_nojava=這個模組需要 Java 才能正常工作, 但是您的瀏覽器不支援 Java
+index_credits=VNC 客戶端小程式 (applet) 是由 AT&amp;T 寫作. 參考 <a href=http://www.uk.research.att.com/vnc>http://www.uk.research.att.com/vnc</a> 以得到更多訊息.
diff --git a/vnc/module.info b/vnc/module.info
new file mode 100644 (file)
index 0000000..924de2a
--- /dev/null
@@ -0,0 +1,12 @@
+desc_zh_TW.Big5=VNC «È¤áºÝ
+desc=VNC Client
+name=VNCviewer
+desc_ko_KR.euc=VNC Å¬¶óÀ̾ðÆ®
+desc_ja_JP.euc=VNC ¥¯¥é¥¤¥¢¥ó¥È
+desc_sk=VNC klient
+version=1.1
+webmin=1
+usermin=1
+desc_zh_TW.UTF-8=VNC 客戶端
+desc_ja_JP.UTF-8=VNC クライアント
+desc_ko_KR.UTF-8=VNC 클라이언트
diff --git a/vnc/shared.vnc b/vnc/shared.vnc
new file mode 100644 (file)
index 0000000..7c31b53
--- /dev/null
@@ -0,0 +1,15 @@
+<!-- This is an example of how to set default options in the Java VNC viewer
+     applet - in this case the "Share Desktop" option is set to "Yes".  Any
+     option can be set by giving a parameter with the same name as the
+     option (spaces are important, but case isn't) -->
+
+<HTML>
+<TITLE>
+$USER's $DESKTOP desktop ($DISPLAY) [shared]
+</TITLE>
+<APPLET CODE=vncviewer.class ARCHIVE=vncviewer.jar
+        WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
+<param name=PORT value=$PORT>
+<param name="share desktop" value=yes>
+</APPLET>
+</HTML>
diff --git a/vnc/vncviewer.jar b/vnc/vncviewer.jar
new file mode 100644 (file)
index 0000000..6ded544
Binary files /dev/null and b/vnc/vncviewer.jar differ