summaryrefslogtreecommitdiffstats
path: root/src/proxyfunc.c
diff options
context:
space:
mode:
authorDavid Troy <dave@popvox.com>2006-04-01 18:52:17 +0000
committerDavid Troy <dave@popvox.com>2006-04-01 18:52:17 +0000
commite7575b72bd6cd202c6a9b93369d86bf7c7974938 (patch)
treebc4e716bc647d689bec91df1a9d77ec9730135e7 /src/proxyfunc.c
parentcf834d379b5a6a7393d0c25386c55959f5df4550 (diff)
git-svn-id: http://svncommunity.digium.com/svn/astmanproxy/branches/1.20pre@53 f02b47b9-160a-0410-81a6-dc3441afb0ec
Diffstat (limited to 'src/proxyfunc.c')
-rw-r--r--src/proxyfunc.c17
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);