added valid-user support, fixed #4

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@491 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
Jan Kneschke 2005-07-31 11:49:26 +00:00
parent e678d8f765
commit 9a62fdb85d
1 changed files with 11 additions and 1 deletions

View File

@ -309,11 +309,16 @@ static int http_auth_match_rules(server *srv, mod_auth_plugin_data *p, const cha
if (i == p->conf.auth_require->used) {
return -1;
}
req = ((data_array *)(p->conf.auth_require->data[i]))->value;
require = (data_string *)array_get_element(req, "require");
/* if we get here, the user we got a authed user */
if (0 == strcmp(require->value->ptr, "valid-user")) {
return 0;
}
/* user=name1|group=name3|host=name4 */
/* seperate the string by | */
@ -340,6 +345,11 @@ static int http_auth_match_rules(server *srv, mod_auth_plugin_data *p, const cha
/* from r to r + r_len is a rule */
if (0 == strncmp(r, "valid-user", r_len)) {
log_error_write(srv, __FILE__, __LINE__, "s", "valid-user cannot be combined with other require rules");
return -1;
}
/* search for = in the rules */
if (NULL == (eq = strchr(r, '='))) {
log_error_write(srv, __FILE__, __LINE__, "s", "= is missing");