-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMgrUser.h
44 lines (39 loc) · 915 Bytes
/
MgrUser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once
#include <vector>
#include <algorithm>
using namespace std;
#include "ZBase64.h"
#include "ConfigEnumDef.h"
struct SUsrInfo{
enAdminType type;
char name[100];
char pwd[100];
SUsrInfo(){
type = ENUM_TYPE_USER;
memset(name, 0, 100 * sizeof(char));
memset(pwd, 0, 100 * sizeof(char));
}
};
class CMgrUser
{
public:
CMgrUser(void);
~CMgrUser(void);
bool ReadUser(char* path);
void SaveUser(char* path);
void ModifySuperPWD(char* pwd);
void ModifyAdminPWD(char* pwd);
void ModifyUserPWD(char* name, char* pwd);
void ModifyPWD(char* name, char* pwd);
int GetUserType(char* name);
void GetUser(char* name, SUsrInfo& user);
bool AddUser(char* name, char* pwd);
bool RemoveUser(char* name);
SUsrInfo* GetUser(int& nNum);
void ResetAllPwd();
void ResetPwd(char* name);
private:
void InitUser();
private:
vector<SUsrInfo> m_vecUser;
};