From: William A. Rowe Jr Date: Tue, 7 Aug 2001 04:33:58 +0000 (+0000) Subject: Formatted output changes only... X-Git-Tag: 2.0.23~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c1fdbd27d71456eaa99e9024e04b4441a18892c;p=apache Formatted output changes only... Introduced new mod_autoindex IndexOptions flags; SuppressIcon to drop the icon column and SuppressRules to drop the
elements. These are necessary for HTML 3.2 final formatting rules. Introduced HTMLTable to create rudimentary HTML table listings (implies FancyIndexing). Necessary for alternate charsets, since the columns are borked by multibyte characters. Re-Introduced the mod_autoindex IndexOptions flag TrackModified from Apache 1.3.15. This is needed for two reasons, first, given multiple machines within a server farm, ETags and Last-Modified stamps won't correspond from machine to machine, and second, many Unixes don't capture changes to the date or time stamp of existing files, since these don't modify the dirent itself. [Originally for 1.3 by me] Re-Introduced the mod_autoindex InextOptions flag FoldersFirst and DirectoryWidth options from Apache 1.3.10. [Originally for 1.3 by Ken Coar] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89979 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index ad6865194e..65bf0bc74d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,28 @@ Changes with Apache 2.0.23-dev + *) Introduced new mod_autoindex IndexOptions flags; SuppressIcon to + drop the icon column, SuppressRules to drop the
elements, + and HTMLTable to create rudimentary HTML table listings (implies + FancyIndexing). [William Rowe] + + *) Re-Introduced the mod_autoindex IndexOptions flag TrackModified + from Apache 1.3.15. This is needed for two reasons, first, given + multiple machines within a server farm, ETags and Last-Modified + stamps won't correspond from machine to machine, and second, many + Unixes don't capture changes to the date or time stamp of existing + files, since these don't modify the dirent itself. [William Rowe] + + *) Re-Introduced the mod_autoindex InextOptions flag FoldersFirst + and DirectoryWidth options from Apache 1.3.10. + [William Rowe, Ken Coar] + + *) Eliminated FancyIndexing directive, depricated early in Apache + 1.3 by the IndexOptions FancyIndexing syntax. [William Rowe] + *) mod_autoindex now excludes any file names that would result in - an error, other than a success or redirect. [William Rowe] + an error, other than a success or redirect. Also optimized + the parent directory, always included except in the URI '/'. + [William Rowe] *) Refactored mod_negotiation and mod_mime to help mod_dir accept negotiated index pages, and prevent the server from defaulting diff --git a/docs/manual/mod/mod_autoindex.html b/docs/manual/mod/mod_autoindex.html index dab43f9e83..d793b2e353 100644 --- a/docs/manual/mod/mod_autoindex.html +++ b/docs/manual/mod/mod_autoindex.html @@ -15,7 +15,14 @@

Module mod_autoindex

-This module provides for automatic directory indexing. +The module mod_autoindex generates directory indexes, automatically, similar to +the Unix ls command or the Win32 dir shell command. +

+ +Automatic index generation must be enabled with by the Options +directive's [+]Indexes option. See the +Options directive for +more details.

Summary - The index of a directory can come from one of two sources:

", r); + ap_rputs("\n", r); } } @@ -1491,6 +1708,13 @@ static int dsortf(struct ent **e1, struct ent **e2) if ((*e2)->name[0] == '/') { return 1; } + /* + * Now see if one's a directory and one isn't, if we're set + * isdir for FOLDERS_FIRST. + */ + if ((*e1)->isdir != (*e2)->isdir) { + return (*e1)->isdir ? -1 : 1; + } /* * All of our comparisons will be of the c1 entry against the c2 one, * so assign them appropriately to take care of the ordering. @@ -1566,15 +1790,25 @@ static int index_directory(request_rec *r, #else r->content_type = "text/html"; #endif - ap_update_mtime(r, r->finfo.mtime); - ap_set_last_modified(r); - ap_set_etag(r); - + if (autoindex_opts & TRACK_MODIFIED) { + ap_update_mtime(r, r->finfo.mtime); + ap_set_last_modified(r); + ap_set_etag(r); + } if (r->header_only) { apr_dir_close(thedir); return 0; } + /* + * If there is no specific ordering defined for this directory, + * default to ascending by filename. + */ + keyid = autoindex_conf->default_keyid + ? autoindex_conf->default_keyid : K_NAME; + direction = autoindex_conf->default_direction + ? autoindex_conf->default_direction : D_ASCENDING; + /* Spew HTML preamble */ title_endp = title_name + strlen(title_name) - 1; @@ -1594,28 +1828,21 @@ static int index_directory(request_rec *r, * IndexOrderDefault directive (if there is one); otherwise, * we fall back to ascending by name. */ - qstring = r->args; - if ((autoindex_opts & SUPPRESS_COLSORT) - || ((qstring == NULL) || (*qstring == '\0'))) { - qstring = autoindex_conf->default_order; - } + if (!(autoindex_opts & SUPPRESS_COLSORT)) + qstring = r->args; + else + qstring = NULL; + /* * If there is no specific ordering defined for this directory, - * default to ascending by filename. + * take the defaults above. */ - if ((qstring == NULL) || (*qstring == '\0')) { - keyid = K_NAME; - direction = D_ASCENDING; - } - else { + if ((qstring != NULL) && (*qstring != '\0')) { keyid = *qstring; ap_getword(r->pool, &qstring, '='); if (qstring != '\0') { direction = *qstring; } - else { - direction = D_ASCENDING; - } } /*