mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Added a new FileBasedUserManager class.
This commit is contained in:
parent
a4c28867f2
commit
0b0d2e5046
16
modules/users/file_based_user_manager.cpp
Normal file
16
modules/users/file_based_user_manager.cpp
Normal 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() {
|
||||
}
|
21
modules/users/file_based_user_manager.h
Normal file
21
modules/users/file_based_user_manager.h
Normal 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
|
@ -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();
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user