From a385d4f20c81b190ac2556c9d57eaccd79f98cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Thu, 16 Jul 2020 21:29:55 +0800 Subject: Implement changePassword --- member.cxx | 74 +++++++++++++++++++++++++++++----------------------- qicclient/member.hxx | 19 +++++++------- 2 files changed, 50 insertions(+), 43 deletions(-) diff --git a/member.cxx b/member.cxx index dad420d..2990e0a 100644 --- a/member.cxx +++ b/member.cxx @@ -4,39 +4,6 @@ namespace QICClient { - void Member::logIn(QString const& username, QString const& password, - QString const& successPage, QString const& nextPage, - QString const& failPage, - size_t (*handler)(void*, size_t, size_t, void*)) - { - setData(icclient_member_login(username.toLatin1().constData(), - password.toLatin1().constData(), - successPage.toLatin1().constData(), - nextPage.toLatin1().constData(), - failPage.toLatin1().constData(), - handler)); - } - - void Member::account(QString const& firstName, QString const& lastName, - QString const& address1, QString const& address2, - QString const& city, QString const& state, QString const& zip, - QString const& email, QString const& phoneDay) - { - icclient_member_account(firstName.toLatin1().constData(), - lastName.toLatin1().constData(), - address1.toLatin1().constData(), - address2.toLatin1().constData(), - city.toLatin1().constData(), state.toLatin1().constData(), - zip.toLatin1().constData(), email.toLatin1().constData(), - phoneDay.toLatin1().constData()); - } - - void Member::logOut() - { - icclient_member_logout(m_data); - setData(nullptr); - } - void Member::setUserName(QString const& userName) { if (m_userName != userName) { @@ -270,4 +237,45 @@ namespace QICClient { } else setEmail(""); } + void Member::logIn(QString const& username, QString const& password, + QString const& successPage, QString const& nextPage, + QString const& failPage, + size_t (*handler)(void*, size_t, size_t, void*)) + { + setData(icclient_member_login(username.toLatin1().constData(), + password.toLatin1().constData(), + successPage.toLatin1().constData(), + nextPage.toLatin1().constData(), + failPage.toLatin1().constData(), + handler)); + } + + void Member::account(QString const& firstName, QString const& lastName, + QString const& address1, QString const& address2, + QString const& city, QString const& state, QString const& zip, + QString const& email, QString const& phoneDay) + { + icclient_member_account(firstName.toLatin1().constData(), + lastName.toLatin1().constData(), + address1.toLatin1().constData(), + address2.toLatin1().constData(), + city.toLatin1().constData(), state.toLatin1().constData(), + zip.toLatin1().constData(), email.toLatin1().constData(), + phoneDay.toLatin1().constData()); + } + + void Member::changePassword(QString const& passwordOld, QString const& password, + QString const& verify) + { + icclient_member_changepassword(passwordOld.toLatin1().constData(), + password.toLatin1().constData(), + verify.toLatin1().constData()); + } + + void Member::logOut() + { + icclient_member_logout(m_data); + setData(nullptr); + } + } diff --git a/qicclient/member.hxx b/qicclient/member.hxx index aac831e..86289c0 100644 --- a/qicclient/member.hxx +++ b/qicclient/member.hxx @@ -57,16 +57,6 @@ namespace QICClient { {} ~Member() {} - void logIn(QString const& username, QString const& password, - QString const& successPage = nullptr, - QString const& nextPage = nullptr, - QString const& failPage = nullptr, - size_t (*handler)(void*, size_t, size_t, - void*) = nullptr); - void changePassword(QString const& passwordOld, - QString const& password, - QString const& verify) {} - QString const& userName() const { return m_userName; } QString const& userNick() const { return m_userNick; } QString const& password() const { return m_password; } @@ -107,12 +97,21 @@ namespace QICClient { void setPhoneDay(QString const& phoneDay); void setEmail(QString const& email); + void logIn(QString const& username, QString const& password, + QString const& successPage = nullptr, + QString const& nextPage = nullptr, + QString const& failPage = nullptr, + size_t (*handler)(void*, size_t, size_t, + void*) = nullptr); + public slots: void account(QString const& firstName, QString const& lastName, QString const& address1, QString const& address2, QString const& city, QString const& state, QString const& zip, QString const& email, QString const& phoneDay); + void changePassword(QString const& passwordOld, + QString const& password, QString const& verify); void logOut(); signals: -- cgit v1.2.3