summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--admin.c6
-rw-r--r--interchange/admin.h3
-rw-r--r--interchange/member.h22
-rw-r--r--login.c4
-rw-r--r--login.h9
-rw-r--r--member.c15
6 files changed, 39 insertions, 20 deletions
diff --git a/admin.c b/admin.c
index a4ea6c1..7e498a5 100644
--- a/admin.c
+++ b/admin.c
@@ -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
}
diff --git a/login.c b/login.c
index 4b529f9..bd9318c 100644
--- a/login.c
+++ b/login.c
@@ -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 *));
diff --git a/login.h b/login.h
index 37d9066..acabf85 100644
--- a/login.h
+++ b/login.h
@@ -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");
}
diff --git a/member.c b/member.c
index 29232ce..79acc77 100644
--- a/member.c
+++ b/member.c
@@ -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,