Add option to login immediately, reduce latency by simplifying proxy.cgi
authorJamie Cameron <jcameron@webmin.com>
Wed, 27 Apr 2011 22:16:39 +0000 (15:16 -0700)
committerJamie Cameron <jcameron@webmin.com>
Wed, 27 Apr 2011 22:16:39 +0000 (15:16 -0700)
ajaxterm/config
ajaxterm/config.info
ajaxterm/index.cgi
ajaxterm/proxy.cgi

index 6091b45..a31edab 100644 (file)
@@ -1 +1,2 @@
+autologin=0
 timeout=120
index 7472cef..e70c333 100644 (file)
@@ -1 +1,2 @@
+autologin=Login mode,1,0-Prompt for username and password,1-Open root shell
 timeout=Idle timeout before closing connection,0,5,,seconds
index 45a0ef9..b5d731c 100755 (executable)
@@ -36,7 +36,10 @@ if (!$pid) {
        untie(*STDIN); open(STDIN, "</dev/null");
        untie(*STDOUT); open(STDOUT, ">$logfile");
        untie(*STDERR); open(STDERR, ">$logfile");
-       exec($python, "ajaxterm.py", "--port", $port, "--log");
+       $shell = &has_command("bash") ||
+                &has_command("sh") || "/bin/sh";
+       exec($python, "ajaxterm.py", "--port", $port, "--log",
+            $config{'autologin'} ? ("--command", $shell) : ( ));
        exit(1);
        }
 
index 02377a3..29dc31d 100755 (executable)
@@ -3,7 +3,10 @@
 
 BEGIN { push(@INC, ".."); };
 use WebminCore;
-&init_config();
+
+# Since this script is run on every keypress, init_config is intentionally
+# not called to reduce startup time.
+#&init_config();
 
 # Parse out port
 $ENV{'PATH_INFO'} =~ /^\/(\d+)(.*)$/ ||
@@ -46,7 +49,7 @@ while($buf = &read_http_connection($con, 1024)) {
 &close_http_connection($con);
 
 # Touch status file to indicate it is still running
-$statusdir = $ENV{'WEBMIN_VAR'}."/".$module_name;
+$statusdir = $ENV{'WEBMIN_VAR'}."/ajaxterm";
 if (!-d $statusdir) {
        &make_dir($statusdir, 0700);
        }