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>
tags/v3.00.00-beta
Galen Charlton 13 years ago
committed by Joshua Ferraro
parent
commit
f53d084c00
20 changed files with 387 additions and 6 deletions
  1. +5
    -5
      .htaccess
  2. +1
    -1
      Makefile.PL
  3. +0
    -0
      errors/400.pl
  4. +0
    -0
      errors/401.pl
  5. +0
    -0
      errors/402.pl
  6. +0
    -0
      errors/403.pl
  7. +0
    -0
      errors/404.pl
  8. +0
    -0
      errors/500.pl
  9. +13
    -0
      etc/koha-httpd.conf
  10. +29
    -0
      koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl
  11. +30
    -0
      koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl
  12. +29
    -0
      koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl
  13. +29
    -0
      koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl
  14. +29
    -0
      koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl
  15. +37
    -0
      opac/errors/400.pl
  16. +37
    -0
      opac/errors/401.pl
  17. +37
    -0
      opac/errors/402.pl
  18. +37
    -0
      opac/errors/403.pl
  19. +37
    -0
      opac/errors/404.pl
  20. +37
    -0
      opac/errors/500.pl

+ 5
- 5
.htaccess View File

@@ -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



+ 1
- 1
Makefile.PL View File

@@ -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',


koha-tmpl/errors/400.pl → errors/400.pl View File


koha-tmpl/errors/401.pl → errors/401.pl View File


koha-tmpl/errors/402.pl → errors/402.pl View File


koha-tmpl/errors/403.pl → errors/403.pl View File


koha-tmpl/errors/404.pl → errors/404.pl View File


koha-tmpl/errors/500.pl → errors/500.pl View File


+ 13
- 0
etc/koha-httpd.conf View File

@@ -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
- 0
koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl View File

@@ -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
- 0
koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl View File

@@ -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
- 0
koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl View File

@@ -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
- 0
koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl View File

@@ -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
- 0
koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl View File

@@ -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
- 0
opac/errors/400.pl View File

@@ -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
- 0
opac/errors/401.pl View File

@@ -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
- 0
opac/errors/402.pl View File

@@ -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
- 0
opac/errors/403.pl View File

@@ -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
- 0
opac/errors/404.pl View File

@@ -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
- 0
opac/errors/500.pl View File

@@ -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