summaryrefslogtreecommitdiff
path: root/member.c
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-07-11 10:29:39 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-07-11 10:29:39 +0800
commit1a1f3c047d36dd59958d3dba6e4fa690d2178fec (patch)
treeac1081e0805baa55bf7895046f963f9508c0c3e9 /member.c
parent6ff383c3d12dc215123fb975b453ca74b1bef162 (diff)
Move newaccount, login, logout to member namespace
Diffstat (limited to 'member.c')
-rw-r--r--member.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/member.c b/member.c
index ca3bd87..b8076d0 100644
--- a/member.c
+++ b/member.c
@@ -1,7 +1,25 @@
+#include <stddef.h>
#include <stdbool.h>
-#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");
+}