summaryrefslogtreecommitdiff
path: root/member.c
blob: ca3bd87f6b4119c7e2be2f67d1669d84dcb95b99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include <stdbool.h>
#include "request.h"
#include "icclient/member.h"

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)
{
	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_member_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;
}