Added a new FileBasedUserManager class.

This commit is contained in:
Relintai 2021-08-05 19:33:37 +02:00
parent a4c28867f2
commit 0b0d2e5046
4 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#include "file_based_user_manager.h"
#include "file_based_user.h"
User *FileBasedUserManager::create_user() {
User *u = new FileBasedUser();
return u;
}
FileBasedUserManager::FileBasedUserManager() :
UserManager() {
}
FileBasedUserManager::~FileBasedUserManager() {
}

View File

@ -0,0 +1,21 @@
#ifndef FILE_BASED_USER_MANAGER_H
#define FILE_BASED_USER_MANAGER_H
#include "core/object.h"
#include "user_manager.h"
class User;
class FileBasedUserManager : public UserManager {
public:
virtual User *create_user();
FileBasedUserManager();
~FileBasedUserManager();
protected:
};
#endif

View File

@ -41,6 +41,12 @@ User *UserManager::get_user(const std::string &user_name) {
return _users[user_name];
}
User *UserManager::create_user() {
User *u = new User();
return u;
}
void UserManager::clear() {
SessionManager *sm = SessionManager::get_singleton();

View File

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