Add option to login immediately, reduce latency by simplifying proxy.cgi

This commit is contained in:
Jamie Cameron
2011-04-27 15:16:39 -07:00
parent 520b6285aa
commit 79894dd2f5
4 changed files with 11 additions and 3 deletions

View File

@@ -1 +1,2 @@
autologin=0
timeout=120

View 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

View File

@@ -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);
}

View File

@@ -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);
}