From f53d084c0061c47c571cbbce7c0d893289055191 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 19 Feb 2008 11:26:08 +1300 Subject: [PATCH] bug 1803 - fix error page handling Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- .htaccess | 10 ++++---- Makefile.PL | 2 +- {koha-tmpl/errors => errors}/400.pl | 0 {koha-tmpl/errors => errors}/401.pl | 0 {koha-tmpl/errors => errors}/402.pl | 0 {koha-tmpl/errors => errors}/403.pl | 0 {koha-tmpl/errors => errors}/404.pl | 0 {koha-tmpl/errors => errors}/500.pl | 0 etc/koha-httpd.conf | 13 ++++++++++ .../opac-tmpl/prog/en/modules/errors/400.tmpl | 29 +++++++++++++++++++++ .../opac-tmpl/prog/en/modules/errors/401.tmpl | 30 ++++++++++++++++++++++ .../opac-tmpl/prog/en/modules/errors/403.tmpl | 29 +++++++++++++++++++++ .../opac-tmpl/prog/en/modules/errors/404.tmpl | 29 +++++++++++++++++++++ .../opac-tmpl/prog/en/modules/errors/500.tmpl | 29 +++++++++++++++++++++ {koha-tmpl => opac}/errors/400.pl | 2 +- {koha-tmpl => opac}/errors/401.pl | 2 +- {koha-tmpl => opac}/errors/402.pl | 2 +- {koha-tmpl => opac}/errors/403.pl | 2 +- {koha-tmpl => opac}/errors/404.pl | 2 +- {koha-tmpl => opac}/errors/500.pl | 4 +-- 20 files changed, 172 insertions(+), 13 deletions(-) copy {koha-tmpl/errors => errors}/400.pl (100%) copy {koha-tmpl/errors => errors}/401.pl (100%) copy {koha-tmpl/errors => errors}/402.pl (100%) copy {koha-tmpl/errors => errors}/403.pl (100%) copy {koha-tmpl/errors => errors}/404.pl (100%) copy {koha-tmpl/errors => errors}/500.pl (100%) create mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl create mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl create mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl create mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl create mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl rename {koha-tmpl => opac}/errors/400.pl (96%) rename {koha-tmpl => opac}/errors/401.pl (96%) rename {koha-tmpl => opac}/errors/402.pl (96%) rename {koha-tmpl => opac}/errors/403.pl (96%) rename {koha-tmpl => opac}/errors/404.pl (96%) rename {koha-tmpl => opac}/errors/500.pl (93%) diff --git a/.htaccess b/.htaccess index 179a894e29..493fba56e2 100755 --- a/.htaccess +++ b/.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 diff --git a/Makefile.PL b/Makefile.PL index bac9ff9fdc..d0e277d499 100644 --- a/Makefile.PL +++ b/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', diff --git a/koha-tmpl/errors/400.pl b/errors/400.pl similarity index 100% copy from koha-tmpl/errors/400.pl copy to errors/400.pl diff --git a/koha-tmpl/errors/401.pl b/errors/401.pl similarity index 100% copy from koha-tmpl/errors/401.pl copy to errors/401.pl diff --git a/koha-tmpl/errors/402.pl b/errors/402.pl similarity index 100% copy from koha-tmpl/errors/402.pl copy to errors/402.pl diff --git a/koha-tmpl/errors/403.pl b/errors/403.pl similarity index 100% copy from koha-tmpl/errors/403.pl copy to errors/403.pl diff --git a/koha-tmpl/errors/404.pl b/errors/404.pl similarity index 100% copy from koha-tmpl/errors/404.pl copy to errors/404.pl diff --git a/koha-tmpl/errors/500.pl b/errors/500.pl similarity index 100% copy from koha-tmpl/errors/500.pl copy to errors/500.pl diff --git a/etc/koha-httpd.conf b/etc/koha-httpd.conf index 542e2e6fd4..d8fc9232a6 100644 --- a/etc/koha-httpd.conf +++ b/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 diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl new file mode 100644 index 0000000000..b4a0c90d48 --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl @@ -0,0 +1,29 @@ +Koha Online Catalog › An Error Has Occurred + + + + + + +
+
+
+
+

An Error has Occurred

+

Error 404

+
    +
  • This error means that the Koha is pointed an invalid link.
  • +
  • To report this error, you can + ">email the Koha Administrator.
  • +
  • Use top menu bar to navigate to another part of Koha.
  • +
+
+
+
+
+
+ + + + + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl new file mode 100644 index 0000000000..7d70c01279 --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl @@ -0,0 +1,30 @@ +Koha Online Catalog › An Error Has Occurred + + + + + + +
+
+
+
+

An Error has Occurred

+

Error 404

+
    +
  • This error means that the you are trying to access a link that you're not authorized to see.
  • +
  • Try logging in to the catalog
  • +
  • To report this error, you can + ">email the Koha Administrator.
  • +
  • Use top menu bar to navigate to another part of Koha.
  • +
+
+
+
+
+
+ + + + + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl new file mode 100644 index 0000000000..d8fc6b29dd --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl @@ -0,0 +1,29 @@ +Koha Online Catalog › An Error Has Occurred + + + + + + +
+
+
+
+

An Error has Occurred

+

Error 404

+
    +
  • This error means that you are forbidden for some reason to see this page.
  • +
  • To report this error, you can + ">email the Koha Administrator.
  • +
  • Use top menu bar to navigate to another part of Koha.
  • +
+
+
+
+
+
+ + + + + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl new file mode 100644 index 0000000000..bb07e535ac --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl @@ -0,0 +1,29 @@ +Koha Online Catalog › An Error Has Occurred + + + + + + +
+
+
+
+

An Error has Occurred

+

Error 404

+
    +
  • This error means that the link was broken and that the page doesn't exist.
  • +
  • To report this error, you can + ">email the Koha Administrator.
  • +
  • Use top menu bar to navigate to another part of Koha.
  • +
+
+
+
+
+
+ + + + + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl new file mode 100644 index 0000000000..27121ff2a9 --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl @@ -0,0 +1,29 @@ +Koha Online Catalog › An Error Has Occurred + + + + + + +
+
+
+
+

An Error has Occurred

+

Error 404

+
    +
  • An error occurred while try to process your request.
  • +
  • To report this error, you can + ">email the Koha Administrator.
  • +
  • Use top menu bar to navigate to another part of Koha.
  • +
+
+
+
+
+
+ + + + + diff --git a/koha-tmpl/errors/400.pl b/opac/errors/400.pl similarity index 96% rename from koha-tmpl/errors/400.pl rename to opac/errors/400.pl index 431792b7f7..16c169c06c 100755 --- a/koha-tmpl/errors/400.pl +++ b/opac/errors/400.pl @@ -28,7 +28,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "errors/400.tmpl", query => $query, - type => "intranet", + type => "opac", authnotrequired => 1, debug => 1, } diff --git a/koha-tmpl/errors/401.pl b/opac/errors/401.pl similarity index 96% rename from koha-tmpl/errors/401.pl rename to opac/errors/401.pl index 937476581c..c6573f4b7f 100755 --- a/koha-tmpl/errors/401.pl +++ b/opac/errors/401.pl @@ -28,7 +28,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "errors/401.tmpl", query => $query, - type => "intranet", + type => "opac", authnotrequired => 1, debug => 1, } diff --git a/koha-tmpl/errors/402.pl b/opac/errors/402.pl similarity index 96% rename from koha-tmpl/errors/402.pl rename to opac/errors/402.pl index c7f66416cc..8620f88cb6 100755 --- a/koha-tmpl/errors/402.pl +++ b/opac/errors/402.pl @@ -28,7 +28,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "errors/402.tmpl", query => $query, - type => "intranet", + type => "opac", authnotrequired => 1, debug => 1, } diff --git a/koha-tmpl/errors/403.pl b/opac/errors/403.pl similarity index 96% rename from koha-tmpl/errors/403.pl rename to opac/errors/403.pl index b6ffe0dda4..d223ffb6da 100755 --- a/koha-tmpl/errors/403.pl +++ b/opac/errors/403.pl @@ -28,7 +28,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "errors/403.tmpl", query => $query, - type => "intranet", + type => "opac", authnotrequired => 1, debug => 1, } diff --git a/koha-tmpl/errors/404.pl b/opac/errors/404.pl similarity index 96% rename from koha-tmpl/errors/404.pl rename to opac/errors/404.pl index ee0fb2a53e..0c5408c99d 100755 --- a/koha-tmpl/errors/404.pl +++ b/opac/errors/404.pl @@ -28,7 +28,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "errors/404.tmpl", query => $query, - type => "intranet", + type => "opac", authnotrequired => 1, debug => 1, } diff --git a/koha-tmpl/errors/500.pl b/opac/errors/500.pl similarity index 93% rename from koha-tmpl/errors/500.pl rename to opac/errors/500.pl index f4341eda22..29ee3e082f 100755 --- a/koha-tmpl/errors/500.pl +++ b/opac/errors/500.pl @@ -28,8 +28,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "errors/500.tmpl", query => $query, - type => "intranet", - authnotrequired => 1, + type => "opac", + koha-tmpl/authnotrequired => 1, debug => 1, } ); -- 2.11.4.GIT