123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #ifndef USER_MANAGER_H
- #define USER_MANAGER_H
- #include <fstream>
- #include <iostream>
- #include <map>
- #include <sstream>
- #include <string>
- #include <vector>
- class UserManager {
- public:
-
- static void init(const std::string &file);
-
- static bool isAllowed(const std::string &user, const std::string &pw);
-
- static bool addUser(const std::string &name, const std::string &pw);
-
- static bool deleteUser(const std::string &name, const std::string &pw);
- private:
-
- static std::string filename;
-
- static void readFromFile(std::map<std::string, std::string> &user_map);
-
- static void writeToFile(std::map<std::string, std::string> &user_map);
- };
- #endif
|