diff options
-rw-r--r-- | admin.cxx | 12 | ||||
-rw-r--r-- | interchange/admin.hxx | 4 | ||||
-rw-r--r-- | interchange/member.hxx | 7 | ||||
-rw-r--r-- | member.cxx | 29 |
4 files changed, 37 insertions, 15 deletions
@@ -4,9 +4,10 @@ namespace QInterchange { - static char *unCopy, *pwCopy; + static char *unCopy, *pwCopy, *fpCopy; - void Admin::logIn(QString const& username, QString const& password) + void Admin::logIn(QString const& username, QString const& password, + QString const& failPage) { auto unData = username.toLatin1().constData(); unCopy = (char*)malloc(strlen(unData) + 1); @@ -14,9 +15,14 @@ namespace QInterchange { auto pwData = password.toLatin1().constData(); pwCopy = (char*)malloc(strlen(pwData) + 1); strcpy(pwCopy, pwData); - interchange_admin_login(unCopy, pwCopy, [](interchange_response* response) { + auto fpData = failPage.toLatin1().constData(); + fpCopy = (char*)malloc(strlen(fpData) + 1); + strcpy(fpCopy, fpData); + interchange_admin_login(unCopy, pwCopy, fpCopy, + [](interchange_response* response) { free(unCopy); free(pwCopy); + free(fpCopy); interchange_free_response(response); }, nullptr); } diff --git a/interchange/admin.hxx b/interchange/admin.hxx index 34597c2..2c0d86b 100644 --- a/interchange/admin.hxx +++ b/interchange/admin.hxx @@ -37,7 +37,9 @@ namespace QInterchange { void setSuper(bool super); public slots: - void logIn(QString const& username, QString const& password); + void logIn(QString const& username, + QString const& password, + QString const& failPage = nullptr); void newAdmin(QString const& userName, QString const& password, QString const& name, bool super, enum interchange_admin_group group); void newItem(QString const& description, QString const& comment, QString const& price, diff --git a/interchange/member.hxx b/interchange/member.hxx index c75c7a3..2cd9c49 100644 --- a/interchange/member.hxx +++ b/interchange/member.hxx @@ -101,8 +101,11 @@ namespace QInterchange { public slots: void newAccount(QString const& username, QString const& password, - QString const& confirm); - void logIn(QString const& username, QString const& password); + QString const& confirm, + QString const& failPage = nullptr); + void logIn(QString const& username, + QString const& password, + QString const& failPage = nullptr); void account(QString const& firstName, QString const& lastName, QString const& address1, QString const& address2, QString const& city, QString const& state, @@ -4,10 +4,11 @@ namespace QInterchange { - static char *unCopy, *pwCopy, *cfCopy; + static char *unCopy, *pwCopy, *vCopy, *fpCopy; void Member::newAccount(QString const& username, - QString const& password, QString const& confirm) + QString const& password, QString const& verify, + QString const& failPage) { auto unData = username.toLatin1().constData(); unCopy = (char*)malloc(strlen(unData) + 1); @@ -15,19 +16,24 @@ namespace QInterchange { auto pwData = password.toLatin1().constData(); pwCopy = (char*)malloc(strlen(pwData) + 1); strcpy(pwCopy, pwData); - auto cfData = confirm.toLatin1().constData(); - cfCopy = (char*)malloc(strlen(cfData) + 1); - strcpy(cfCopy, cfData); - interchange_member_newaccount(unCopy, pwCopy, cfCopy, + auto vData = verify.toLatin1().constData(); + vCopy = (char*)malloc(strlen(vData) + 1); + strcpy(vCopy, vData); + auto fpData = failPage.toLatin1().constData(); + fpCopy = (char*)malloc(strlen(fpData) + 1); + strcpy(fpCopy, fpData); + interchange_member_newaccount(unCopy, pwCopy, vCopy, fpCopy, [](interchange_response* response) { free(unCopy); free(pwCopy); - free(cfCopy); + free(vCopy); + free(fpCopy); interchange_free_response(response); }, nullptr); } - void Member::logIn(QString const& username, QString const& password) + void Member::logIn(QString const& username, QString const& password, + QString const& failPage) { auto unData = username.toLatin1().constData(); unCopy = (char*)malloc(strlen(unData) + 1); @@ -35,9 +41,14 @@ namespace QInterchange { auto pwData = password.toLatin1().constData(); pwCopy = (char*)malloc(strlen(pwData) + 1); strcpy(pwCopy, pwData); - interchange_member_login(unCopy, pwCopy, [](interchange_response* response) { + auto fpData = failPage.toLatin1().constData(); + fpCopy = (char*)malloc(strlen(fpData) + 1); + strcpy(fpCopy, fpData); + interchange_member_login(unCopy, pwCopy, fpCopy, + [](interchange_response* response) { free(unCopy); free(pwCopy); + free(fpCopy); interchange_free_response(response); }, nullptr); } |