diff options
-rw-r--r-- | admin.c | 6 | ||||
-rw-r--r-- | interchange/admin.h | 3 | ||||
-rw-r--r-- | interchange/member.h | 22 | ||||
-rw-r--r-- | login.c | 4 | ||||
-rw-r--r-- | login.h | 9 | ||||
-rw-r--r-- | member.c | 15 |
6 files changed, 39 insertions, 20 deletions
@@ -6,10 +6,12 @@ #include "interchange/ord.h" #include "interchange/admin.h" -void interchange_admin_login(const char *username, const char *password, void (*handler)(interchange_response *), +void interchange_admin_login(const char *username, const char *password, + const char *failpage, void (*handler)(interchange_response *), void (*callback)(struct interchange_admin *)) { - login(username, password, NULL, "MMLogin", handler, (void (*)(void *))callback); + login(username, password, NULL, "MMLogin", failpage, handler, + (void (*)(void *))callback); } void interchange_admin_new_admin(const char *username, const char *password, const char *name, bool super, diff --git a/interchange/admin.h b/interchange/admin.h index d0e47d7..50a0957 100644 --- a/interchange/admin.h +++ b/interchange/admin.h @@ -21,7 +21,8 @@ struct interchange_admin { extern "C" { #endif -void interchange_admin_login(const char *username, const char *password, void (*handler)(interchange_response *), +void interchange_admin_login(const char *username, const char *password, + const char *failpage, void (*handler)(interchange_response *), void (*callback)(struct interchange_admin *)); void interchange_admin_new_admin(const char *username, const char *password, const char *name, bool super, enum interchange_admin_group group, void (*handler)(interchange_response *)); diff --git a/interchange/member.h b/interchange/member.h index 0e9ca91..b44b1f5 100644 --- a/interchange/member.h +++ b/interchange/member.h @@ -63,14 +63,20 @@ struct interchange_member { extern "C" { #endif - void interchange_member_newaccount(const char *username, const char *password, const char *verify, - void (*handler)(interchange_response *), void (*callback)(struct interchange_member *)); - void interchange_member_login(const char *username, const char *password, void (*handler)(interchange_response *), - void (*callback)(struct interchange_member *)); - void interchange_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); - void interchange_member_changepassword(const char *password_old, const char *password, const char *verify); - void interchange_member_logout(struct interchange_member *member); +void interchange_member_newaccount(const char *username, const char *password, + const char *verify, const char *failpage, + void (*handler)(interchange_response *), + void (*callback)(struct interchange_member *)); +void interchange_member_login(const char *username, const char *password, + const char *failpage, void (*handler)(interchange_response *), + void (*callback)(struct interchange_member *)); +void interchange_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); +void interchange_member_changepassword(const char *password_old, + const char *password, const char *verify); +void interchange_member_logout(struct interchange_member *member); #ifdef __cplusplus } @@ -1,3 +1,5 @@ #include "login.h" -extern inline void login(const char *, const char *, const char *, const char *, void (*)(interchange_response *), void (*)(void *)); +extern inline void login(const char *, const char *, const char *, const char *, + const char *, void (*)(interchange_response *), + void (*)(void *)); @@ -3,14 +3,17 @@ #include "request.h" -static inline void login(const char *username, const char *password, const char *verify, const char *click, - void (*handler)(interchange_response *), void (*callback)(void *)) +static inline void login(const char *username, const char *password, + const char *verify, const char *click, const char *failpage, + void (*handler)(interchange_response *), + void (*callback)(void *)) { - request(handler, callback, &(struct body){ 4, { + request(handler, callback, &(struct body){ 4 + (failpage ? 1 : 0), { { "mv_username", username }, { "mv_password", password }, { "mv_verify", verify }, { "mv_click", click }, + { "mv_failpage", failpage }, }}, "%s", "process"); } @@ -2,16 +2,21 @@ #include "login.h" #include "interchange/member.h" -void interchange_member_newaccount(const char *username, const char *password, const char *verify, - void (*handler)(interchange_response *), void (*callback)(struct interchange_member *)) +void interchange_member_newaccount(const char *username, const char *password, + const char *verify, const char *failpage, + void (*handler)(interchange_response *), + void (*callback)(struct interchange_member *)) { - login(username, password, verify, "NewAccount", handler, (void (*)(void *))callback); + login(username, password, verify, "NewAccount", failpage, handler, + (void (*)(void *))callback); } -void interchange_member_login(const char *username, const char *password, void (*handler)(interchange_response *), +void interchange_member_login(const char *username, const char *password, + const char *failpage, void (*handler)(interchange_response *), void (*callback)(struct interchange_member *)) { - login(username, password, NULL, "Login", handler, (void (*)(void *))callback); + login(username, password, NULL, "Login", failpage, handler, + (void (*)(void *))callback); } void interchange_member_account(const char *fname, const char *lname, const char *address1, |