aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-09-18 21:42:37 +0000
committergoodale <goodale@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2000-09-18 21:42:37 +0000
commit3969eb0efd59f2942493ed273e82ba63bfe5cc3a (patch)
treedb3192dee6697d99bd931ca445cb510a72076e3f /src
parent3ed49f02b7b2b3452d1fa8563781682235e89985 (diff)
Added an extra two arguments to the authentication so it returns
the username of the person who authenticated (optionally). Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@45 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'src')
-rw-r--r--src/Authorisation.c8
-rw-r--r--src/http_Auth.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/src/Authorisation.c b/src/Authorisation.c
index 883dff8..92a6a27 100644
--- a/src/Authorisation.c
+++ b/src/Authorisation.c
@@ -156,7 +156,9 @@ int HTTP_AuthAddUser(const char *database,
@@*/
int HTTP_AuthenticateBasic(httpRequest *request,
- const char *database)
+ const char *database,
+ char *user,
+ int length)
{
int retval;
char message[1024];
@@ -203,6 +205,10 @@ int HTTP_AuthenticateBasic(httpRequest *request,
password++;
authorised = VerifyPassword(database, decoded, password);
+ if(user && strlen(user) < decoded_size)
+ {
+ sprintf(user,"%s", decoded);
+ }
}
}
}
diff --git a/src/http_Auth.h b/src/http_Auth.h
index 89442ec..c5bf70e 100644
--- a/src/http_Auth.h
+++ b/src/http_Auth.h
@@ -22,7 +22,9 @@ int HTTP_AuthAddUser(const char *database,
const char *encryption_scheme);
int HTTP_AuthenticateBasic(httpRequest *request,
- const char *database);
+ const char *database,
+ char *user,
+ int length);
#ifdef __cplusplus
}