src/server/public/auth.h

changeset 467
4d038bc6f86e
parent 415
d938228c382e
equal deleted inserted replaced
466:019c22775f7c 467:4d038bc6f86e
29 #ifndef WS_AUTH_H 29 #ifndef WS_AUTH_H
30 #define WS_AUTH_H 30 #define WS_AUTH_H
31 31
32 #include <sys/types.h> 32 #include <sys/types.h>
33 33
34 #include "nsapi.h"
35
34 #ifdef __cplusplus 36 #ifdef __cplusplus
35 extern "C" { 37 extern "C" {
36 #endif 38 #endif
37 39
38 #ifdef XP_WIN32 40 #ifdef XP_WIN32
47 * get a user from the authentication database 49 * get a user from the authentication database
48 * 50 *
49 * param1: authentication database 51 * param1: authentication database
50 * param2: user 52 * param2: user
51 */ 53 */
52 typedef User*(*authdb_get_user_f)(AuthDB*, const char*); 54 typedef User*(*authdb_get_user_f)(AuthDB*, Session*, Request*, const char*);
53 55
54 struct auth_db { 56 struct auth_db {
55 char *name; 57 char *name;
56 /* User* get_user(AuthDB *db, char *username) */ 58 /* User* get_user(AuthDB *db, Session *sn, Request *rq, char *username) */
57 authdb_get_user_f get_user; 59 authdb_get_user_f get_user;
58 int use_cache; 60 int use_cache;
59 }; 61 };
60 62
61 /* 63 /*
91 /* void free(User*) */ 93 /* void free(User*) */
92 user_free_f free; 94 user_free_f free;
93 }; 95 };
94 96
95 97
96 User* authdb_get_user(AuthDB *db, const char *user); 98 User* authdb_get_user(AuthDB *db, Session *sn, Request *rq, const char *user);
97 User* authdb_get_and_verify(AuthDB *db, const char *user, const char *password, int *pw); 99 User* authdb_get_and_verify(AuthDB *db, Session *sn, Request *rq, const char *user, const char *password, int *pw);
98 100
99 #ifdef __cplusplus 101 #ifdef __cplusplus
100 } 102 }
101 #endif 103 #endif
102 104

mercurial