#ifndef __USER_H__ #define __USER_H__ #include #include #include #include #include class User { public: enum Role { Visitor = 0, Admin = 1, }; User(); static Wt::Dbo::dbo_traits::IdType stringToId(const std::string &s); Wt::WString name; Role role; int failedLoginAttempts; Wt::WDateTime lastLoginAttempt; std::string oAuthId; std::string oAuthProvider; template void persist(Action &a) { Wt::Dbo::field(a, name, "name"); Wt::Dbo::field(a, failedLoginAttempts, "failed_login_attempts"); Wt::Dbo::field(a, lastLoginAttempt, "last_login_attempt"); Wt::Dbo::field(a, oAuthId, "oauth_id"); Wt::Dbo::field(a, oAuthProvider, "oauth_provider"); } }; DBO_EXTERN_TEMPLATES(User) #endif // __USER_H__