Added load_all virtual to UserManager. Also added set_path to FileBasedUserManager.

This commit is contained in:
Relintai 2021-08-05 19:42:33 +02:00
parent fb5a059e2e
commit 11d1d7327a
6 changed files with 22 additions and 0 deletions

View File

@ -6,6 +6,7 @@
#include <rapidjson/writer.h>
#include <tinydir/tinydir.h>
#include <cstdio>
#include "user_manager.h"
std::string FileBasedUser::get_path() {
return _path;
@ -114,6 +115,10 @@ void FileBasedUser::load() {
register_sessions();
}
void FileBasedUser::load_all() {
}
FileBasedUser::FileBasedUser() :
User() {
}

View File

@ -12,6 +12,8 @@ public:
void load(const std::string &p_name);
void load();
static void load_all();
FileBasedUser();
~FileBasedUser();

View File

@ -8,6 +8,14 @@ User *FileBasedUserManager::create_user() {
return u;
}
void FileBasedUserManager::load_all() {
FileBasedUser::load_all();
}
void FileBasedUserManager::set_path(const std::string &path) {
FileBasedUser::set_path(path);
}
FileBasedUserManager::FileBasedUserManager() :
UserManager() {
}

View File

@ -11,6 +11,9 @@ class FileBasedUserManager : public UserManager {
public:
virtual User *create_user();
void load_all();
void set_path(const std::string &path);
FileBasedUserManager();
~FileBasedUserManager();

View File

@ -47,6 +47,9 @@ User *UserManager::create_user() {
return u;
}
void UserManager::load_all() {
}
void UserManager::clear() {
SessionManager *sm = SessionManager::get_singleton();

View File

@ -16,6 +16,7 @@ public:
void remove_user(User *user);
User *get_user(const std::string &user_name);
virtual User *create_user();
virtual void load_all();
void clear();