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