Browse Source

bug 1803 - fix error page handling

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
3.0.x
Galen Charlton 14 years ago
committed by Joshua Ferraro
parent
commit
f53d084c00
  1. 10
      .htaccess
  2. 2
      Makefile.PL
  3. 0
      errors/400.pl
  4. 0
      errors/401.pl
  5. 0
      errors/402.pl
  6. 0
      errors/403.pl
  7. 0
      errors/404.pl
  8. 0
      errors/500.pl
  9. 13
      etc/koha-httpd.conf
  10. 29
      koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl
  11. 30
      koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl
  12. 29
      koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl
  13. 29
      koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl
  14. 29
      koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl
  15. 37
      opac/errors/400.pl
  16. 37
      opac/errors/401.pl
  17. 37
      opac/errors/402.pl
  18. 37
      opac/errors/403.pl
  19. 37
      opac/errors/404.pl
  20. 37
      opac/errors/500.pl

10
.htaccess

@ -1,9 +1,9 @@
# .htaccess
ErrorDocument 400 /cgi-bin/koha/koha-tmpl/errors/400.pl
ErrorDocument 401 /cgi-bin/koha/koha-tmpl/errors/401.pl
ErrorDocument 403 /cgi-bin/koha/koha-tmpl/errors/403.pl
ErrorDocument 404 /cgi-bin/koha/koha-tmpl/errors/404.pl
ErrorDocument 500 /cgi-bin/koha/koha-tmpl/errors/500.pl
ErrorDocument 400 /cgi-bin/koha/errors/400.pl
ErrorDocument 401 /cgi-bin/koha/errors/401.pl
ErrorDocument 403 /cgi-bin/koha/errors/403.pl
ErrorDocument 404 /cgi-bin/koha/errors/404.pl
ErrorDocument 500 /cgi-bin/koha/errors/500.pl

2
Makefile.PL

@ -250,7 +250,7 @@ my $target_map = {
'./help.pl' => 'INTRANET_CGI_DIR',
'./installer-CPAN.pl' => 'NONE',
'./installer' => 'INTRANET_CGI_DIR',
'./koha-tmpl/errors' => {target => 'INTRANET_CGI_DIR', trimdir => 2},
'./errors' => {target => 'INTRANET_CGI_DIR'},
'./koha-tmpl/intranet-tmpl' => {target => 'INTRANET_TMPL_DIR', trimdir => -1},
'./koha-tmpl/opac-tmpl' => {target => 'OPAC_TMPL_DIR', trimdir => -1},
'./kohaversion.pl' => 'INTRANET_CGI_DIR',

0
koha-tmpl/errors/400.pl → errors/400.pl

0
koha-tmpl/errors/401.pl → errors/401.pl

0
koha-tmpl/errors/402.pl → errors/402.pl

0
koha-tmpl/errors/403.pl → errors/403.pl

0
koha-tmpl/errors/404.pl → errors/404.pl

0
koha-tmpl/errors/500.pl → errors/500.pl

13
etc/koha-httpd.conf

@ -18,6 +18,12 @@
SetEnv PERL5LIB "__PERL_MODULE_DIR__"
Options +FollowSymLinks
ErrorDocument 400 /cgi-bin/koha/errors/400.pl
ErrorDocument 401 /cgi-bin/koha/errors/401.pl
ErrorDocument 403 /cgi-bin/koha/errors/403.pl
ErrorDocument 404 /cgi-bin/koha/errors/404.pl
ErrorDocument 500 /cgi-bin/koha/errors/500.pl
# Rewrite Rules
RewriteEngine On
@ -46,6 +52,13 @@
SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
SetEnv PERL5LIB "__PERL_MODULE_DIR__"
Options +FollowSymLinks
ErrorDocument 400 /cgi-bin/koha/errors/400.pl
ErrorDocument 401 /cgi-bin/koha/errors/401.pl
ErrorDocument 403 /cgi-bin/koha/errors/403.pl
ErrorDocument 404 /cgi-bin/koha/errors/404.pl
ErrorDocument 500 /cgi-bin/koha/errors/500.pl
RewriteEngine On
# Uncomment to turn on rewrite logging
# RewriteLog __LOG_DIR__/koha-intranet-rewrite.log

29
koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl

@ -0,0 +1,29 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; An Error Has Occurred
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
</head>
<body>
<!--TMPL_INCLUDE NAME="masthead.inc" -->
<!--TMPL_INCLUDE NAME="navigation.inc" -->
<div id="doc3" class="yui-t1">
<div id="bd">
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<h3>An Error has Occurred</h3>
<h4>Error 404</h4>
<ul>
<li>This error means that the Koha is pointed an invalid link.</li>
<li>To report this error, you can
<a href="mailto:<!-- TMPL_VAR NAME="admin" -->">email the Koha Administrator</a>.</li>
<li>Use top menu bar to navigate to another part of Koha.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- <div id="main"> -->
<!-- </div> -->
</body>
</html>

30
koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl

@ -0,0 +1,30 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; An Error Has Occurred
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
</head>
<body>
<!--TMPL_INCLUDE NAME="masthead.inc" -->
<!--TMPL_INCLUDE NAME="navigation.inc" -->
<div id="doc3" class="yui-t1">
<div id="bd">
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<h3>An Error has Occurred</h3>
<h4>Error 404</h4>
<ul>
<li>This error means that the you are trying to access a link that you're not authorized to see.</li>
<li>Try logging in to the catalog</li>
<li>To report this error, you can
<a href="mailto:<!-- TMPL_VAR NAME="admin" -->">email the Koha Administrator</a>.</li>
<li>Use top menu bar to navigate to another part of Koha.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- <div id="main"> -->
<!-- </div> -->
</body>
</html>

29
koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl

@ -0,0 +1,29 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; An Error Has Occurred
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
</head>
<body>
<!--TMPL_INCLUDE NAME="masthead.inc" -->
<!--TMPL_INCLUDE NAME="navigation.inc" -->
<div id="doc3" class="yui-t1">
<div id="bd">
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<h3>An Error has Occurred</h3>
<h4>Error 404</h4>
<ul>
<li>This error means that you are forbidden for some reason to see this page.</li>
<li>To report this error, you can
<a href="mailto:<!-- TMPL_VAR NAME="admin" -->">email the Koha Administrator</a>.</li>
<li>Use top menu bar to navigate to another part of Koha.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- <div id="main"> -->
<!-- </div> -->
</body>
</html>

29
koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl

@ -0,0 +1,29 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; An Error Has Occurred
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
</head>
<body>
<!--TMPL_INCLUDE NAME="masthead.inc" -->
<!--TMPL_INCLUDE NAME="navigation.inc" -->
<div id="doc3" class="yui-t1">
<div id="bd">
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<h3>An Error has Occurred</h3>
<h4>Error 404</h4>
<ul>
<li>This error means that the link was broken and that the page doesn't exist.</li>
<li>To report this error, you can
<a href="mailto:<!-- TMPL_VAR NAME="admin" -->">email the Koha Administrator</a>.</li>
<li>Use top menu bar to navigate to another part of Koha.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- <div id="main"> -->
<!-- </div> -->
</body>
</html>

29
koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl

@ -0,0 +1,29 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; An Error Has Occurred
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
</head>
<body>
<!--TMPL_INCLUDE NAME="masthead.inc" -->
<!--TMPL_INCLUDE NAME="navigation.inc" -->
<div id="doc3" class="yui-t1">
<div id="bd">
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<h3>An Error has Occurred</h3>
<h4>Error 404</h4>
<ul>
<li>An error occurred while try to process your request.</li>
<li>To report this error, you can
<a href="mailto:<!-- TMPL_VAR NAME="admin" -->">email the Koha Administrator</a>.</li>
<li>Use top menu bar to navigate to another part of Koha.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- <div id="main"> -->
<!-- </div> -->
</body>
</html>

37
opac/errors/400.pl

@ -0,0 +1,37 @@
#!/usr/bin/perl
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Context;
my $query = new CGI;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "errors/400.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
}
);
$template->param( admin => $admin );
output_html_with_http_headers $query, $cookie, $template->output;

37
opac/errors/401.pl

@ -0,0 +1,37 @@
#!/usr/bin/perl
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Context;
my $query = new CGI;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "errors/401.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
}
);
$template->param( admin => $admin );
output_html_with_http_headers $query, $cookie, $template->output;

37
opac/errors/402.pl

@ -0,0 +1,37 @@
#!/usr/bin/perl
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Context;
my $query = new CGI;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "errors/402.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
}
);
$template->param( admin => $admin );
output_html_with_http_headers $query, $cookie, $template->output;

37
opac/errors/403.pl

@ -0,0 +1,37 @@
#!/usr/bin/perl
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Context;
my $query = new CGI;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "errors/403.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
}
);
$template->param( admin => $admin );
output_html_with_http_headers $query, $cookie, $template->output;

37
opac/errors/404.pl

@ -0,0 +1,37 @@
#!/usr/bin/perl
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Context;
my $query = new CGI;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "errors/404.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
}
);
$template->param( admin => $admin );
output_html_with_http_headers $query, $cookie, $template->output;

37
opac/errors/500.pl

@ -0,0 +1,37 @@
#!/usr/bin/perl
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Context;
my $query = new CGI;
my $admin = C4::Context->preference('KohaAdminEmailAddress');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "errors/500.tmpl",
query => $query,
type => "opac",
koha-tmpl/authnotrequired => 1,
debug => 1,
}
);
$template->param( admin => $admin );
output_html_with_http_headers $query, $cookie, $template->output;
Loading…
Cancel
Save