mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05: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:
parent
1c550b0c8e
commit
7093e19523
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user