2 ** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for
3 ** distribution information.
7 #include "courier_auth_config.h"
19 #include "authsqlite.h"
21 int auth_sqlite_pre(const char *user
, const char *service
,
22 int (*callback
)(struct authinfo
*, void *), void *arg
)
24 struct authsqliteuserinfo
*authinfo
;
27 authinfo
=auth_sqlite_getuserinfo(user
, service
);
29 if (!authinfo
) /* Fatal error - such as Sqlite being down */
32 if (!authinfo
->home
) /* User not found */
35 memset(&aa
, 0, sizeof(aa
));
37 /*aa.sysusername=user;*/
38 aa
.sysuserid
= &authinfo
->uid
;
39 aa
.sysgroupid
= authinfo
->gid
;
40 aa
.homedir
=authinfo
->home
;
41 aa
.maildir
=authinfo
->maildir
&& authinfo
->maildir
[0] ?
43 aa
.address
=authinfo
->username
;
44 aa
.passwd
=authinfo
->cryptpw
;
45 aa
.clearpasswd
=authinfo
->clearpw
;
46 aa
.fullname
=authinfo
->fullname
;
47 aa
.quota
=authinfo
->quota
&& authinfo
->quota
[0] ?
49 aa
.options
=authinfo
->options
;
50 return ((*callback
)(&aa
, arg
));