From 7093e195231f1a8f5866d523df9911ba592f2938 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Fri, 19 Dec 2014 11:22:36 +0000 Subject: [PATCH] Feature: Added support to type="static" to list user This adds support to list the user for a static . --- src/auth_static.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/auth_static.c b/src/auth_static.c index 648de2a0..07c9f843 100644 --- a/src/auth_static.c +++ b/src/auth_static.c @@ -57,6 +57,17 @@ static void clear_auth (auth_t *auth) { auth->state = NULL; } +static auth_result static_userlist(auth_t *auth, xmlNodePtr srcnode) { + auth_static_t *auth_info = auth->state; + xmlNodePtr newnode; + + newnode = xmlNewChild(srcnode, NULL, XMLSTR("User"), NULL); + xmlNewChild(newnode, NULL, XMLSTR("username"), XMLSTR(auth_info->username)); + xmlNewChild(newnode, NULL, XMLSTR("password"), XMLSTR(auth_info->password)); + + return AUTH_OK; +} + int auth_get_static_auth (auth_t *authenticator, config_options_t *options) { auth_static_t *auth_info; int need_user; @@ -75,6 +86,7 @@ int auth_get_static_auth (auth_t *authenticator, config_options_t *options) { return -1; authenticator->authenticate_client = static_auth; + authenticator->listuser = static_userlist; authenticator->free = clear_auth; authenticator->state = auth_info;