Loading plugins/contact/contact.cpp +13 −0 Changes for plugins/contact/contact.cpp: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -185,6 +185,19 @@ namespace blogi { dbpp::DBResult res; std::vector<char> sbuf; // Verification links expire after 24h (see handleVerify), but rows were only // ever removed when a link got clicked -- unclicked ones counted toward the // limit below forever, locking the address out permanently. Purge them first. { auto nowp = std::chrono::system_clock::now(); long long cutoff = std::chrono::duration_cast<std::chrono::seconds>( nowp.time_since_epoch()).count() - 86400; sql << "DELETE FROM contact_pending WHERE CAST(created_at AS BIGINT) < " << std::to_string(cutoff).c_str(); Args->database[tid]->exec(sql, res); sql.clear(); } sql << "SELECT COUNT(*) FROM contact_pending WHERE mail='" << sql.escaped(sbuf, mail.c_str()) << "'"; Args->database[tid]->exec(sql, res); Loading Loading
plugins/contact/contact.cpp +13 −0 Changes for plugins/contact/contact.cpp: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -185,6 +185,19 @@ namespace blogi { dbpp::DBResult res; std::vector<char> sbuf; // Verification links expire after 24h (see handleVerify), but rows were only // ever removed when a link got clicked -- unclicked ones counted toward the // limit below forever, locking the address out permanently. Purge them first. { auto nowp = std::chrono::system_clock::now(); long long cutoff = std::chrono::duration_cast<std::chrono::seconds>( nowp.time_since_epoch()).count() - 86400; sql << "DELETE FROM contact_pending WHERE CAST(created_at AS BIGINT) < " << std::to_string(cutoff).c_str(); Args->database[tid]->exec(sql, res); sql.clear(); } sql << "SELECT COUNT(*) FROM contact_pending WHERE mail='" << sql.escaped(sbuf, mail.c_str()) << "'"; Args->database[tid]->exec(sql, res); Loading