Lines 32-38
use C4::Languages;
Link Here
|
32 |
use C4::Branch; # GetBranches |
32 |
use C4::Branch; # GetBranches |
33 |
use C4::Search::History; |
33 |
use C4::Search::History; |
34 |
use Koha; |
34 |
use Koha; |
35 |
use Koha::AuthUtils qw(hash_password); |
35 |
use Koha::AuthUtils qw(get_script_name hash_password); |
36 |
use Koha::LibraryCategories; |
36 |
use Koha::LibraryCategories; |
37 |
use Koha::Libraries; |
37 |
use Koha::Libraries; |
38 |
use POSIX qw/strftime/; |
38 |
use POSIX qw/strftime/; |
Lines 194-200
sub get_template_and_user {
Link Here
|
194 |
|
194 |
|
195 |
$template->param( |
195 |
$template->param( |
196 |
loginprompt => 1, |
196 |
loginprompt => 1, |
197 |
script_name => _get_script_name(), |
197 |
script_name => get_script_name(), |
198 |
); |
198 |
); |
199 |
print $in->{query}->header( |
199 |
print $in->{query}->header( |
200 |
{ type => 'text/html', |
200 |
{ type => 'text/html', |
Lines 1211-1217
sub checkauth {
Link Here
|
1211 |
opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"), |
1211 |
opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"), |
1212 |
login => 1, |
1212 |
login => 1, |
1213 |
INPUTS => \@inputs, |
1213 |
INPUTS => \@inputs, |
1214 |
script_name => _get_script_name(), |
1214 |
script_name => get_script_name(), |
1215 |
casAuthentication => C4::Context->preference("casAuthentication"), |
1215 |
casAuthentication => C4::Context->preference("casAuthentication"), |
1216 |
shibbolethAuthentication => $shib, |
1216 |
shibbolethAuthentication => $shib, |
1217 |
SessionRestrictionByIP => C4::Context->preference("SessionRestrictionByIP"), |
1217 |
SessionRestrictionByIP => C4::Context->preference("SessionRestrictionByIP"), |
Lines 2050-2073
sub getborrowernumber {
Link Here
|
2050 |
return 0; |
2050 |
return 0; |
2051 |
} |
2051 |
} |
2052 |
|
2052 |
|
2053 |
=head2 _get_script_name |
|
|
2054 |
|
2055 |
This returns the correct script name, for use in redirecting back to the correct page after showing |
2056 |
the login screen. It depends on details of the package Plack configuration, and should not be used |
2057 |
outside this context. |
2058 |
|
2059 |
=cut |
2060 |
|
2061 |
sub _get_script_name { |
2062 |
# This is the method about.pl uses to detect Plack; now that two places use it, it MUST be |
2063 |
# right. |
2064 |
if ( ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) && $ENV{SCRIPT_NAME} =~ m,^/(intranet|opac)(.*), ) { |
2065 |
return '/cgi-bin/koha' . $2; |
2066 |
} else { |
2067 |
return $ENV{SCRIPT_NAME}; |
2068 |
} |
2069 |
} |
2070 |
|
2071 |
END { } # module clean-up code here (global destructor) |
2053 |
END { } # module clean-up code here (global destructor) |
2072 |
1; |
2054 |
1; |
2073 |
__END__ |
2055 |
__END__ |