]>
Commit | Line | Data |
---|---|---|
dbbee796 | 1 | #define CS_NODB |
3294b10b | 2 | #include "../chanserv/chanserv.h" |
dbbee796 | 3 | #undef CS_NODB |
3294b10b | 4 | |
5857b2db P |
5 | #include "../lib/version.h" |
6 | ||
7 | MODULE_VERSION(QVERSION); | |
8 | ||
3294b10b CP |
9 | const flag rcflags[] = { |
10 | { 'a', QCFLAG_AUTOOP }, | |
11 | { 'b', QCFLAG_BITCH }, | |
12 | { 'c', QCFLAG_AUTOLIMIT }, | |
13 | { 'e', QCFLAG_ENFORCE }, | |
14 | { 'f', QCFLAG_FORCETOPIC }, | |
15 | { 'g', QCFLAG_AUTOVOICE }, | |
16 | { 'i', QCFLAG_INFO }, | |
17 | { 'j', QCFLAG_JOINED }, | |
18 | { 'k', QCFLAG_KNOWNONLY }, | |
19 | { 'p', QCFLAG_PROTECT }, | |
20 | { 's', QCFLAG_NOINFO }, | |
21 | { 't', QCFLAG_TOPICSAVE }, | |
22 | { 'v', QCFLAG_VOICEALL }, | |
23 | { 'w', QCFLAG_WELCOME }, | |
24 | { 'z', QCFLAG_SUSPENDED }, | |
25 | { '\0', 0 } }; | |
26 | ||
27 | const flag rcuflags[] = { | |
28 | { 'a', QCUFLAG_AUTOOP }, | |
29 | { 'b', QCUFLAG_BANNED }, | |
30 | { 'd', QCUFLAG_DENY }, | |
31 | { 'g', QCUFLAG_AUTOVOICE }, | |
32 | { 'i', QCUFLAG_INFO }, | |
33 | { 'j', QCUFLAG_AUTOINVITE }, | |
34 | { 'k', QCUFLAG_KNOWN }, | |
35 | { 'm', QCUFLAG_MASTER }, | |
36 | { 'n', QCUFLAG_OWNER }, | |
37 | { 'o', QCUFLAG_OP }, | |
38 | { 'p', QCUFLAG_PROTECT }, | |
39 | { 'q', QCUFLAG_QUIET }, | |
40 | { 's', QCUFLAG_NOINFO }, | |
41 | { 't', QCUFLAG_TOPIC }, | |
42 | { 'v', QCUFLAG_VOICE }, | |
43 | { 'w', QCUFLAG_HIDEWELCOME }, | |
44 | ||
45 | { '\0', 0 } }; | |
46 | ||
47 | const flag ruflags[] = { | |
48 | { 'a', QUFLAG_ADMIN }, | |
49 | { 'd', QUFLAG_DEV }, | |
50 | { 'D', QUFLAG_CLEANUPEXEMPT }, | |
51 | { 'g', QUFLAG_GLINE }, | |
52 | { 'G', QUFLAG_DELAYEDGLINE }, | |
53 | { 'h', QUFLAG_HELPER }, | |
54 | { 'i', QUFLAG_INFO }, | |
55 | { 'L', QUFLAG_NOAUTHLIMIT }, | |
56 | { 'n', QUFLAG_NOTICE }, | |
57 | { 'o', QUFLAG_OPER }, | |
58 | { 'p', QUFLAG_PROTECT }, | |
59 | { 'q', QUFLAG_STAFF }, | |
60 | { 's', QUFLAG_NOINFO }, | |
61 | { 'T', QUFLAG_TRUST }, | |
62 | { 'z', QUFLAG_SUSPENDED }, | |
63 | { '\0', 0 } }; | |
64 | ||
65 | const flag mdflags[] = { | |
66 | { 'l', MDFLAG_LIMIT }, | |
67 | { 'b', MDFLAG_BANNED }, | |
68 | { 'u', MDFLAG_ACTLIMIT }, | |
69 | { '\0', 0 } }; | |
70 | ||
92acf9ae | 71 | u_int64_t cs_accountflagmap(reguser *rup) { |
3294b10b CP |
72 | authname a2, *a = &a2; |
73 | a->flags = 0; | |
74 | ||
75 | if(UIsOper(rup)) | |
76 | SetOperFlag(a); | |
77 | ||
78 | if(UIsDev(rup)) | |
79 | SetDeveloper(a); | |
80 | ||
81 | if(UIsAdmin(rup)) | |
82 | SetAdmin(a); | |
83 | ||
84 | if(UIsStaff(rup)) | |
85 | SetStaff(a); | |
86 | ||
87 | if(UIsHelper(rup)) | |
88 | SetSupport(a); | |
89 | ||
90 | return a->flags; | |
91 | } | |
92 | ||
92acf9ae | 93 | u_int64_t cs_accountflagmap_str(char *flags) { |
3294b10b CP |
94 | reguser r2, *r = &r2; |
95 | ||
96 | setflags(&r->flags, QUFLAG_ALL, flags, ruflags, REJECT_NONE); | |
97 | ||
98 | return cs_accountflagmap(r); | |
99 | } |