diff --git a/login_server/src/cpp/controller/User.cpp b/login_server/src/cpp/controller/User.cpp index 576b2b8c8..e03916bc9 100644 --- a/login_server/src/cpp/controller/User.cpp +++ b/login_server/src/cpp/controller/User.cpp @@ -446,8 +446,9 @@ namespace controller { std::vector> results; int email_checked = 0; int resend_count = 1; - select << "select u.id, v.created from users as u " - << "LEFT JOIN email_opt_in as v ON(u.id = v.user_id) " + std::string table_name_email_opt_in = "login_email_opt_in"; + select << "select u.id, v.created from " << db->getTableName() << " as u " + << "LEFT JOIN " << table_name_email_opt_in << " as v ON(u.id = v.user_id) " << "where u.email_checked = ? " << "AND v.resend_count <= ? " << "ORDER BY u.id, v.created " , @@ -525,8 +526,8 @@ namespace controller { Poco::Data::Statement select(session); std::vector> results; - select << "select id, email from users " - << "where email_hash IS NULL " + select << "select id, email from " << db->getTableName() + << " where email_hash IS NULL " , Poco::Data::Keywords::into(results) ; int result_count = 0; @@ -556,7 +557,7 @@ namespace controller { // update db // reuse connection, I hope it's working Poco::Data::Statement update(session); - update << "UPDATE users set email_hash = ? where id = ?" + update << "UPDATE " << db->getTableName() << " set email_hash = ? where id = ?" , Poco::Data::Keywords::use(updates); int updated_count = 0; try {