Commit 55d429a6 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Fix: Corrected display of "login" on status page

This corrects the creation of <authenticator> in the status output
and this way fixes the display of login link on status page.
Closes #1939
parent 3d6ea2ef
......@@ -253,9 +253,9 @@ xmlDocPtr admin_build_sourcelist (const char *mount)
config = config_get_config();
mountinfo = config_find_mount (config, source->mount, MOUNT_TYPE_NORMAL);
if (mountinfo)
acl = auth_stack_get_anonymous_acl(mountinfo->authstack);
acl = auth_stack_get_anonymous_acl(mountinfo->authstack, httpp_req_get);
if (!acl)
auth_stack_get_anonymous_acl(config->authstack);
acl = auth_stack_get_anonymous_acl(config->authstack, httpp_req_get);
if (acl && acl_test_web(acl) == ACL_POLICY_DENY) {
xmlNewChild(srcnode, NULL, XMLSTR("authenticator"), XMLSTR("(dummy)"));
}
......
......@@ -727,17 +727,17 @@ auth_t *auth_stack_getbyid(auth_stack_t *stack, unsigned long id) {
}
acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack) {
acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack, httpp_request_type_e method) {
acl_t *ret = NULL;
if (!stack)
if (!stack || method < 0 || method > httpp_req_unknown)
return NULL;
auth_stack_addref(stack);
while (!ret && stack) {
auth_t *auth = auth_stack_get(stack);
if (strcmp(auth->type, AUTH_TYPE_ANONYMOUS) == 0) {
if (auth->method[method] && strcmp(auth->type, AUTH_TYPE_ANONYMOUS) == 0) {
acl_addref(ret = auth->acl);
}
auth_release(auth);
......
......@@ -135,6 +135,6 @@ int auth_stack_push(auth_stack_t **stack, auth_t *auth);
int auth_stack_append(auth_stack_t *stack, auth_stack_t *tail);
auth_t *auth_stack_get(auth_stack_t *stack);
auth_t *auth_stack_getbyid(auth_stack_t *stack, unsigned long id);
acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack);
acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack, httpp_request_type_e method);
#endif
......@@ -1118,9 +1118,9 @@ static void source_apply_mount (ice_config_t *config, source_t *source, mount_pr
stats_event (source->mount, "subtype", mountinfo->subtype);
if (mountinfo)
acl = auth_stack_get_anonymous_acl(mountinfo->authstack);
acl = auth_stack_get_anonymous_acl(mountinfo->authstack, httpp_req_get);
if (!acl)
auth_stack_get_anonymous_acl(config->authstack);
acl = auth_stack_get_anonymous_acl(config->authstack, httpp_req_get);
if (acl && acl_test_web(acl) == ACL_POLICY_DENY)
stats_event (source->mount, "authenticator", "(dummy)");
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment