diff --git a/modules/users/file_based_user_manager.cpp b/modules/users/file_based_user_manager.cpp new file mode 100644 index 0000000..5bfe484 --- /dev/null +++ b/modules/users/file_based_user_manager.cpp @@ -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() { +} diff --git a/modules/users/file_based_user_manager.h b/modules/users/file_based_user_manager.h new file mode 100644 index 0000000..e7d6673 --- /dev/null +++ b/modules/users/file_based_user_manager.h @@ -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 \ No newline at end of file diff --git a/modules/users/user_manager.cpp b/modules/users/user_manager.cpp index b04a5fb..b0754f1 100644 --- a/modules/users/user_manager.cpp +++ b/modules/users/user_manager.cpp @@ -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(); diff --git a/modules/users/user_manager.h b/modules/users/user_manager.h index eca4c7b..7b11e92 100644 --- a/modules/users/user_manager.h +++ b/modules/users/user_manager.h @@ -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();