From 1a1f3c047d36dd59958d3dba6e4fa690d2178fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Sat, 11 Jul 2020 10:29:39 +0800 Subject: Move newaccount, login, logout to member namespace --- member.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'member.c') diff --git a/member.c b/member.c index ca3bd87..b8076d0 100644 --- a/member.c +++ b/member.c @@ -1,7 +1,25 @@ +#include #include -#include "request.h" +#include "login.h" #include "icclient/member.h" +void icclient_member_newaccount(size_t (*handler)(void *, size_t, size_t, void *), + struct icclient_member *member, const char *username, const char *password, + const char *verify, const char *successpage, const char *nextpage, + const char *failpage) +{ + login(handler, member, username, password, verify, "NewAccount", successpage, + nextpage, failpage); +} + +void icclient_member_login(size_t (*handler)(void *, size_t, size_t, void *), + struct icclient_member *member, const char *username, const char *password, + const char *successpage, const char *nextpage, const char *failpage) +{ + login(handler, member, username, password, NULL, "Login", successpage, nextpage, + failpage); +} + void icclient_member_account(const char *fname, const char *lname, const char *address1, const char *address2, const char *city, const char *state, const char *zip, const char *email, const char *phone_day) @@ -98,3 +116,8 @@ void icclient_member_changepassword(const char *password_old, const char *passwo curl_formfree(post); post = NULL; } + +void icclient_member_logout() +{ + request(NULL, NULL, NULL, "%s", "logout"); +} -- cgit v1.2.3