diff options
Diffstat (limited to 'src/proxyfunc.c')
-rw-r--r-- | src/proxyfunc.c | 17 |
1 files changed, 11 insertions, 6 deletions
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); |