From e7575b72bd6cd202c6a9b93369d86bf7c7974938 Mon Sep 17 00:00:00 2001 From: David Troy Date: Sat, 1 Apr 2006 18:52:17 +0000 Subject: git-svn-id: http://svncommunity.digium.com/svn/astmanproxy/branches/1.20pre@53 f02b47b9-160a-0410-81a6-dc3441afb0ec --- src/proxyfunc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/proxyfunc.c') diff --git a/src/proxyfunc.c b/src/proxyfunc.c index ed4770e..54b7789 100644 --- a/src/proxyfunc.c +++ b/src/proxyfunc.c @@ -106,11 +106,16 @@ void *ProxySetAutoFilter(struct mansession *s, struct message *m) { return 0; } -void *ProxyLogin(struct mansession *s, char *user, char *secret) { - struct message m; +void *ProxyLogin(struct mansession *s, struct message *m) { + struct message mo; struct proxy_user *pu; + char *user, *secret, *md5key; - memset(&m, 0, sizeof(struct message)); + user = astman_get_header(m, "Username"); + secret = astman_get_header(m, "Secret"); + md5key = astman_get_header(m, "Key"); + + memset(&mo, 0, sizeof(struct message)); if( debug ) debugmsg("Login attempt as: %s/%s", user, secret); @@ -118,9 +123,9 @@ void *ProxyLogin(struct mansession *s, char *user, char *secret) { pu = pc.userlist; while( pu ) { if ( !strcmp(user, pu->username) && !strcmp(secret, pu->secret) ) { - AddHeader(&m, "Response: Success"); - AddHeader(&m, "Message: Authentication accepted"); - s->output->write(s, &m); + AddHeader(&mo, "Response: Success"); + AddHeader(&mo, "Message: Authentication accepted"); + s->output->write(s, &mo); s->authenticated = 1; strcpy(s->user.channel, pu->channel); strcpy(s->user.icontext, pu->icontext); -- cgit