mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Option to change redirects to use just a path
This commit is contained in:
@@ -1232,14 +1232,29 @@ if ($_[0] =~ /^(http|https|ftp|gopher):/) {
|
||||
}
|
||||
elsif ($_[0] =~ /^\//) {
|
||||
# Absolute path (like /foo/bar.cgi)
|
||||
$url = "$prot://$ENV{'SERVER_NAME'}$port$wp$_[0]";
|
||||
if ($gconfig{'relative_redir'}) {
|
||||
$url = "$wp$_[0]";
|
||||
}
|
||||
else {
|
||||
$url = "$prot://$ENV{'SERVER_NAME'}$port$wp$_[0]";
|
||||
}
|
||||
}
|
||||
elsif ($ENV{'SCRIPT_NAME'} =~ /^(.*)\/[^\/]*$/) {
|
||||
# Relative URL (like foo.cgi)
|
||||
$url = "$prot://$ENV{'SERVER_NAME'}$port$wp$1/$_[0]";
|
||||
if ($gconfig{'relative_redir'}) {
|
||||
$url = "$wp$1/$_[0]";
|
||||
}
|
||||
else {
|
||||
$url = "$prot://$ENV{'SERVER_NAME'}$port$wp$1/$_[0]";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$url = "$prot://$ENV{'SERVER_NAME'}$port/$wp$_[0]";
|
||||
if ($gconfig{'relative_redir'}) {
|
||||
$url = "$wp$_[0]";
|
||||
}
|
||||
else {
|
||||
$url = "$prot://$ENV{'SERVER_NAME'}$port/$wp$_[0]";
|
||||
}
|
||||
}
|
||||
&load_theme_library();
|
||||
if (defined(&theme_redirect)) {
|
||||
|
||||
@@ -116,3 +116,5 @@ The titles for existing clone modules can now be changed on the Module Titles pa
|
||||
---- Changes since 1.610 ----
|
||||
Added a page for viewing and running Webmin scheduled functions.
|
||||
Added a section to the Sending Email page to verify that the configured mail server settings work.
|
||||
---- Changes since 1.620 ----
|
||||
Added a setting to the Web Server Options page to control if redirects use just a path, or the full URL.
|
||||
|
||||
@@ -44,6 +44,9 @@ if ($in{'gzip'} == 1) {
|
||||
}
|
||||
$miniserv{'gzip'} = $in{'gzip'};
|
||||
|
||||
# Save redirect type
|
||||
$gconfig{'relative_redir'} = $in{'redir'};
|
||||
|
||||
# Save global config
|
||||
&lock_file("$config_directory/config");
|
||||
&write_file("$config_directory/config", \%gconfig);
|
||||
|
||||
@@ -54,6 +54,12 @@ print &ui_table_row($text{'advanced_gzip'},
|
||||
[ 0, $text{'advanced_gzip0'} ],
|
||||
[ 1, $text{'advanced_gzip1'} ] ]));
|
||||
|
||||
# Redirect type
|
||||
print &ui_table_row($text{'advanced_redir'},
|
||||
&ui_radio("redir", $gconfig{'relative_redir'} ? 1 : 0,
|
||||
[ [ 1, $text{'advanced_redir1'} ],
|
||||
[ 0, $text{'advanced_redir0'} ] ]));
|
||||
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ "save", $text{'save'} ] ]);
|
||||
|
||||
|
||||
@@ -830,6 +830,9 @@ advanced_gzipauto=Only if pre-compressed .gz file exists
|
||||
advanced_gzip0=Never
|
||||
advanced_gzip1=Use pre-compressed file and compress dynamically
|
||||
advanced_egzip=Gzip compression cannot be enabled unless the $1 perl module is installed
|
||||
advanced_redir=URL format for redirects
|
||||
advanced_redir1=Path only
|
||||
advanced_redir0=Protocol, host, port and path
|
||||
|
||||
syslog_errorlog=Webmin error log
|
||||
|
||||
|
||||
Reference in New Issue
Block a user