bug 1803 - fix error page handling
authorGalen Charlton <galen.charlton@liblime.com>
Mon, 18 Feb 2008 22:26:08 +0000 (11:26 +1300)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 19 Feb 2008 01:32:07 +0000 (19:32 -0600)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>

20 files changed:
.htaccess
Makefile.PL
errors/400.pl [copied from koha-tmpl/errors/400.pl with 100% similarity]
errors/401.pl [copied from koha-tmpl/errors/401.pl with 100% similarity]
errors/402.pl [copied from koha-tmpl/errors/402.pl with 100% similarity]
errors/403.pl [copied from koha-tmpl/errors/403.pl with 100% similarity]
errors/404.pl [copied from koha-tmpl/errors/404.pl with 100% similarity]
errors/500.pl [copied from koha-tmpl/errors/500.pl with 100% similarity]
etc/koha-httpd.conf
koha-tmpl/opac-tmpl/prog/en/modules/errors/400.tmpl [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/errors/401.tmpl [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/errors/403.tmpl [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/errors/404.tmpl [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/errors/500.tmpl [new file with mode: 0644]
opac/errors/400.pl [moved from koha-tmpl/errors/400.pl with 96% similarity]
opac/errors/401.pl [moved from koha-tmpl/errors/401.pl with 96% similarity]
opac/errors/402.pl [moved from koha-tmpl/errors/402.pl with 96% similarity]
opac/errors/403.pl [moved from koha-tmpl/errors/403.pl with 96% similarity]
opac/errors/404.pl [moved from koha-tmpl/errors/404.pl with 96% similarity]
opac/errors/500.pl [moved from koha-tmpl/errors/500.pl with 93% similarity]

index 179a894..493fba5 100755 (executable)
--- 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
 
 
index bac9ff9..d0e277d 100644 (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', 
similarity index 100%
copy from koha-tmpl/errors/400.pl
copy to errors/400.pl
similarity index 100%
copy from koha-tmpl/errors/401.pl
copy to errors/401.pl
similarity index 100%
copy from koha-tmpl/errors/402.pl
copy to errors/402.pl
similarity index 100%
copy from koha-tmpl/errors/403.pl
copy to errors/403.pl
similarity index 100%
copy from koha-tmpl/errors/404.pl
copy to errors/404.pl
similarity index 100%
copy from koha-tmpl/errors/500.pl
copy to errors/500.pl
index 542e2e6..d8fc923 100644 (file)
    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
 
    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 (file)
index 0000000..b4a0c90
--- /dev/null
@@ -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>
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 (file)
index 0000000..7d70c01
--- /dev/null
@@ -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>
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 (file)
index 0000000..d8fc6b2
--- /dev/null
@@ -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>
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 (file)
index 0000000..bb07e53
--- /dev/null
@@ -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>
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 (file)
index 0000000..27121ff
--- /dev/null
@@ -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>
similarity index 96%
rename from koha-tmpl/errors/400.pl
rename to opac/errors/400.pl
index 431792b..16c169c 100755 (executable)
@@ -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,
     }
similarity index 96%
rename from koha-tmpl/errors/401.pl
rename to opac/errors/401.pl
index 9374765..c6573f4 100755 (executable)
@@ -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,
     }
similarity index 96%
rename from koha-tmpl/errors/402.pl
rename to opac/errors/402.pl
index c7f6641..8620f88 100755 (executable)
@@ -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,
     }
similarity index 96%
rename from koha-tmpl/errors/403.pl
rename to opac/errors/403.pl
index b6ffe0d..d223ffb 100755 (executable)
@@ -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,
     }
similarity index 96%
rename from koha-tmpl/errors/404.pl
rename to opac/errors/404.pl
index ee0fb2a..0c5408c 100755 (executable)
@@ -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,
     }
similarity index 93%
rename from koha-tmpl/errors/500.pl
rename to opac/errors/500.pl
index f4341ed..29ee3e0 100755 (executable)
@@ -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,
     }
 );