Changeset 2058

Show
Ignore:
Timestamp:
01/18/2008 12:50:09 PM (4 months ago)
Author:
glen
Message:

- support letterhomes in mod_userdir (#1473)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/lighttpd-1.4.x/NEWS

    r2053 r2058  
    2020  * HTTPS env var should be "on" when using mod_extforward and the X-Forwarded-Proto header is set. (#1499) 
    2121  * generate ETag and Last-Modified headers for mod_ssi based on newest modified include (#1491) 
     22  * support letterhomes in mod_userdir (#1473) 
    2223 
    2324- 1.4.18 - 2007-09-09 
  • branches/lighttpd-1.4.x/src/mod_userdir.c

    r1371 r2058  
    2222        buffer *path; 
    2323        buffer *basepath; 
     24        unsigned short letterhomes; 
    2425} plugin_config; 
    2526 
     
    8889                { "userdir.include-user",       NULL, T_CONFIG_ARRAY,  T_CONFIG_SCOPE_CONNECTION },       /* 2 */ 
    8990                { "userdir.basepath",           NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },       /* 3 */ 
     91                { "userdir.letterhomes",        NULL, T_CONFIG_BOOLEAN,T_CONFIG_SCOPE_CONNECTION },       /* 4 */ 
    9092                { NULL,                         NULL, T_CONFIG_UNSET,  T_CONFIG_SCOPE_UNSET } 
    9193        }; 
     
    103105                s->path = buffer_init(); 
    104106                s->basepath = buffer_init(); 
     107                s->letterhomes = 0; 
    105108 
    106109                cv[0].destination = s->path; 
     
    108111                cv[2].destination = s->include_user; 
    109112                cv[3].destination = s->basepath; 
     113                cv[4].destination = &(s->letterhomes); 
    110114 
    111115                p->config_storage[i] = s; 
     
    129133        PATCH(include_user); 
    130134        PATCH(basepath); 
     135        PATCH(letterhomes); 
    131136 
    132137        /* skip the first, the global context */ 
     
    150155                        } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("userdir.basepath"))) { 
    151156                                PATCH(basepath); 
     157                        } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("userdir.letterhomes"))) { 
     158                                PATCH(letterhomes); 
    152159                        } 
    153160                } 
     
    254261                buffer_copy_string_buffer(p->temp_path, p->conf.basepath); 
    255262                BUFFER_APPEND_SLASH(p->temp_path); 
     263                if (p->conf.letterhomes) { 
     264                        buffer_append_string_len(p->temp_path, p->username->ptr, 1); 
     265                        BUFFER_APPEND_SLASH(p->temp_path); 
     266                } 
    256267                buffer_append_string_buffer(p->temp_path, p->username); 
    257268        }