| 1 | #ifndef authmysql_h |
| 2 | #define authmysql_h |
| 3 | |
| 4 | #include "courier_auth_config.h" |
| 5 | #include <stdlib.h> |
| 6 | #include <sys/types.h> |
| 7 | #include <mysql.h> |
| 8 | #include <errmsg.h> |
| 9 | |
| 10 | #include <string> |
| 11 | |
| 12 | class authmysqluserinfo { |
| 13 | public: |
| 14 | std::string username; |
| 15 | std::string fullname; |
| 16 | std::string cryptpw; |
| 17 | std::string clearpw; |
| 18 | std::string home; |
| 19 | std::string maildir; |
| 20 | std::string quota; |
| 21 | std::string options; |
| 22 | uid_t uid; |
| 23 | gid_t gid; |
| 24 | }; |
| 25 | |
| 26 | bool auth_mysql_getuserinfo(const char *username, |
| 27 | const char *service, |
| 28 | authmysqluserinfo &uiret); |
| 29 | |
| 30 | extern void auth_mysql_cleanup(); |
| 31 | |
| 32 | extern bool auth_mysql_setpass(const char *, const char *, const char *); |
| 33 | |
| 34 | struct authinfo; |
| 35 | |
| 36 | extern int auth_mysql_pre(const char *, const char *, |
| 37 | int (*)(struct authinfo *, void *), void *arg); |
| 38 | |
| 39 | extern void auth_mysql_enumerate( void(*cb_func)(const char *name, |
| 40 | uid_t uid, |
| 41 | gid_t gid, |
| 42 | const char *homedir, |
| 43 | const char *maildir, |
| 44 | const char *options, |
| 45 | void *void_arg), |
| 46 | void *void_arg); |
| 47 | |
| 48 | |
| 49 | #endif |