-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProfileManager.h
executable file
·105 lines (96 loc) · 2.65 KB
/
ProfileManager.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//
//---------------------------------------------------------------------------
#ifndef ProfileManagerH
#define ProfileManagerH
//---------------------------------------------------------------------------
struct User;
//---------------------------------------------------------------------------
struct ProfileItem {
ProfileItem();
~ProfileItem();
char *sName;
bool bPermissions[256];
};
//---------------------------------------------------------------------------
class clsProfileManager {
private:
static void CreateDefaultProfiles();
ProfileItem * CreateProfile(const char * name);
public:
static clsProfileManager * mPtr;
enum ProfilePermissions {
HASKEYICON,
NODEFLOODGETNICKLIST,
NODEFLOODMYINFO,
NODEFLOODSEARCH,
NODEFLOODPM,
NODEFLOODMAINCHAT,
MASSMSG,
TOPIC,
TEMP_BAN,
REFRESHTXT,
NOTAGCHECK,
TEMP_UNBAN,
DELREGUSER,
ADDREGUSER,
NOCHATLIMITS,
NOMAXHUBCHECK,
NOSLOTHUBRATIO,
NOSLOTCHECK,
NOSHARELIMIT,
CLRPERMBAN,
CLRTEMPBAN,
GETINFO,
GETBANLIST,
RSTSCRIPTS,
RSTHUB,
TEMPOP,
GAG,
REDIRECT,
BAN,
KICK,
DROP,
ENTERFULLHUB,
ENTERIFIPBAN,
ALLOWEDOPCHAT,
SENDALLUSERIP,
RANGE_BAN,
RANGE_UNBAN,
RANGE_TBAN,
RANGE_TUNBAN,
GET_RANGE_BANS,
CLR_RANGE_BANS,
CLR_RANGE_TBANS,
UNBAN,
NOSEARCHLIMITS,
SENDFULLMYINFOS,
NOIPCHECK,
CLOSE,
NODEFLOODCTM,
NODEFLOODRCTM,
NODEFLOODSR,
NODEFLOODRECV,
NOCHATINTERVAL,
NOPMINTERVAL,
NOSEARCHINTERVAL,
NOUSRSAMEIP,
NORECONNTIME
};
uint16_t iProfileCount;
ProfileItem **ProfilesTable;
clsProfileManager();
~clsProfileManager();
bool IsAllowed(User * u, const uint32_t &iOption) const;
bool IsProfileAllowed(const int32_t &iProfile, const uint32_t &iOption) const;
int32_t AddProfile(char * name);
int32_t GetProfileIndex(const char * name);
int32_t RemoveProfileByName(char * name);
void MoveProfileDown(const uint16_t &iProfile);
void MoveProfileUp(const uint16_t &iProfile);
void ChangeProfileName(const uint16_t &iProfile, char * sName, const size_t &szLen);
void ChangeProfilePermission(const uint16_t &iProfile, const size_t &szId, const bool &bValue);
void SaveProfiles();
bool RemoveProfile(const uint16_t &iProfile);
};
//---------------------------------------------------------------------------
#endif