]>
Commit | Line | Data |
---|---|---|
fb27b14a VP |
1 | <?php |
2 | ||
3 | /** | |
4 | * A set of reference lists | |
5 | */ | |
6 | class IRCList { | |
43a6787a VP |
7 | |
8 | public static $cmodes = | |
fb27b14a VP |
9 | [ |
10 | "a" => [ | |
11 | "name" => "Admin", | |
12 | "description" => "Marks someone as channel admin (&)", | |
13 | "requires" => "Admin" | |
14 | ], | |
15 | "b" => [ | |
16 | "name" => "Ban", | |
17 | "description" => "Marks a ban from a channel", | |
18 | "requires" => "HalfOp" | |
19 | ], | |
20 | "c" => [ | |
d69960b4 P |
21 | "name" => "No colors", |
22 | "description" => "Block messages containing mIRC color codes", | |
23 | "requires" => "Operator" | |
fb27b14a | 24 | ], |
43a6787a VP |
25 | "d" => [ |
26 | "name" => "Delay Join", | |
62df9636 | 27 | "description" => "Indicates there are invisible users left over due to unsetting 'D'", |
ae7257d0 | 28 | "requires" => "Server" |
43a6787a | 29 | ], |
fb27b14a VP |
30 | "e" => [ |
31 | "name" => "Ban Exemption", | |
32 | "description" => "Marks an exemption from channel bans", | |
33 | "requires" => "HalfOp" | |
34 | ], | |
35 | "f" => [ | |
36 | "name" => "Flood Protection", | |
37 | "description" => "Implements channel flood protection", | |
38 | "requires" => "Operator" | |
39 | ], | |
40 | "h" => [ | |
41 | "name" => "Half Op", | |
62df9636 | 42 | "description" => "Marks someone as channel halfop (%)", |
fb27b14a VP |
43 | "requires" => "Operator" |
44 | ], | |
45 | "i" => [ | |
46 | "name" => "Invite Only", | |
9ea27dec | 47 | "description" => "Requires an invitation to join", |
fb27b14a VP |
48 | "requires" => "HalfOp" |
49 | ], | |
50 | "k" => [ | |
51 | "name" => "Key", | |
52 | "description" => "Requires a key/password to join", | |
53 | "requires" => "HalfOp" | |
54 | ], | |
55 | "l" => [ | |
56 | "name" => "Limit", | |
57 | "description" => "Limits a channel to a specific amount of users", | |
58 | "requires" => "HalfOp" | |
59 | ], | |
60 | "m" => [ | |
61 | "name" => "Moderation", | |
62 | "description" => "Prevents non-voiced users from speaking in a channel", | |
63 | "requires" => "HalfOp" | |
64 | ], | |
65 | "n" => [ | |
66 | "name" => "No External Messages", | |
67 | "description" => "Messages cannot be sent to the channel from outside it", | |
68 | "requires" => "HalfOp" | |
69 | ], | |
70 | "o" => [ | |
71 | "name" => "Operator", | |
72 | "description" => "Marks someone as channel operator (@)", | |
73 | "requires" => "Operator" | |
74 | ], | |
75 | "p" => [ | |
76 | "name" => "Private", | |
1cf528b7 | 77 | "description" => "Prevents the channel from showing up in <code>/WHOIS</code> outputs and is replaces with \"*\" in <code>/LIST</code> outputs", |
fb27b14a VP |
78 | "requires" => "Operator" |
79 | ], | |
80 | "q" => [ | |
81 | "name" => "Owner", | |
82 | "description" => "Marks someone as channel owner (~)", | |
83 | "requires" => "Owner" | |
84 | ], | |
85 | "r" => [ | |
86 | "name" => "Registered", | |
87 | "description" => "Channel has been registered to an account", | |
ae7257d0 | 88 | "requires" => "Server" |
fb27b14a VP |
89 | ], |
90 | "s" => [ | |
91 | "name" => "Secret", | |
92 | "description" => "Prevents the channel from showing up in <code>/WHOIS</code> and <code>/LIST</code> outputs", | |
93 | "requires" => "Operator" | |
94 | ], | |
95 | "t" => [ | |
96 | "name" => "Topic", | |
97 | "description" => "Only HalfOps and above may set the topic.", | |
98 | "requires" => "HalfOp" | |
99 | ], | |
100 | "v" => [ | |
101 | "name" => "Voice", | |
102 | "description" => "Marks someone as voiced in the channel (+)", | |
103 | "requires" => "HalfOp" | |
104 | ], | |
105 | "z" => [ | |
106 | "name" => "Secure Only", | |
107 | "description" => "Only users using a secure connection may join this channel.", | |
108 | "requires" => "Operator" | |
109 | ], | |
110 | "C" => [ | |
111 | "name" => "No CTCPs", | |
112 | "description" => "CTCP messages are not allowed on the channel.", | |
113 | "requires" => "Operator" | |
114 | ], | |
115 | "D" => [ | |
116 | "name" => "Delay Join", | |
117 | "description" => "Delay showing joins until someone actually speaks.", | |
118 | "requires" => "Operator" | |
119 | ], | |
e92763ac VP |
120 | "F" => [ |
121 | "name" => "Flood Profile", | |
ae7257d0 VP |
122 | "description" => "Uses a Flood Profile to easily apply flood protection mechanisms", |
123 | "requires" => "Operator" | |
e92763ac | 124 | ], |
fb27b14a VP |
125 | "G" => [ |
126 | "name" => "Filter", | |
127 | "description" => "Filters out all Bad words in messages with \"<censored></pre>\".", | |
128 | "requires" => "Operator" | |
129 | ], | |
130 | "H" => [ | |
131 | "name" => "History", | |
132 | "description" => "Record channel history with specified maximums.", | |
133 | "requires" => "Operator" | |
134 | ], | |
135 | "I" => [ | |
136 | "name" => "Invitation", | |
137 | "description" => "Marks an inviation to a channel.", | |
b175b204 | 138 | "requires" => "HalfOp" |
fb27b14a VP |
139 | ], |
140 | "K" => [ | |
141 | "name" => "No Knock", | |
142 | "description" => "Users may not knock on this channel.", | |
143 | "requires" => "HalfOp" | |
144 | ], | |
145 | "L" => [ | |
146 | "name" => "Link", | |
147 | "description" => "Link to another channel when unable to join", | |
148 | "requires" => "Operator" | |
149 | ], | |
150 | "M" => [ | |
151 | "name" => "Auth Moderated", | |
152 | "description" => "Only users who have voice or are authenticated may talk in this channel.", | |
153 | "requires" => "HalfOp" | |
154 | ], | |
155 | "N" => [ | |
156 | "name" => "No Nick Changes", | |
157 | "description" => "Nickname changes are not permitted on the channel.", | |
158 | "requires" => "HalfOp" | |
159 | ], | |
160 | "O" => [ | |
161 | "name" => "IRCOps Only", | |
162 | "description" => "Only IRC Operators may join this channel.", | |
163 | "requires" => "IRC Operator" | |
164 | ], | |
165 | "P" => [ | |
166 | "name" => "Permanent", | |
167 | "description" => "This channel will exist even when nobody is inside.", | |
168 | "requires" => "IRC Operator" | |
169 | ], | |
170 | "Q" => [ | |
171 | "name" => "No Kicks", | |
172 | "description" => "Kicks are not allowed in this channel.", | |
173 | "requires" => "Operator" | |
174 | ], | |
175 | "R" => [ | |
176 | "name" => "Reg Only", | |
177 | "description" => "Only registered/authenticated users may join the channel.", | |
178 | "requires" => "Operator" | |
179 | ], | |
180 | "S" => [ | |
181 | "name" => "Strip Color", | |
182 | "description" => "All color is stripped from channel messages.", | |
183 | "requires" => "IRC Operator" | |
184 | ], | |
185 | "T" => [ | |
186 | "name" => "No Notices", | |
187 | "description" => "Notices are not permitted on the channel.", | |
188 | "requires" => "IRC Operator" | |
189 | ], | |
190 | "V" => [ | |
191 | "name" => "No Invites", | |
192 | "description" => "Users are not allowed to <code>/INVITE</code> others to the channel.", | |
193 | "requires" => "IRC Operator" | |
194 | ], | |
195 | "Z" => [ | |
196 | "name" => "Is Secure", | |
197 | "description" => "Indication that all users on the channel are on a Secure connection.", | |
198 | "requires" => "Server" | |
199 | ] | |
200 | ]; | |
ae7257d0 VP |
201 | |
202 | static function lookup($mode) | |
203 | { | |
204 | return (isset(self::$cmodes[$mode])) ? self::$cmodes[$mode] : | |
205 | [ | |
206 | 'name' => "Unknown mode", | |
207 | 'description' => "Unknown mode +$mode", | |
208 | 'requires' => 'Unknown' | |
209 | ]; | |
210 | } | |
43a6787a VP |
211 | static function setmodes($modes) |
212 | { | |
213 | $g = []; | |
214 | if (is_array($modes)) | |
215 | { | |
216 | self::$uplink = $modes; | |
217 | return; | |
218 | } | |
219 | else if (!strstr($modes,",")) | |
220 | $g = [$modes]; | |
221 | else $g = split($g,","); | |
222 | self::$uplink = $g; | |
223 | } | |
224 | static $uplink = []; | |
225 | ||
d69960b4 | 226 | } |