httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis Daly <d...@daoine.org>
Subject Re: [PATCH] IndexResults for mod_autoindex
Date Thu, 21 Nov 2002 09:29:58 GMT
On Thu, Nov 21, 2002 at 09:09:35AM +0000, Francis Daly wrote:

> There are two further optional code patches to follow, which are only
> useful if something similar to these are accepted.

Here come the patches...

The first changes the icon presented in the mod_autoindex listing (if
FancyIndexing is on) to the whatever is set for ^^UNAUTHORIZED^^ or,
failing that, the default.  (The final patch is a docs patch for that magic
string.)

The second additionally hides details like file size and modification
time from unauthorized requesters.  If they want that info, they can
HEAD the resource with credentials, or just request the directory
index with credentials.

The first patch is probably useful.  The second is possibly
unnecessary.  I like them both.  Neither are required.

All are against the as-patched-in-previous-mail versions, although
they should be trivial to modify if those patches are changed before
being accepted.

All the best,

	f
-- 
Francis Daly        deva@daoine.org

--- modules/generators/mod_autoindex.c	21 Nov 2002 02:35:54 -0000
+++ modules/generators/mod_autoindex.c	21 Nov 2002 02:40:23 -0000
@@ -1468,6 +1468,11 @@
     p->ascending = (apr_toupper(direction) == D_ASCENDING);
     p->version_sort = !!(autoindex_opts & VERSION_SORT);
 
+    /* Change to the "UNAUTHORIZED" icon, if appropriate */
+    if (rr->status == HTTP_UNAUTHORIZED) {
+        rr->filename = "^^UNAUTHORIZED^^";
+    }
+
     if (autoindex_opts & (FANCY_INDEXING | TABLE_INDEXING)) {
         p->lm = rr->finfo.mtime;
         if (dirent->filetype == APR_DIR) {

--- modules/generators//mod_autoindex.c	21 Nov 2002 02:40:23 -0000
+++ modules/generators//mod_autoindex.c	21 Nov 2002 02:41:24 -0000
@@ -1468,9 +1468,12 @@
     p->ascending = (apr_toupper(direction) == D_ASCENDING);
     p->version_sort = !!(autoindex_opts & VERSION_SORT);
 
-    /* Change to the "UNAUTHORIZED" icon, if appropriate */
+    /* Change to the "UNAUTHORIZED" icon, if appropriate. 
+       And conceal details which people don't need until they authenticate */
     if (rr->status == HTTP_UNAUTHORIZED) {
         rr->filename = "^^UNAUTHORIZED^^";
+        rr->finfo.mtime = -1;
+        rr->finfo.size = -1;
     }
 
     if (autoindex_opts & (FANCY_INDEXING | TABLE_INDEXING)) {

--- mod_autoindex.xml.new	Thu Nov 21 09:27:14 2002
+++ mod_autoindex.xml	Thu Nov 21 09:28:10 2002
@@ -309,7 +309,9 @@
 
     <p><var>Name</var> is either <code>^^DIRECTORY^^</code>
for directories,
     <code>^^BLANKICON^^</code> for blank lines (to format the list
-    correctly), a file extension, a wildcard expression, a partial
+    correctly), <code>^^UNAUTHORIZED^^</code> for anything for which
+    the user has not provided appropriate credentials (available from
+    2.0.44), a file extension, a wildcard expression, a partial
     filename or a complete filename.</p>
 
     <example><title>Examples</title>

Mime
View raw message