View | Details | Raw Unified | Return to bug 15816
Collapse All | Expand All

(-)a/C4/Auth.pm (-1 / +23 lines)
Lines 192-198 sub get_template_and_user { Link Here
192
                -HttpOnly => 1,
192
                -HttpOnly => 1,
193
            );
193
            );
194
194
195
            $template->param( loginprompt => 1 );
195
            $template->param(
196
                loginprompt => 1,
197
                script_name => _get_script_name(),
198
            );
196
            print $in->{query}->header(
199
            print $in->{query}->header(
197
                {   type              => 'text/html',
200
                {   type              => 'text/html',
198
                    charset           => 'utf-8',
201
                    charset           => 'utf-8',
Lines 1208-1213 sub checkauth { Link Here
1208
        opaclayoutstylesheet                  => C4::Context->preference("opaclayoutstylesheet"),
1211
        opaclayoutstylesheet                  => C4::Context->preference("opaclayoutstylesheet"),
1209
        login                                 => 1,
1212
        login                                 => 1,
1210
        INPUTS                                => \@inputs,
1213
        INPUTS                                => \@inputs,
1214
        script_name                           => _get_script_name(),
1211
        casAuthentication                     => C4::Context->preference("casAuthentication"),
1215
        casAuthentication                     => C4::Context->preference("casAuthentication"),
1212
        shibbolethAuthentication              => $shib,
1216
        shibbolethAuthentication              => $shib,
1213
        SessionRestrictionByIP                => C4::Context->preference("SessionRestrictionByIP"),
1217
        SessionRestrictionByIP                => C4::Context->preference("SessionRestrictionByIP"),
Lines 2041-2046 sub getborrowernumber { Link Here
2041
    return 0;
2045
    return 0;
2042
}
2046
}
2043
2047
2048
=head2 _get_script_name
2049
2050
This returns the correct script name, for use in redirecting back to the correct page after showing
2051
the login screen. It depends on details of the package Plack configuration, and should not be used
2052
outside this context.
2053
2054
=cut
2055
2056
sub _get_script_name {
2057
    # This is the method about.pl uses to detect Plack; now that two places use it, it MUST be
2058
    # right.
2059
    if ( ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) && $ENV{SCRIPT_NAME} =~ m,^/(intranet|opac)(.*), ) {
2060
        return '/cgi-bin/koha' . $2;
2061
    } else {
2062
        return $ENV{SCRIPT_NAME};
2063
    }
2064
}
2065
2044
END { }    # module clean-up code here (global destructor)
2066
END { }    # module clean-up code here (global destructor)
2045
1;
2067
1;
2046
__END__
2068
__END__
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt (-1 / +1 lines)
Lines 40-46 Link Here
40
[% END %]
40
[% END %]
41
41
42
<!-- login prompt time-->
42
<!-- login prompt time-->
43
<form action="/cgi-bin/koha/mainpage.pl" method="post" name="loginform" id="loginform">
43
<form action="[% script_name %]" method="post" name="loginform" id="loginform">
44
    <input type="hidden" name="koha_login_context" value="intranet" />
44
    <input type="hidden" name="koha_login_context" value="intranet" />
45
[% FOREACH INPUT IN INPUTS %]
45
[% FOREACH INPUT IN INPUTS %]
46
    <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]" />
46
    <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]" />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt (-2 / +1 lines)
Lines 155-161 Link Here
155
                            [% IF SCO_login %]
155
                            [% IF SCO_login %]
156
                                <form action="/cgi-bin/koha/sco/sco-main.pl" name="auth" id="auth" method="post">
156
                                <form action="/cgi-bin/koha/sco/sco-main.pl" name="auth" id="auth" method="post">
157
                            [% ELSE %]
157
                            [% ELSE %]
158
                                <form action="/cgi-bin/koha/opac-user.pl" name="auth" id="auth" method="post">
158
                                <form action="[% script_name %]" name="auth" id="auth" method="post">
159
                            [% END %]
159
                            [% END %]
160
                                <input type="hidden" name="koha_login_context" value="opac" />
160
                                <input type="hidden" name="koha_login_context" value="opac" />
161
                                <fieldset class="brief">
161
                                <fieldset class="brief">
162
- 

Return to bug 15816