Skip to content

Commit

Permalink
upgrade to libpqxx 6.1.0 api
Browse files Browse the repository at this point in the history
  • Loading branch information
NuLL3rr0r committed Mar 7, 2018
1 parent 095d0f9 commit bf633b2
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Service/Cms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ void Cms::Impl::ValidateSession()

string expiry("0");
if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
expiry = row["expiry"].c_str();
}

Expand Down
2 changes: 1 addition & 1 deletion Service/CmsChangeEmail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void CmsChangeEmail::Impl::OnEmailChangeFormSubmitted()
result r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);

string hashedPwd(row["pwd"].c_str());
Pool::Crypto().Decrypt(hashedPwd, hashedPwd);
Expand Down
2 changes: 1 addition & 1 deletion Service/CmsChangePassword.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void CmsChangePassword::Impl::OnPasswordChangeFormSubmitted()
result r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);

string hashedPwd(row["pwd"].c_str());
Pool::Crypto().Decrypt(hashedPwd, hashedPwd);
Expand Down
4 changes: 2 additions & 2 deletions Service/CmsContacts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ void CmsContacts::Impl::OnCellSaveButtonPressed(Wt::WInPlaceEdit *inPlaceEdit)
r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
const string recipientKey(row["recipient"].c_str());

if (recipient != recipientKey) {
Expand Down Expand Up @@ -477,7 +477,7 @@ void CmsContacts::Impl::OnEraseButtonPressed(Wt::WPushButton *button)
result r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
const string recipient_fa(row["recipient_fa"].c_str());
question = tr("cms-contacts-erase-confirm-question").arg(WString::fromUTF8(recipient_fa));
}
Expand Down
2 changes: 1 addition & 1 deletion Service/CmsNewsletter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void CmsNewsletter::Impl::OnSendConfirmDialogClosed(Wt::StandardButton button)
string homePageUrl;
string homePageTitle;
if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
homePageUrl.assign(row[0].c_str());
homePageTitle.assign(row[1].c_str());
}
Expand Down
2 changes: 1 addition & 1 deletion Service/CmsSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ WWidget *CmsSettings::Layout()
result r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
const string homepage_url_en(row["homepage_url_en"].c_str());
const string homepage_url_fa(row["homepage_url_fa"].c_str());
const string homepage_title_en(row["homepage_title_en"].c_str());
Expand Down
4 changes: 2 additions & 2 deletions Service/ContactForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ void ContactForm::Impl::OnContactFormSubmitted()
result r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
email.assign(row["address"].c_str());
}
} else {
Expand All @@ -377,7 +377,7 @@ void ContactForm::Impl::OnContactFormSubmitted()
result r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
email.assign(row["email"].c_str());
}
}
Expand Down
12 changes: 6 additions & 6 deletions Service/RootLogin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ RootLogin::RootLogin()

string expiry("0");
if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
expiry = row["expiry"].c_str();
}

Expand Down Expand Up @@ -189,7 +189,7 @@ RootLogin::RootLogin()
r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);

CgiEnv::InformationRecord::ClientRecord::SessionRecord record;
record.UserId = row["user_id"].c_str();
Expand Down Expand Up @@ -443,7 +443,7 @@ void RootLogin::Impl::OnLoginFormSubmitted()
result r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);

userId = row["user_id"].c_str();
username = row["username"].c_str();
Expand Down Expand Up @@ -553,7 +553,7 @@ void RootLogin::Impl::OnLoginFormSubmitted()
r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);

record.LastLogin.Time = lexical_cast<time_t>(row["login_time"].c_str());
record.LastLogin.IPAddress = row["ip_address"].c_str();
Expand Down Expand Up @@ -667,7 +667,7 @@ void RootLogin::Impl::OnPasswordRecoveryFormSubmitted()
CDate::Now n(CDate::Timezone::UTC);
time_t expiry = n.RawTime() + Pool::Storage().ResetPwdLifespan();

const result::tuple row(r[0]);
const pqxx::row row(r[0]);
string userId(row["user_id"].c_str());
string username(row["username"].c_str());

Expand Down Expand Up @@ -797,7 +797,7 @@ void RootLogin::Impl::OnGoToHomePageButtonPressed()

string homePageUrl;
if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
homePageUrl.assign(row[0].c_str());
}

Expand Down
12 changes: 6 additions & 6 deletions Service/Subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void Subscription::Impl::OnSubscribeFormSubmitted()
"inbox, uuid, subscription, pending_confirm, pending_cancel, join_date, update_date",
{ inbox, uuid, "none", pendingConfirm, "none", date, date });
} else {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
uuid.assign(row["uuid"].c_str());

Pool::Database().Update("SUBSCRIBERS",
Expand Down Expand Up @@ -631,7 +631,7 @@ Wt::WWidget *Subscription::Impl::GetConfirmationPage()
CDate::Now n(CDate::Timezone::UTC);
string date(lexical_cast<std::string>(n.RawTime()));

const result::tuple row(r[0]);
const pqxx::row row(r[0]);
const string inbox(row["inbox"].c_str());
const string subscription(row["subscription"].c_str());
const string pendingConfirm(row["pending_confirm"].c_str());
Expand Down Expand Up @@ -804,7 +804,7 @@ Wt::WWidget *Subscription::Impl::GetUnsubscribeForm()
return tmpl;
}

const result::tuple row(r[0]);
const pqxx::row row(r[0]);
const string inbox(row["inbox"].c_str());
const string subscription(row["subscription"].c_str());

Expand Down Expand Up @@ -1040,7 +1040,7 @@ Wt::WWidget *Subscription::Impl::GetCancellationPage()
return tmpl;
}

const result::tuple row(r[0]);
const pqxx::row row(r[0]);
const string inbox(row["inbox"].c_str());
const string subscription(row["subscription"].c_str());
const string pendingCancel(row["pending_cancel"].c_str());
Expand Down Expand Up @@ -1191,7 +1191,7 @@ void Subscription::Impl::GetMessageTemplate(WTemplate *tmpl, const Wt::WString &
result r = txn.exec(query);

if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
const string homePageUrl(row[0].c_str());
const string homePageTitle(row[1].c_str());

Expand Down Expand Up @@ -1353,7 +1353,7 @@ void Subscription::Impl::SendMessage(const Message &type, const string &uuid, co
string homePageUrl;
string homePageTitle;
if (!r.empty()) {
const result::tuple row(r[0]);
const pqxx::row row(r[0]);
homePageUrl.assign(row[0].c_str());
homePageTitle.assign(row[1].c_str());
}
Expand Down

0 comments on commit bf633b2

Please sign in to comment.