Feature #1473 ยป mod_userdir.patch
src/mod_userdir.c 2007-11-28 18:47:57.000000000 +0100 | ||
---|---|---|
array *include_user;
|
||
buffer *path;
|
||
buffer *basepath;
|
||
unsigned short letterhomes;
|
||
} plugin_config;
|
||
typedef struct {
|
||
... | ... | |
{ "userdir.exclude-user", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
|
||
{ "userdir.include-user", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
|
||
{ "userdir.basepath", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
|
||
{ "userdir.letterhomes", NULL, T_CONFIG_BOOLEAN,T_CONFIG_SCOPE_CONNECTION }, /* 4 */
|
||
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
|
||
};
|
||
... | ... | |
s->include_user = array_init();
|
||
s->path = buffer_init();
|
||
s->basepath = buffer_init();
|
||
s->letterhomes = 0;
|
||
cv[0].destination = s->path;
|
||
cv[1].destination = s->exclude_user;
|
||
cv[2].destination = s->include_user;
|
||
cv[3].destination = s->basepath;
|
||
cv[4].destination = &(s->letterhomes);
|
||
p->config_storage[i] = s;
|
||
... | ... | |
PATCH(exclude_user);
|
||
PATCH(include_user);
|
||
PATCH(basepath);
|
||
PATCH(letterhomes);
|
||
/* skip the first, the global context */
|
||
for (i = 1; i < srv->config_context->used; i++) {
|
||
... | ... | |
PATCH(include_user);
|
||
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("userdir.basepath"))) {
|
||
PATCH(basepath);
|
||
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("userdir.letterhomes"))) {
|
||
PATCH(letterhomes);
|
||
}
|
||
}
|
||
}
|
||
... | ... | |
buffer_copy_string_buffer(p->temp_path, p->conf.basepath);
|
||
BUFFER_APPEND_SLASH(p->temp_path);
|
||
if (p->conf.letterhomes) {
|
||
buffer_append_string_len(p->temp_path, p->username->ptr, 1);
|
||
BUFFER_APPEND_SLASH(p->temp_path);
|
||
}
|
||
buffer_append_string_buffer(p->temp_path, p->username);
|
||
}
|
||
BUFFER_APPEND_SLASH(p->temp_path);
|