diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-27 16:38:36 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-27 16:38:36 +0800 |
commit | e226d8b6b12a4ecb6b21546e014aaccf8a2a1c6a (patch) | |
tree | 7336f78e73eea997380bc19f7c030e58abd15a6d | |
parent | 97d3d5efa1d463df7440c04c429e1adfb8b02568 (diff) |
Member implementations
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | member.c | 100 |
2 files changed, 101 insertions, 0 deletions
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 <stdbool.h> +#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; +} |