1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

Feature: Added support to type="static" <role> to list user

This adds support to list the user for a static <role>.
This commit is contained in:
Philipp Schafft 2014-12-19 11:22:36 +00:00
parent 1c550b0c8e
commit 7093e19523

View File

@ -57,6 +57,17 @@ static void clear_auth (auth_t *auth) {
auth->state = NULL; 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) { int auth_get_static_auth (auth_t *authenticator, config_options_t *options) {
auth_static_t *auth_info; auth_static_t *auth_info;
int need_user; int need_user;
@ -75,6 +86,7 @@ int auth_get_static_auth (auth_t *authenticator, config_options_t *options) {
return -1; return -1;
authenticator->authenticate_client = static_auth; authenticator->authenticate_client = static_auth;
authenticator->listuser = static_userlist;
authenticator->free = clear_auth; authenticator->free = clear_auth;
authenticator->state = auth_info; authenticator->state = auth_info;