From e226d8b6b12a4ecb6b21546e014aaccf8a2a1c6a 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: Fri, 27 Sep 2019 16:38:36 +0800 Subject: Member implementations --- Makefile.am | 1 + member.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 member.c diff --git a/Makefile.am b/Makefile.am index 45f9332..01a392c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,7 @@ libicclient_a_SOURCES = \ request.c \ login.c \ product.c \ + member.c \ admin.c \ client.c diff --git a/member.c b/member.c new file mode 100644 index 0000000..b20e84b --- /dev/null +++ b/member.c @@ -0,0 +1,100 @@ +#include +#include "request.h" +#include "icclient/member.h" + +void icclient_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) +{ + struct curl_httppost *post, *last = NULL; + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "mv_form_profile", + CURLFORM_COPYCONTENTS, "account_change", + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "mv_todo", + CURLFORM_COPYCONTENTS, "return", + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "mv_nextpage", + CURLFORM_COPYCONTENTS, "member/account", + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "mv_check", + CURLFORM_COPYCONTENTS, "Save_database", + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "fname", + CURLFORM_PTRCONTENTS, fname, + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "lname", + CURLFORM_PTRCONTENTS, lname, + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "address1", + CURLFORM_PTRCONTENTS, address1, + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "address2", + CURLFORM_PTRCONTENTS, address2, + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "city", + CURLFORM_PTRCONTENTS, city, + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "state", + CURLFORM_PTRCONTENTS, state, + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "zip", + CURLFORM_PTRCONTENTS, zip, + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "email", + CURLFORM_PTRCONTENTS, email, + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "phone_day", + CURLFORM_PTRCONTENTS, phone_day, + CURLFORM_END); + last = NULL; + request(NULL, NULL, post, "%s", "process"); + curl_formfree(post); + post = NULL; +} + +void icclient_changepassword(const char *password_old, const char *password + , const char *verify) +{ + struct curl_httppost *post, *last = NULL; + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "mv_action", + CURLFORM_COPYCONTENTS, "return", + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "mv_check", + CURLFORM_COPYCONTENTS, "Change_password", + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "mv_successpage", + CURLFORM_COPYCONTENTS, "member/service", + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "mv_password_old", + CURLFORM_PTRCONTENTS, password_old, + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "mv_password", + CURLFORM_PTRCONTENTS, password, + CURLFORM_END); + curl_formadd(&post, &last, + CURLFORM_COPYNAME, "mv_verify", + CURLFORM_PTRCONTENTS, verify, + CURLFORM_END); + last = NULL; + request(NULL, NULL, post, "%s", "member/change_password"); + curl_formfree(post); + post = NULL; +} -- cgit v1.2.3