Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#14882151 followup] additional Z39.50 tweaks:
- general Ajax fix for IE: send no cache HTTP header - general widgets tweak: removed search button, which wasn't easily aligned across browsers; prettify width of page jumper input box; send user to page 1 upon positive search results upon hitting [ENTER] (no redirect if paging or sorting even if we have search matches) - Z39.50 Servers Administration: commented out Rank; select MARC21/USMARC by default on ADD; put magnifying glass icon on non-Yahoo button - Z39.50 Search: commented out button for adding new MARC; force sorting of errors to the bottom; allow skipping nonMarc such as errors; allow open search results in modal - modify query of C4::Session::Defaults::Items to not clash with Z39.50 usage - dupecheck unique Target Name for both ADD and EDIT - confirmation msg before target server delete - fix crushed text in hostname:port view for patron selected targets - one more case of no data: all errors
- Loading branch information
1 parent
3996af7
commit f4278f7
Showing
8 changed files
with
387 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env perl | ||
|
||
use Koha; | ||
use Plack::App::CGIBin; | ||
use Plack::Builder; | ||
use Koha::Plack::Util; | ||
|
||
my $root = $ENV{KOHA_BASE} // '.'; | ||
my $app = Plack::App::CGIBin->new(root => $root)->to_app; | ||
|
||
sub is_staff { | ||
my $hostname = Koha::Plack::Util::GetCanonicalHostname(shift); | ||
if ($ENV{KOHA_STAFF}) { return 1 } # for VPN with only IP | ||
return $hostname =~ /-staff\./; | ||
} | ||
|
||
use Koha::Squatting::Reserve 'On::PSGI'; | ||
use Koha::Squatting::Z3950 'On::PSGI'; | ||
Koha::Squatting::Reserve->init; | ||
Koha::Squatting::Z3950->init; | ||
|
||
|
||
builder { | ||
enable_if { $_[0]->{REMOTE_ADDR} eq '127.0.0.1' } | ||
'Plack::Middleware::ReverseProxy'; | ||
|
||
enable 'Deflater'; | ||
enable 'HTTPExceptions'; | ||
enable 'MethodOverride'; | ||
|
||
enable 'Static', path => qr{^/opac-tmpl/}, root => "$root/koha-tmpl/"; | ||
enable 'Static', path => qr{^/intranet-tmpl/}, root => "$root/koha-tmpl/"; | ||
|
||
enable 'Status', path => qr{/C4/|/Koha/|/misc/|/t/|/xt/|/etc/}, status => 404; | ||
enable 'Rewrite', rules => sub { | ||
my $env = shift; | ||
return 302 if (is_staff($env) && s{^/$}{/cgi-bin/koha/mainpage.pl}); | ||
return 302 if (!is_staff($env) && s{^/$}{/cgi-bin/koha/opac-main.pl}); | ||
if (!is_staff($env)) { s{^/cgi-bin/koha/}{/cgi-bin/koha/opac/}} | ||
return; | ||
}; | ||
enable 'Header', unset => ['Status']; | ||
enable '+Koha::Plack::Localize'; | ||
mount '/reserves/' => sub {Koha::Squatting::Reserve->psgi(shift)}; | ||
mount '/z3950/' => sub {Koha::Squatting::Z3950->psgi(shift)}; | ||
mount '/cgi-bin/koha/' => $app; | ||
}; |
Oops, something went wrong.