From 7f48c099e071a0c952882307abfeb44b89e7969d Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 3 Aug 2021 21:10:24 +0200 Subject: [PATCH] Added more properties to the user class, and a few virtual methods. --- modules/users/user.cpp | 26 ++++++++++++++++++++++++++ modules/users/user.h | 11 +++++++++++ 2 files changed, 37 insertions(+) diff --git a/modules/users/user.cpp b/modules/users/user.cpp index 1b78b04..4061e13 100644 --- a/modules/users/user.cpp +++ b/modules/users/user.cpp @@ -1,8 +1,34 @@ #include "user.h" +void User::save() { + +} + +void User::load() { + +} + +void User::load(const std::string &p_name) { + name = p_name; + + load(); +} + +void User::changed() { + save(); +} + +void User::update() { + +} + User::User() : Object() { + id = 0; + rank = 0; + banned = false; + locked = false; } User::~User() { diff --git a/modules/users/user.h b/modules/users/user.h index b51bb36..f727cae 100644 --- a/modules/users/user.h +++ b/modules/users/user.h @@ -4,6 +4,7 @@ #include "core/object.h" #include +#include class User : public Object { public: @@ -14,6 +15,16 @@ public: std::string pre_salt; std::string post_salt; std::string password_hash; + bool banned; + std::vector sessions; + std::string password_reset_token; + bool locked; + + virtual void save(); + virtual void load(); + virtual void load(const std::string &p_name); + virtual void changed(); + virtual void update(); User(); ~User();