Move webserver options to new page

This commit is contained in:
Jamie Cameron
2011-05-01 21:59:29 -07:00
parent ed9deeeeb4
commit 194723a43b
9 changed files with 105 additions and 40 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -105,3 +105,4 @@ Strong PCI-compliant ciphers can now be selected on the SSL Encryption page.
Added the Sending Email page which controls how Webmin itself sends messages.
---- Changes since 1.550 ----
Added fields to the Index Page Options page to control the display of Webmin and module updates.
Moved settings related to Webmin's built-in webserver to the new Web Server Options page.

View File

@@ -36,12 +36,6 @@ for($i=0; defined($tmod = $in{'tmod_'.$i}); $i++) {
}
&save_tempdirs(\%gconfig, \@tdirs);
# Save stack trace option
$gconfig{'error_stack'} = $in{'stack'};
# Save showing of stderr
$miniserv{'noshowstderr'} = !$in{'showstderr'};
# Save umask
if ($in{'umask_def'}) {
delete($gconfig{'umask'});
@@ -97,16 +91,6 @@ else {
$miniserv{'precache'} = $in{'precache'};
}
# Save password pass option
$miniserv{'pass_password'} = $in{'pass'};
# Save gzip option
if ($in{'gzip'} == 1) {
eval "use Compress::Zlib";
$@ && &error(&text('advanced_egzip', '<tt>Compress::Zlib</tt>'));
}
$miniserv{'gzip'} = $in{'gzip'};
&lock_file($ENV{'MINISERV_CONFIG'});
&put_miniserv_config(\%miniserv);
&unlock_file($ENV{'MINISERV_CONFIG'});

49
webmin/change_web.cgi Executable file
View File

@@ -0,0 +1,49 @@
#!/usr/local/bin/perl
# Save webserver options
require './webmin-lib.pl';
&ReadParse();
&error_setup($text{'web_err'});
&get_miniserv_config(\%miniserv);
# Save expires
if ($in{'expires_def'}) {
delete($miniserv{'expires'});
}
else {
$in{'expires'} =~ /^\d+$/ ||
&error($text{'web_eexpires'});
$miniserv{'expires'} = $in{'expires'};
}
# Save stack trace option
$gconfig{'error_stack'} = $in{'stack'};
# Save showing of stderr
$miniserv{'noshowstderr'} = !$in{'showstderr'};
if (!$miniserv{'session'}) {
# Save password pass option
$miniserv{'pass_password'} = $in{'pass'};
}
# Save gzip option
if ($in{'gzip'} == 1) {
eval "use Compress::Zlib";
$@ && &error(&text('advanced_egzip', '<tt>Compress::Zlib</tt>'));
}
$miniserv{'gzip'} = $in{'gzip'};
# Save global config
&lock_file("$config_directory/config");
&write_file("$config_directory/config", \%gconfig);
&unlock_file("$config_directory/config");
# Save miniserv config
&lock_file($ENV{'MINISERV_CONFIG'});
&put_miniserv_config(\%miniserv);
&unlock_file($ENV{'MINISERV_CONFIG'});
&show_restart_page();
&webmin_log("web");

View File

@@ -63,18 +63,6 @@ print &ui_table_row($text{'advanced_precache'},
&ui_textbox("precache",
$mode == 2 ? $miniserv{'precache'} : "", 40)) ] ]));
# Show call stack on error
print &ui_table_row($text{'advanced_stack'},
&ui_yesno_radio("stack", int($gconfig{'error_stack'})));
# Show CGI errors
print &ui_table_row($text{'advanced_showstderr'},
&ui_yesno_radio("showstderr", int(!$miniserv{'noshowstderr'})));
# Pass passwords to CGI programs
print &ui_table_row($text{'advanced_pass'},
&ui_yesno_radio("pass", int($miniserv{'pass_password'})));
# Umask for created files
print &ui_table_row($text{'advanced_umask'},
&ui_opt_textbox("umask", $gconfig{'umask'}, 5, $text{'default'}));
@@ -110,13 +98,6 @@ if (&foreign_check("proc")) {
}
}
# Gzip static files?
print &ui_table_row($text{'advanced_gzip'},
&ui_radio("gzip", $miniserv{'gzip'},
[ [ '', $text{'advanced_gzipauto'} ],
[ 0, $text{'advanced_gzip0'} ],
[ 1, $text{'advanced_gzip1'} ] ]));
print &ui_table_end();
print &ui_form_end([ [ "save", $text{'save'} ] ]);

41
webmin/edit_web.cgi Executable file
View File

@@ -0,0 +1,41 @@
#!/usr/local/bin/perl
# Show the web serving options form
require './webmin-lib.pl';
&ui_print_header(undef, $text{'web_title'}, "");
&get_miniserv_config(\%miniserv);
print &ui_form_start("change_web.cgi", "post");
print &ui_table_start($text{'web_header'}, undef, 2);
# Default content expiry time
print &ui_table_row($text{'web_expires'},
&ui_opt_textbox("expires", $miniserv{'expires'}, 10,
$text{'web_expiresdef'}, $text{'web_expiressecs'}));
# Show call stack on error
print &ui_table_row($text{'advanced_stack'},
&ui_yesno_radio("stack", int($gconfig{'error_stack'})));
# Show CGI errors
print &ui_table_row($text{'advanced_showstderr'},
&ui_yesno_radio("showstderr", int(!$miniserv{'noshowstderr'})));
if (!$miniserv{'session'}) {
# Pass passwords to CGI programs
print &ui_table_row($text{'advanced_pass'},
&ui_yesno_radio("pass", int($miniserv{'pass_password'})));
}
# Gzip static files?
print &ui_table_row($text{'advanced_gzip'},
&ui_radio("gzip", $miniserv{'gzip'},
[ [ '', $text{'advanced_gzipauto'} ],
[ 0, $text{'advanced_gzip0'} ],
[ 1, $text{'advanced_gzip1'} ] ]));
print &ui_table_end();
print &ui_form_end([ [ "save", $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});

BIN
webmin/images/web.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

View File

@@ -20,7 +20,7 @@ my (@wlinks, @wtitles, @wicons);
"edit_categories.cgi", "edit_descs.cgi", "edit_themes.cgi",
"edit_referers.cgi", "edit_anon.cgi", "edit_lock.cgi",
"edit_mobile.cgi", "edit_blocked.cgi", "edit_status.cgi",
"edit_advanced.cgi", "edit_debug.cgi" );
"edit_advanced.cgi", "edit_debug.cgi", "edit_web.cgi", );
@wtitles = ( $text{'access_title'}, $text{'bind_title'},
$text{'log_title'}, $text{'proxy_title'},
$text{'ui_title'}, $text{'mods_title'},
@@ -32,7 +32,7 @@ my (@wlinks, @wtitles, @wicons);
$text{'anon_title'}, $text{'lock_title'},
$text{'mobile_title'}, $text{'blocked_title'},
$text{'status_title'}, $text{'advanced_title'},
$text{'debug_title'}, );
$text{'debug_title'}, $text{'web_title'}, );
@wicons = ( "images/access.gif", "images/bind.gif", "images/log.gif",
"images/proxy.gif", "images/ui.gif", "images/mods.gif",
"images/os.gif", "images/lang.gif", "images/startpage.gif",
@@ -41,7 +41,7 @@ my (@wlinks, @wtitles, @wicons);
"images/descs.gif", "images/themes.gif", "images/referers.gif",
"images/anon.gif", "images/lock.gif", "images/mobile.gif",
"images/blocked.gif", "images/status.gif",
"images/advanced.gif", "images/debug.gif" );
"images/advanced.gif", "images/debug.gif", "images/web.gif", );
if ($gconfig{'eazel'}) {
push(@wlinks, "edit_syslet.cgi");
push(@wtitles, $text{'syslet_title'});

View File

@@ -617,6 +617,7 @@ log_theme_def=Changed theme to Webmin default
log_referers=Changed trusted referrers
log_descs=Changed module titles
log_advanced=Changed advanced options
log_web=Changed web server options
log_osdnclear=Cleared download cache
log_savekey=Uploaded existing SSL key
log_deletecache=Deleted $1 URLs from cache
@@ -798,9 +799,9 @@ advanced_pri=Priority level
advanced_sclass=IO class for scheduled jobs
advanced_sprio=IO priority for scheduled jobs
advanced_gzip=Gzip compress static files?
advanced_gzipauto=Only pre-compressed .gz file exists
advanced_gzipauto=Only if pre-compressed .gz file exists
advanced_gzip0=Never
advanced_gzip1=Use pre-compressed file or compress dynamically
advanced_gzip1=Use pre-compressed file and compress dynamically
advanced_egzip=Gzip compression cannot be enabled unless the $1 perl module is installed
syslog_errorlog=Webmin error log
@@ -929,4 +930,12 @@ sendmail_esmtp=Missing or un-resolvable SMTP server hostname
sendmail_elogin=Missing SMTP server login
sendmail_efrom=Missing or incorrectly formatted from address
web_title=Web Server Options
web_header=Options for Webmin's built-in webserver
web_expires=Client-side cache time for static files
web_expiresdef=Webmin default (7 days)
web_expiressecs=Time in seconds
web_err=Failed to save web server options
web_eexpires=Missing or non-numeric client size cache time
__norefs=1