Fix to support cross theme calls for forgotten form
This commit is contained in:
parent
c3545cf836
commit
9bfe56f127
@ -18,6 +18,13 @@ if ($gconfig{'forgot_pass'} && $ENV{'REQUEST_URI'}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Redirect to forgot form if return param is set from SPA theme
|
||||||
|
if ($gconfig{'forgot_pass'} && $ENV{'REQUEST_URI'} &&
|
||||||
|
$ENV{'REQUEST_URI'} =~ /[?&]return=(http?\S+)/) {
|
||||||
|
&redirect("@{[&get_webprefix()]}/forgot_form.cgi");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
# Login banner
|
# Login banner
|
||||||
if ($gconfig{'loginbanner'} && $ENV{'HTTP_COOKIE'} !~ /banner=1/ &&
|
if ($gconfig{'loginbanner'} && $ENV{'HTTP_COOKIE'} !~ /banner=1/ &&
|
||||||
!$in{'logout'} && $in{'initial'}) {
|
!$in{'logout'} && $in{'initial'}) {
|
||||||
|
@ -19,6 +19,13 @@ if ($gconfig{'forgot_pass'} && $ENV{'REQUEST_URI'}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Redirect to forgot form if return param is set from SPA theme
|
||||||
|
if ($gconfig{'forgot_pass'} && $ENV{'REQUEST_URI'} &&
|
||||||
|
$ENV{'REQUEST_URI'} =~ /[?&]return=(http?\S+)/) {
|
||||||
|
&redirect("@{[&get_webprefix()]}/forgot_form.cgi");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
# If accessed via HTTPS, make this an SSL-only cookie
|
# If accessed via HTTPS, make this an SSL-only cookie
|
||||||
&get_miniserv_config(\%miniserv);
|
&get_miniserv_config(\%miniserv);
|
||||||
$sec = uc($ENV{'HTTPS'}) eq 'ON' ? "; secure" : "";
|
$sec = uc($ENV{'HTTPS'}) eq 'ON' ? "; secure" : "";
|
||||||
@ -128,7 +135,15 @@ print &ui_form_end();
|
|||||||
if ($gconfig{'forgot_pass'}) {
|
if ($gconfig{'forgot_pass'}) {
|
||||||
# Show forgotten password link
|
# Show forgotten password link
|
||||||
my $link = &get_webmin_base_url();
|
my $link = &get_webmin_base_url();
|
||||||
print &ui_form_start("${link}forgot_form.cgi", "post");
|
my $param = '';
|
||||||
|
if ($link) {
|
||||||
|
my $src_link = ($ENV{'HTTPS'} eq 'ON'
|
||||||
|
? 'https'
|
||||||
|
: 'http').'://'.$ENV{'HTTP_HOST'};
|
||||||
|
$src_link .= ($gconfig{'webprefix'} || '')."/";
|
||||||
|
$param = "?return=".&urlize($src_link);
|
||||||
|
}
|
||||||
|
print &ui_form_start($link."forgot_form.cgi".$param, "post");
|
||||||
print &ui_hidden("failed", $in{'failed'});
|
print &ui_hidden("failed", $in{'failed'});
|
||||||
print &ui_form_end([ [ undef, $text{'session_forgot'} ] ]);
|
print &ui_form_end([ [ undef, $text{'session_forgot'} ] ]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user