Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bug 1803 - fix error page handling

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
  • Loading branch information...
commit f53d084c0061c47c571cbbce7c0d893289055191 1 parent ecdf350
Galen Charlton authored Joshua Ferraro committed
View
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
View
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',
View
0  koha-tmpl/errors/400.pl → errors/400.pl
File renamed without changes
View
0  koha-tmpl/errors/401.pl → errors/401.pl
File renamed without changes
View
0  koha-tmpl/errors/402.pl → errors/402.pl
File renamed without changes
View
0  koha-tmpl/errors/403.pl → errors/403.pl
File renamed without changes
View
0  koha-tmpl/errors/404.pl → errors/404.pl
File renamed without changes
View
0  koha-tmpl/errors/500.pl → errors/500.pl
File renamed without changes
View
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
View
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>
View
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>
View
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>
View
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>
View
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>
View
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;
View
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;
View
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;
View
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;
View
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;
View
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;
Please sign in to comment.
Something went wrong with that request. Please try again.