summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-07-16 21:29:55 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2020-07-16 21:29:55 +0800
commita385d4f20c81b190ac2556c9d57eaccd79f98cd5 (patch)
treebbbb8a1247043ebc59cf8c9e88d3bce86029eb9a
parent3f8fd4249c5ddcf2cd5952c64678cb0a484669bf (diff)
Implement changePassword
-rw-r--r--member.cxx74
-rw-r--r--qicclient/member.hxx19
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: