]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/module-doc/users_8h.html
Fixed binary images in this dir that cvs2svn stored as ascii
[user/henk/code/inspircd.git] / docs / module-doc / users_8h.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>InspIRCd: users.h File Reference</title>
4 <link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.4.4-20050815 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
8 <div class="nav">
9 <a class="el" href="dir_000000.html">home</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000001.html">brain</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000002.html">inspircd-cvs</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000003.html">inspircd</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000004.html">include</a></div>
10 <h1>users.h File Reference</h1><code>#include &quot;inspircd_config.h&quot;</code><br>
11 <code>#include &quot;<a class="el" href="channels_8h-source.html">channels.h</a>&quot;</code><br>
12 <code>#include &quot;inspstring.h&quot;</code><br>
13 <code>#include &quot;<a class="el" href="connection_8h-source.html">connection.h</a>&quot;</code><br>
14 <code>#include &lt;string&gt;</code><br>
15 <code>#include &quot;<a class="el" href="hashcomp_8h-source.html">hashcomp.h</a>&quot;</code><br>
16
17 <p>
18 Include dependency graph for users.h:<p><center><img src="users_8h__incl.gif" border="0" usemap="#users.h_map" alt=""></center>
19 <map name="users.h_map">
20 <area href="channels_8h-source.html" shape="rect" coords="128,108,213,135" alt="">
21 <area href="connection_8h-source.html" shape="rect" coords="121,159,220,185" alt="">
22 <area href="hashcomp_8h-source.html" shape="rect" coords="124,57,217,84" alt="">
23 </map>
24
25 <p>
26 This graph shows which files directly or indirectly include this file:<p><center><img src="users_8h__dep__incl.gif" border="0" usemap="#users.hdep_map" alt=""></center>
27 <map name="users.hdep_map">
28 <area href="channels_8cpp-source.html" shape="rect" coords="531,235,629,261" alt="">
29 <area href="modules_8cpp-source.html" shape="rect" coords="531,387,629,413" alt="">
30 <area href="users_8cpp-source.html" shape="rect" coords="540,564,620,591" alt="">
31 <area href="commands_8h-source.html" shape="rect" coords="379,615,477,641" alt="">
32 <area href="cull__list_8h-source.html" shape="rect" coords="121,311,199,337" alt="">
33 <area href="globals_8h-source.html" shape="rect" coords="249,159,324,185" alt="">
34 <area href="typedefs_8h-source.html" shape="rect" coords="385,260,471,287" alt="">
35 <area href="inspircd_8h-source.html" shape="rect" coords="247,412,327,439" alt="">
36 <area href="userprocess_8h-source.html" shape="rect" coords="376,463,480,489" alt="">
37 <area href="mode_8h-source.html" shape="rect" coords="127,361,193,388" alt="">
38 <area href="message_8h-source.html" shape="rect" coords="385,311,471,337" alt="">
39 <area href="xline_8h-source.html" shape="rect" coords="397,513,459,540" alt="">
40 </map>
41
42 <p>
43 <a href="users_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
44 <tr><td></td></tr>
45 <tr><td colspan="2"><br><h2>Classes</h2></td></tr>
46 <tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInvited.html">Invited</a></td></tr>
47
48 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds a channel name to which a user has been invited.  <a href="classInvited.html#_details">More...</a><br></td></tr>
49 <tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classConnectClass.html">ConnectClass</a></td></tr>
50
51 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds information relevent to &lt;connect allow&gt; and &lt;connect deny&gt; tags in the config file.  <a href="classConnectClass.html#_details">More...</a><br></td></tr>
52 <tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuserrec.html">userrec</a></td></tr>
53
54 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds all information about a user This class stores all information about a user connected to the irc server.  <a href="classuserrec.html#_details">More...</a><br></td></tr>
55 <tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWhoWasUser.html">WhoWasUser</a></td></tr>
56
57 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A lightweight userrec used by WHOWAS.  <a href="classWhoWasUser.html#_details">More...</a><br></td></tr>
58 <tr><td colspan="2"><br><h2>Defines</h2></td></tr>
59 <tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#STATUS_5FOP">STATUS_OP</a>&nbsp;&nbsp;&nbsp;4</td></tr>
60
61 <tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#STATUS_5FHOP">STATUS_HOP</a>&nbsp;&nbsp;&nbsp;2</td></tr>
62
63 <tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#STATUS_5FVOICE">STATUS_VOICE</a>&nbsp;&nbsp;&nbsp;1</td></tr>
64
65 <tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#STATUS_5FNORMAL">STATUS_NORMAL</a>&nbsp;&nbsp;&nbsp;0</td></tr>
66
67 <tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#CC_5FALLOW">CC_ALLOW</a>&nbsp;&nbsp;&nbsp;0</td></tr>
68
69 <tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#CC_5FDENY">CC_DENY</a>&nbsp;&nbsp;&nbsp;1</td></tr>
70
71 <tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
72 <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::vector&lt; <a class="el" href="classInvited.html">Invited</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#InvitedList">InvitedList</a></td></tr>
73
74 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds a complete list of all channels to which a user has been invited and has not yet joined.  <a href="#InvitedList"></a><br></td></tr>
75 <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::vector&lt; <a class="el" href="classConnectClass.html">ConnectClass</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#ClassVector">ClassVector</a></td></tr>
76
77 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Holds a complete list of all allow and deny tags from the configuration file (connection classes).  <a href="#ClassVector"></a><br></td></tr>
78 <tr><td colspan="2"><br><h2>Functions</h2></td></tr>
79 <tr><td class="memTemplParams" nowrap colspan="2">template&lt;typename T&gt; </td></tr>
80 <tr><td class="memTemplItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceirc.html#string">string</a>&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="users_8h.html#ConvToStr_28const_20T_20_26in_29">ConvToStr</a> (const T &amp;in)</td></tr>
81
82 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#AddOper_28userrec_20_2Auser_29">AddOper</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
83
84 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#DeleteOper_28userrec_20_2Auser_29">DeleteOper</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
85
86 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a> (<a class="el" href="classuserrec.html">userrec</a> *user, const char *r)</td></tr>
87
88 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#kill_5Flink_5Fsilent_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link_silent</a> (<a class="el" href="classuserrec.html">userrec</a> *user, const char *r)</td></tr>
89
90 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#AddWhoWas_28userrec_20_2Au_29">AddWhoWas</a> (<a class="el" href="classuserrec.html">userrec</a> *u)</td></tr>
91
92 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#AddClient_28int_20socket_2C_20char_20_2Ahost_2C_20int_20port_2C_20bool_20iscached_2C_20char_20_2Aip_29">AddClient</a> (int socket, char *host, int port, bool iscached, char *ip)</td></tr>
93
94 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#FullConnectUser_28userrec_20_2Auser_29">FullConnectUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
95
96 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#ConnectUser_28userrec_20_2Auser_29">ConnectUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
97
98 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#ReHashNick_28char_20_2AOld_2C_20char_20_2ANew_29">ReHashNick</a> (char *Old, char *New)</td></tr>
99
100 <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#force_5Fnickchange_28userrec_20_2Auser_2C_20const_20char_20_2Anewnick_29">force_nickchange</a> (<a class="el" href="classuserrec.html">userrec</a> *user, const char *newnick)</td></tr>
101
102 </table>
103 <hr><h2>Define Documentation</h2>
104 <a class="anchor" name="CC_5FALLOW"></a><!-- doxytag: member="users.h::CC_ALLOW" ref="CC_5FALLOW" args="" --><p>
105 <table class="mdTable" cellpadding="2" cellspacing="0">
106   <tr>
107     <td class="mdRow">
108       <table cellpadding="0" cellspacing="0" border="0">
109         <tr>
110           <td class="md" nowrap valign="top">#define CC_ALLOW&nbsp;&nbsp;&nbsp;0          </td>
111         </tr>
112       </table>
113     </td>
114   </tr>
115 </table>
116 <table cellspacing="5" cellpadding="0" border="0">
117   <tr>
118     <td>
119       &nbsp;
120     </td>
121     <td>
122
123 <p>
124
125 <p>
126 Definition at line <a class="el" href="users_8h-source.html#l00036">36</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
127 <p>
128 Referenced by <a class="el" href="users_8cpp-source.html#l00524">AddClient()</a>.    </td>
129   </tr>
130 </table>
131 <a class="anchor" name="CC_5FDENY"></a><!-- doxytag: member="users.h::CC_DENY" ref="CC_5FDENY" args="" --><p>
132 <table class="mdTable" cellpadding="2" cellspacing="0">
133   <tr>
134     <td class="mdRow">
135       <table cellpadding="0" cellspacing="0" border="0">
136         <tr>
137           <td class="md" nowrap valign="top">#define CC_DENY&nbsp;&nbsp;&nbsp;1          </td>
138         </tr>
139       </table>
140     </td>
141   </tr>
142 </table>
143 <table cellspacing="5" cellpadding="0" border="0">
144   <tr>
145     <td>
146       &nbsp;
147     </td>
148     <td>
149
150 <p>
151
152 <p>
153 Definition at line <a class="el" href="users_8h-source.html#l00037">37</a> of file <a class="el" href="users_8h-source.html">users.h</a>.    </td>
154   </tr>
155 </table>
156 <a class="anchor" name="STATUS_5FHOP"></a><!-- doxytag: member="users.h::STATUS_HOP" ref="STATUS_5FHOP" args="" --><p>
157 <table class="mdTable" cellpadding="2" cellspacing="0">
158   <tr>
159     <td class="mdRow">
160       <table cellpadding="0" cellspacing="0" border="0">
161         <tr>
162           <td class="md" nowrap valign="top">#define STATUS_HOP&nbsp;&nbsp;&nbsp;2          </td>
163         </tr>
164       </table>
165     </td>
166   </tr>
167 </table>
168 <table cellspacing="5" cellpadding="0" border="0">
169   <tr>
170     <td>
171       &nbsp;
172     </td>
173     <td>
174
175 <p>
176
177 <p>
178 Definition at line <a class="el" href="users_8h-source.html#l00032">32</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
179 <p>
180 Referenced by <a class="el" href="channels_8cpp-source.html#l00459">kick_channel()</a>.    </td>
181   </tr>
182 </table>
183 <a class="anchor" name="STATUS_5FNORMAL"></a><!-- doxytag: member="users.h::STATUS_NORMAL" ref="STATUS_5FNORMAL" args="" --><p>
184 <table class="mdTable" cellpadding="2" cellspacing="0">
185   <tr>
186     <td class="mdRow">
187       <table cellpadding="0" cellspacing="0" border="0">
188         <tr>
189           <td class="md" nowrap valign="top">#define STATUS_NORMAL&nbsp;&nbsp;&nbsp;0          </td>
190         </tr>
191       </table>
192     </td>
193   </tr>
194 </table>
195 <table cellspacing="5" cellpadding="0" border="0">
196   <tr>
197     <td>
198       &nbsp;
199     </td>
200     <td>
201
202 <p>
203
204 <p>
205 Definition at line <a class="el" href="users_8h-source.html#l00034">34</a> of file <a class="el" href="users_8h-source.html">users.h</a>.    </td>
206   </tr>
207 </table>
208 <a class="anchor" name="STATUS_5FOP"></a><!-- doxytag: member="users.h::STATUS_OP" ref="STATUS_5FOP" args="" --><p>
209 <table class="mdTable" cellpadding="2" cellspacing="0">
210   <tr>
211     <td class="mdRow">
212       <table cellpadding="0" cellspacing="0" border="0">
213         <tr>
214           <td class="md" nowrap valign="top">#define STATUS_OP&nbsp;&nbsp;&nbsp;4          </td>
215         </tr>
216       </table>
217     </td>
218   </tr>
219 </table>
220 <table cellspacing="5" cellpadding="0" border="0">
221   <tr>
222     <td>
223       &nbsp;
224     </td>
225     <td>
226
227 <p>
228
229 <p>
230 Definition at line <a class="el" href="users_8h-source.html#l00031">31</a> of file <a class="el" href="users_8h-source.html">users.h</a>.    </td>
231   </tr>
232 </table>
233 <a class="anchor" name="STATUS_5FVOICE"></a><!-- doxytag: member="users.h::STATUS_VOICE" ref="STATUS_5FVOICE" args="" --><p>
234 <table class="mdTable" cellpadding="2" cellspacing="0">
235   <tr>
236     <td class="mdRow">
237       <table cellpadding="0" cellspacing="0" border="0">
238         <tr>
239           <td class="md" nowrap valign="top">#define STATUS_VOICE&nbsp;&nbsp;&nbsp;1          </td>
240         </tr>
241       </table>
242     </td>
243   </tr>
244 </table>
245 <table cellspacing="5" cellpadding="0" border="0">
246   <tr>
247     <td>
248       &nbsp;
249     </td>
250     <td>
251
252 <p>
253
254 <p>
255 Definition at line <a class="el" href="users_8h-source.html#l00033">33</a> of file <a class="el" href="users_8h-source.html">users.h</a>.    </td>
256   </tr>
257 </table>
258 <hr><h2>Typedef Documentation</h2>
259 <a class="anchor" name="ClassVector"></a><!-- doxytag: member="users.h::ClassVector" ref="ClassVector" args="" --><p>
260 <table class="mdTable" cellpadding="2" cellspacing="0">
261   <tr>
262     <td class="mdRow">
263       <table cellpadding="0" cellspacing="0" border="0">
264         <tr>
265           <td class="md" nowrap valign="top">typedef std::vector&lt;<a class="el" href="classConnectClass.html">ConnectClass</a>&gt; <a class="el" href="users_8h.html#ClassVector">ClassVector</a>          </td>
266         </tr>
267       </table>
268     </td>
269   </tr>
270 </table>
271 <table cellspacing="5" cellpadding="0" border="0">
272   <tr>
273     <td>
274       &nbsp;
275     </td>
276     <td>
277
278 <p>
279 Holds a complete list of all allow and deny tags from the configuration file (connection classes). 
280 <p>
281
282 <p>
283 Definition at line <a class="el" href="users_8h-source.html#l00107">107</a> of file <a class="el" href="users_8h-source.html">users.h</a>.    </td>
284   </tr>
285 </table>
286 <a class="anchor" name="InvitedList"></a><!-- doxytag: member="users.h::InvitedList" ref="InvitedList" args="" --><p>
287 <table class="mdTable" cellpadding="2" cellspacing="0">
288   <tr>
289     <td class="mdRow">
290       <table cellpadding="0" cellspacing="0" border="0">
291         <tr>
292           <td class="md" nowrap valign="top">typedef std::vector&lt;<a class="el" href="classInvited.html">Invited</a>&gt; <a class="el" href="users_8h.html#InvitedList">InvitedList</a>          </td>
293         </tr>
294       </table>
295     </td>
296   </tr>
297 </table>
298 <table cellspacing="5" cellpadding="0" border="0">
299   <tr>
300     <td>
301       &nbsp;
302     </td>
303     <td>
304
305 <p>
306 Holds a complete list of all channels to which a user has been invited and has not yet joined. 
307 <p>
308
309 <p>
310 Definition at line <a class="el" href="users_8h-source.html#l00101">101</a> of file <a class="el" href="users_8h-source.html">users.h</a>.    </td>
311   </tr>
312 </table>
313 <hr><h2>Function Documentation</h2>
314 <a class="anchor" name="AddClient_28int_20socket_2C_20char_20_2Ahost_2C_20int_20port_2C_20bool_20iscached_2C_20char_20_2Aip_29"></a><!-- doxytag: member="users.h::AddClient" ref="AddClient_28int_20socket_2C_20char_20_2Ahost_2C_20int_20port_2C_20bool_20iscached_2C_20char_20_2Aip_29" args="(int socket, char *host, int port, bool iscached, char *ip)" --><p>
315 <table class="mdTable" cellpadding="2" cellspacing="0">
316   <tr>
317     <td class="mdRow">
318       <table cellpadding="0" cellspacing="0" border="0">
319         <tr>
320           <td class="md" nowrap valign="top">void AddClient           </td>
321           <td class="md" valign="top">(&nbsp;</td>
322           <td class="md" nowrap valign="top">int&nbsp;</td>
323           <td class="mdname" nowrap> <em>socket</em>, </td>
324         </tr>
325         <tr>
326           <td class="md" nowrap align="right"></td>
327           <td class="md"></td>
328           <td class="md" nowrap>char *&nbsp;</td>
329           <td class="mdname" nowrap> <em>host</em>, </td>
330         </tr>
331         <tr>
332           <td class="md" nowrap align="right"></td>
333           <td class="md"></td>
334           <td class="md" nowrap>int&nbsp;</td>
335           <td class="mdname" nowrap> <em>port</em>, </td>
336         </tr>
337         <tr>
338           <td class="md" nowrap align="right"></td>
339           <td class="md"></td>
340           <td class="md" nowrap>bool&nbsp;</td>
341           <td class="mdname" nowrap> <em>iscached</em>, </td>
342         </tr>
343         <tr>
344           <td class="md" nowrap align="right"></td>
345           <td class="md"></td>
346           <td class="md" nowrap>char *&nbsp;</td>
347           <td class="mdname" nowrap> <em>ip</em></td>
348         </tr>
349         <tr>
350           <td class="md"></td>
351           <td class="md">)&nbsp;</td>
352           <td class="md" colspan="2"></td>
353         </tr>
354       </table>
355     </td>
356   </tr>
357 </table>
358 <table cellspacing="5" cellpadding="0" border="0">
359   <tr>
360     <td>
361       &nbsp;
362     </td>
363     <td>
364
365 <p>
366
367 <p>
368 Definition at line <a class="el" href="users_8cpp-source.html#l00524">524</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
369 <p>
370 References <a class="el" href="socketengine_8cpp-source.html#l00065">SocketEngine::AddFd()</a>, <a class="el" href="users_8h-source.html#l00036">CC_ALLOW</a>, <a class="el" href="channels_8h-source.html#l00254">ucrec::channel</a>, <a class="el" href="inspircd__io_8h-source.html#l00243">ServerConfig::Classes</a>, <a class="el" href="modules_8cpp.html#clientlist">clientlist</a>, <a class="el" href="users_8cpp-source.html#l00056">ConvToStr()</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, <a class="el" href="inspircd__io_8h-source.html#l00177">ServerConfig::dns_timeout</a>, <a class="el" href="inspircd_8h.html#FindServerNamePtr_28std_3A_3Astring_20servername_29">FindServerNamePtr()</a>, <a class="el" href="users_8cpp-source.html#l00349">kill_link()</a>, <a class="el" href="users_8cpp-source.html#l00052">local_users</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="xline_8h.html#matches_5Fexception_28const_20char_20_2Ahost_29">matches_exception()</a>, <a class="el" href="xline_8h.html#matches_5Fzline_28const_20char_20_2Aipaddr_29">matches_zline()</a>, <a class="el" href="inspircd_8h-source.html#l00111">InspIRCd::SE</a>, <a class="el" href="inspircd__io_8h-source.html#l00069">ServerConfig::ServerName</a>, <a class="el" href="inspircd__io_8h-source.html#l00194">ServerConfig::SoftLimit</a>, <a class="el" href="channels_8cpp.html#TIME">TIME</a>, <a class="el" href="channels_8h-source.html#l00249">ucrec::uc_modes</a>, and <a class="el" href="socketengine_8h-source.html#l00043">X_ESTAB_CLIENT</a>.<div class="fragment"><pre class="fragment"><a name="l00525"></a>00525 {
371 <a name="l00526"></a>00526         <a class="code" href="namespaceirc.html#string">string</a> tempnick;
372 <a name="l00527"></a>00527         <span class="keywordtype">char</span> tn2[MAXBUF];
373 <a name="l00528"></a>00528         user_hash::iterator iter;
374 <a name="l00529"></a>00529 
375 <a name="l00530"></a>00530         tempnick = <a class="code" href="users_8cpp.html#ConvToStr_28const_20T_20_26in_29">ConvToStr</a>(socket) + <span class="stringliteral">"-unknown"</span>;
376 <a name="l00531"></a>00531         sprintf(tn2,<span class="stringliteral">"%lu-unknown"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)socket);
377 <a name="l00532"></a>00532 
378 <a name="l00533"></a>00533         iter = <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.find(tempnick);
379 <a name="l00534"></a>00534 
380 <a name="l00535"></a>00535         <span class="comment">// fix by brain.</span>
381 <a name="l00536"></a>00536         <span class="comment">// as these nicknames are 'RFC impossible', we can be sure nobody is going to be</span>
382 <a name="l00537"></a>00537         <span class="comment">// using one as a registered connection. As theyre per fd, we can also safely assume</span>
383 <a name="l00538"></a>00538         <span class="comment">// that we wont have collisions. Therefore, if the nick exists in the list, its only</span>
384 <a name="l00539"></a>00539         <span class="comment">// used by a dead socket, erase the iterator so that the new client may reclaim it.</span>
385 <a name="l00540"></a>00540         <span class="comment">// this was probably the cause of 'server ignores me when i hammer it with reconnects'</span>
386 <a name="l00541"></a>00541         <span class="comment">// issue in earlier alphas/betas</span>
387 <a name="l00542"></a>00542         <span class="keywordflow">if</span> (iter != <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.end())
388 <a name="l00543"></a>00543         {
389 <a name="l00544"></a>00544                 <a class="code" href="classuserrec.html">userrec</a>* goner = iter-&gt;second;
390 <a name="l00545"></a>00545                 <span class="keyword">delete</span> goner;
391 <a name="l00546"></a>00546                 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.erase(iter);
392 <a name="l00547"></a>00547         }
393 <a name="l00548"></a>00548 
394 <a name="l00549"></a>00549         <span class="comment">/*</span>
395 <a name="l00550"></a>00550 <span class="comment">         * It is OK to access the value here this way since we know</span>
396 <a name="l00551"></a>00551 <span class="comment">         * it exists, we just created it above.</span>
397 <a name="l00552"></a>00552 <span class="comment">         *</span>
398 <a name="l00553"></a>00553 <span class="comment">         * At NO other time should you access a value in a map or a</span>
399 <a name="l00554"></a>00554 <span class="comment">         * hash_map this way.</span>
400 <a name="l00555"></a>00555 <span class="comment">         */</span>
401 <a name="l00556"></a>00556         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick] = <span class="keyword">new</span> <a class="code" href="classuserrec.html">userrec</a>();
402 <a name="l00557"></a>00557 
403 <a name="l00558"></a>00558         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"AddClient: %lu %s %d %s"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)socket,host,port,ip);
404 <a name="l00559"></a>00559 
405 <a name="l00560"></a>00560         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;fd = socket;
406 <a name="l00561"></a>00561         strlcpy(clientlist[tempnick]-&gt;nick, tn2,NICKMAX);
407 <a name="l00562"></a>00562         strlcpy(clientlist[tempnick]-&gt;host, host,160);
408 <a name="l00563"></a>00563         strlcpy(clientlist[tempnick]-&gt;dhost, host,160);
409 <a name="l00564"></a>00564         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;server = (<span class="keywordtype">char</span>*)<a class="code" href="inspircd_8h.html#FindServerNamePtr_28std_3A_3Astring_20servername_29">FindServerNamePtr</a>(<a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#ServerName_5BMAXBUF_5D">ServerName</a>);
410 <a name="l00565"></a>00565         strlcpy(clientlist[tempnick]-&gt;ident, <span class="stringliteral">"unknown"</span>,IDENTMAX);
411 <a name="l00566"></a>00566         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;registered = 0;
412 <a name="l00567"></a>00567         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;signon = <a class="code" href="channels_8cpp.html#TIME">TIME</a> + <a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#dns_5Ftimeout">dns_timeout</a>;
413 <a name="l00568"></a>00568         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;lastping = 1;
414 <a name="l00569"></a>00569         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;port = port;
415 <a name="l00570"></a>00570         strlcpy(clientlist[tempnick]-&gt;ip,ip,16);
416 <a name="l00571"></a>00571 
417 <a name="l00572"></a>00572         <span class="comment">// set the registration timeout for this user</span>
418 <a name="l00573"></a>00573         <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> class_regtimeout = 90;
419 <a name="l00574"></a>00574         <span class="keywordtype">int</span> class_flood = 0;
420 <a name="l00575"></a>00575         <span class="keywordtype">long</span> class_threshold = 5;
421 <a name="l00576"></a>00576         <span class="keywordtype">long</span> class_sqmax = 262144;      <span class="comment">// 256kb</span>
422 <a name="l00577"></a>00577         <span class="keywordtype">long</span> class_rqmax = 4096;        <span class="comment">// 4k</span>
423 <a name="l00578"></a>00578 
424 <a name="l00579"></a>00579         <span class="keywordflow">for</span> (ClassVector::iterator i = <a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#Classes">Classes</a>.begin(); i != <a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#Classes">Classes</a>.end(); i++)
425 <a name="l00580"></a>00580         {
426 <a name="l00581"></a>00581                 <span class="keywordflow">if</span> (match(clientlist[tempnick]-&gt;host,i-&gt;host) &amp;&amp; (i-&gt;type == <a class="code" href="users_8h.html#CC_5FALLOW">CC_ALLOW</a>))
427 <a name="l00582"></a>00582                 {
428 <a name="l00583"></a>00583                         class_regtimeout = (<span class="keywordtype">unsigned</span> long)i-&gt;registration_timeout;
429 <a name="l00584"></a>00584                         class_flood = i-&gt;flood;
430 <a name="l00585"></a>00585                         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;pingmax = i-&gt;pingtime;
431 <a name="l00586"></a>00586                         class_threshold = i-&gt;threshold;
432 <a name="l00587"></a>00587                         class_sqmax = i-&gt;sendqmax;
433 <a name="l00588"></a>00588                         class_rqmax = i-&gt;recvqmax;
434 <a name="l00589"></a>00589                         <span class="keywordflow">break</span>;
435 <a name="l00590"></a>00590                 }
436 <a name="l00591"></a>00591         }
437 <a name="l00592"></a>00592 
438 <a name="l00593"></a>00593         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;nping = <a class="code" href="channels_8cpp.html#TIME">TIME</a>+<a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;pingmax + <a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#dns_5Ftimeout">dns_timeout</a>;
439 <a name="l00594"></a>00594         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;timeout = <a class="code" href="channels_8cpp.html#TIME">TIME</a>+class_regtimeout;
440 <a name="l00595"></a>00595         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;flood = class_flood;
441 <a name="l00596"></a>00596         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;threshold = class_threshold;
442 <a name="l00597"></a>00597         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;sendqmax = class_sqmax;
443 <a name="l00598"></a>00598         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;recvqmax = class_rqmax;
444 <a name="l00599"></a>00599 
445 <a name="l00600"></a>00600         <a class="code" href="classucrec.html">ucrec</a> a;
446 <a name="l00601"></a>00601         a.<a class="code" href="classucrec.html#channel">channel</a> = NULL;
447 <a name="l00602"></a>00602         a.<a class="code" href="classucrec.html#uc_5Fmodes">uc_modes</a> = 0;
448 <a name="l00603"></a>00603         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; MAXCHANS; i++)
449 <a name="l00604"></a>00604                 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]-&gt;chans.push_back(a);
450 <a name="l00605"></a>00605 
451 <a name="l00606"></a>00606         <span class="keywordflow">if</span> (<a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.size() &gt; <a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#SoftLimit">SoftLimit</a>)
452 <a name="l00607"></a>00607         {
453 <a name="l00608"></a>00608                 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(clientlist[tempnick],<span class="stringliteral">"No more connections allowed"</span>);
454 <a name="l00609"></a>00609                 <span class="keywordflow">return</span>;
455 <a name="l00610"></a>00610         }
456 <a name="l00611"></a>00611 
457 <a name="l00612"></a>00612         <span class="keywordflow">if</span> (<a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.size() &gt;= MAXCLIENTS)
458 <a name="l00613"></a>00613         {
459 <a name="l00614"></a>00614                 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(clientlist[tempnick],<span class="stringliteral">"No more connections allowed"</span>);
460 <a name="l00615"></a>00615                 <span class="keywordflow">return</span>;
461 <a name="l00616"></a>00616         }
462 <a name="l00617"></a>00617 
463 <a name="l00618"></a>00618         <span class="comment">// this is done as a safety check to keep the file descriptors within range of fd_ref_table.</span>
464 <a name="l00619"></a>00619         <span class="comment">// its a pretty big but for the moment valid assumption:</span>
465 <a name="l00620"></a>00620         <span class="comment">// file descriptors are handed out starting at 0, and are recycled as theyre freed.</span>
466 <a name="l00621"></a>00621         <span class="comment">// therefore if there is ever an fd over 65535, 65536 clients must be connected to the</span>
467 <a name="l00622"></a>00622         <span class="comment">// irc server at once (or the irc server otherwise initiating this many connections, files etc)</span>
468 <a name="l00623"></a>00623         <span class="comment">// which for the time being is a physical impossibility (even the largest networks dont have more</span>
469 <a name="l00624"></a>00624         <span class="comment">// than about 10,000 users on ONE server!)</span>
470 <a name="l00625"></a>00625         <span class="keywordflow">if</span> ((<span class="keywordtype">unsigned</span>)socket &gt; 65534)
471 <a name="l00626"></a>00626         {
472 <a name="l00627"></a>00627                 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(clientlist[tempnick],<span class="stringliteral">"Server is full"</span>);
473 <a name="l00628"></a>00628                 <span class="keywordflow">return</span>;
474 <a name="l00629"></a>00629         }
475 <a name="l00630"></a>00630         <span class="keywordtype">char</span>* e = <a class="code" href="xline_8h.html#matches_5Fexception_28const_20char_20_2Ahost_29">matches_exception</a>(ip);
476 <a name="l00631"></a>00631         <span class="keywordflow">if</span> (!e)
477 <a name="l00632"></a>00632         {
478 <a name="l00633"></a>00633                 <span class="keywordtype">char</span>* r = <a class="code" href="xline_8h.html#matches_5Fzline_28const_20char_20_2Aipaddr_29">matches_zline</a>(ip);
479 <a name="l00634"></a>00634                 <span class="keywordflow">if</span> (r)
480 <a name="l00635"></a>00635                 {
481 <a name="l00636"></a>00636                         <span class="keywordtype">char</span> reason[MAXBUF];
482 <a name="l00637"></a>00637                         snprintf(reason,MAXBUF,<span class="stringliteral">"Z-Lined: %s"</span>,r);
483 <a name="l00638"></a>00638                         <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(clientlist[tempnick],reason);
484 <a name="l00639"></a>00639                         <span class="keywordflow">return</span>;
485 <a name="l00640"></a>00640                 }
486 <a name="l00641"></a>00641         }
487 <a name="l00642"></a>00642         <a class="code" href="modules_8cpp.html#fd_5Fref_5Ftable_5B_36_35_35_33_36_5D">fd_ref_table</a>[socket] = <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick];
488 <a name="l00643"></a>00643         <a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.push_back(clientlist[tempnick]);
489 <a name="l00644"></a>00644         <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-&gt;<a class="code" href="classInspIRCd.html#SE">SE</a>-&gt;<a class="code" href="classSocketEngine.html#AddFd_28int_20fd_2C_20bool_20readable_2C_20char_20type_29">AddFd</a>(socket,<span class="keyword">true</span>,<a class="code" href="socketengine_8h.html#X_5FESTAB_5FCLIENT">X_ESTAB_CLIENT</a>);
490 <a name="l00645"></a>00645 }
491 </pre></div>
492 <p>
493     </td>
494   </tr>
495 </table>
496 <a class="anchor" name="AddOper_28userrec_20_2Auser_29"></a><!-- doxytag: member="users.h::AddOper" ref="AddOper_28userrec_20_2Auser_29" args="(userrec *user)" --><p>
497 <table class="mdTable" cellpadding="2" cellspacing="0">
498   <tr>
499     <td class="mdRow">
500       <table cellpadding="0" cellspacing="0" border="0">
501         <tr>
502           <td class="md" nowrap valign="top">void AddOper           </td>
503           <td class="md" valign="top">(&nbsp;</td>
504           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
505           <td class="mdname1" valign="top" nowrap> <em>user</em>          </td>
506           <td class="md" valign="top">&nbsp;)&nbsp;</td>
507           <td class="md" nowrap></td>
508         </tr>
509       </table>
510     </td>
511   </tr>
512 </table>
513 <table cellspacing="5" cellpadding="0" border="0">
514   <tr>
515     <td>
516       &nbsp;
517     </td>
518     <td>
519
520 <p>
521
522 <p>
523 Definition at line <a class="el" href="users_8cpp-source.html#l00330">330</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
524 <p>
525 References <a class="el" href="users_8cpp-source.html#l00054">all_opers</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, and <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>.<div class="fragment"><pre class="fragment"><a name="l00331"></a>00331 {
526 <a name="l00332"></a>00332         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Oper added to optimization list"</span>);
527 <a name="l00333"></a>00333         <a class="code" href="users_8cpp.html#all_5Fopers">all_opers</a>.push_back(user);
528 <a name="l00334"></a>00334 }
529 </pre></div>
530 <p>
531     </td>
532   </tr>
533 </table>
534 <a class="anchor" name="AddWhoWas_28userrec_20_2Au_29"></a><!-- doxytag: member="users.h::AddWhoWas" ref="AddWhoWas_28userrec_20_2Au_29" args="(userrec *u)" --><p>
535 <table class="mdTable" cellpadding="2" cellspacing="0">
536   <tr>
537     <td class="mdRow">
538       <table cellpadding="0" cellspacing="0" border="0">
539         <tr>
540           <td class="md" nowrap valign="top">void AddWhoWas           </td>
541           <td class="md" valign="top">(&nbsp;</td>
542           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
543           <td class="mdname1" valign="top" nowrap> <em>u</em>          </td>
544           <td class="md" valign="top">&nbsp;)&nbsp;</td>
545           <td class="md" nowrap></td>
546         </tr>
547       </table>
548     </td>
549   </tr>
550 </table>
551 <table cellspacing="5" cellpadding="0" border="0">
552   <tr>
553     <td>
554       &nbsp;
555     </td>
556     <td>
557
558 <p>
559
560 <p>
561 Definition at line <a class="el" href="users_8cpp-source.html#l00471">471</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
562 <p>
563 References <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, <a class="el" href="users_8h-source.html#l00138">userrec::dhost</a>, <a class="el" href="users_8h-source.html#l00341">WhoWasUser::dhost</a>, <a class="el" href="users_8h-source.html#l00142">userrec::fullname</a>, <a class="el" href="users_8h-source.html#l00343">WhoWasUser::fullname</a>, <a class="el" href="connection_8h-source.html#l00046">connection::host</a>, <a class="el" href="users_8h-source.html#l00342">WhoWasUser::host</a>, <a class="el" href="users_8h-source.html#l00133">userrec::ident</a>, <a class="el" href="users_8h-source.html#l00340">WhoWasUser::ident</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="users_8h-source.html#l00339">WhoWasUser::nick</a>, <a class="el" href="users_8h-source.html#l00128">userrec::nick</a>, <a class="el" href="users_8h-source.html#l00157">userrec::server</a>, <a class="el" href="users_8h-source.html#l00344">WhoWasUser::server</a>, <a class="el" href="connection_8h-source.html#l00088">connection::signon</a>, <a class="el" href="users_8h-source.html#l00345">WhoWasUser::signon</a>, <a class="el" href="channels_8cpp.html#TIME">TIME</a>, <a class="el" href="users_8cpp.html#whowas">whowas</a>, <a class="el" href="channels_8cpp.html#WHOWAS_5FMAX">WHOWAS_MAX</a>, and <a class="el" href="channels_8cpp.html#WHOWAS_5FSTALE">WHOWAS_STALE</a>.
564 <p>
565 Referenced by <a class="el" href="users_8cpp-source.html#l00349">kill_link()</a>.<div class="fragment"><pre class="fragment"><a name="l00472"></a>00472 {
566 <a name="l00473"></a>00473         whowas_hash::iterator iter = <a class="code" href="users_8cpp.html#whowas">whowas</a>.find(u-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>);
567 <a name="l00474"></a>00474         <a class="code" href="classWhoWasUser.html">WhoWasUser</a> *a = <span class="keyword">new</span> <a class="code" href="classWhoWasUser.html">WhoWasUser</a>();
568 <a name="l00475"></a>00475         strlcpy(a-&gt;<a class="code" href="classWhoWasUser.html#nick_5BNICKMAX_5D">nick</a>,u-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,NICKMAX);
569 <a name="l00476"></a>00476         strlcpy(a-&gt;<a class="code" href="classWhoWasUser.html#ident_5BIDENTMAX_2B_31_5D">ident</a>,u-&gt;<a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,IDENTMAX);
570 <a name="l00477"></a>00477         strlcpy(a-&gt;<a class="code" href="classWhoWasUser.html#dhost_5B_31_36_30_5D">dhost</a>,u-&gt;<a class="code" href="classuserrec.html#dhost_5B_31_36_30_5D">dhost</a>,160);
571 <a name="l00478"></a>00478         strlcpy(a-&gt;<a class="code" href="classWhoWasUser.html#host_5B_31_36_30_5D">host</a>,u-&gt;<a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>,160);
572 <a name="l00479"></a>00479         strlcpy(a-&gt;<a class="code" href="classWhoWasUser.html#fullname_5BMAXGECOS_2B_31_5D">fullname</a>,u-&gt;<a class="code" href="classuserrec.html#fullname_5BMAXGECOS_2B_31_5D">fullname</a>,MAXGECOS);
573 <a name="l00480"></a>00480         strlcpy(a-&gt;<a class="code" href="classWhoWasUser.html#server_5B_32_35_36_5D">server</a>,u-&gt;<a class="code" href="classuserrec.html#server">server</a>,256);
574 <a name="l00481"></a>00481         a-&gt;<a class="code" href="classWhoWasUser.html#signon">signon</a> = u-&gt;<a class="code" href="classconnection.html#signon">signon</a>;
575 <a name="l00482"></a>00482 
576 <a name="l00483"></a>00483         <span class="comment">/* MAX_WHOWAS:   max number of /WHOWAS items</span>
577 <a name="l00484"></a>00484 <span class="comment">         * WHOWAS_STALE: number of hours before a WHOWAS item is marked as stale and</span>
578 <a name="l00485"></a>00485 <span class="comment">         *               can be replaced by a newer one</span>
579 <a name="l00486"></a>00486 <span class="comment">         */</span>
580 <a name="l00487"></a>00487 
581 <a name="l00488"></a>00488         <span class="keywordflow">if</span> (iter == <a class="code" href="users_8cpp.html#whowas">whowas</a>.end())
582 <a name="l00489"></a>00489         {
583 <a name="l00490"></a>00490                 <span class="keywordflow">if</span> (<a class="code" href="users_8cpp.html#whowas">whowas</a>.size() &gt;= (unsigned)<a class="code" href="channels_8cpp.html#WHOWAS_5FMAX">WHOWAS_MAX</a>)
584 <a name="l00491"></a>00491                 {
585 <a name="l00492"></a>00492                         <span class="keywordflow">for</span> (whowas_hash::iterator i = <a class="code" href="users_8cpp.html#whowas">whowas</a>.begin(); i != <a class="code" href="users_8cpp.html#whowas">whowas</a>.end(); i++)
586 <a name="l00493"></a>00493                         {
587 <a name="l00494"></a>00494                                 <span class="comment">// 3600 seconds in an hour ;)</span>
588 <a name="l00495"></a>00495                                 <span class="keywordflow">if</span> ((i-&gt;second-&gt;signon)&lt;(TIME-(WHOWAS_STALE*3600)))
589 <a name="l00496"></a>00496                                 {
590 <a name="l00497"></a>00497                                         <span class="comment">// delete the old one</span>
591 <a name="l00498"></a>00498                                         <span class="keywordflow">if</span> (i-&gt;second) <span class="keyword">delete</span> i-&gt;second;
592 <a name="l00499"></a>00499                                         <span class="comment">// replace with new one</span>
593 <a name="l00500"></a>00500                                         i-&gt;second = a;
594 <a name="l00501"></a>00501                                         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"added WHOWAS entry, purged an old record"</span>);
595 <a name="l00502"></a>00502                                         <span class="keywordflow">return</span>;
596 <a name="l00503"></a>00503                                 }
597 <a name="l00504"></a>00504                         }
598 <a name="l00505"></a>00505                         <span class="comment">// no space left and user doesnt exist. Don't leave ram in use!</span>
599 <a name="l00506"></a>00506                         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Not able to update whowas (list at WHOWAS_MAX entries and trying to add new?), freeing excess ram"</span>);
600 <a name="l00507"></a>00507                         <span class="keyword">delete</span> a;
601 <a name="l00508"></a>00508                 }
602 <a name="l00509"></a>00509                 <span class="keywordflow">else</span>
603 <a name="l00510"></a>00510                 {
604 <a name="l00511"></a>00511                         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"added fresh WHOWAS entry"</span>);
605 <a name="l00512"></a>00512                         <a class="code" href="users_8cpp.html#whowas">whowas</a>[a-&gt;<a class="code" href="classWhoWasUser.html#nick_5BNICKMAX_5D">nick</a>] = a;
606 <a name="l00513"></a>00513                 }
607 <a name="l00514"></a>00514         }
608 <a name="l00515"></a>00515         <span class="keywordflow">else</span>
609 <a name="l00516"></a>00516         {
610 <a name="l00517"></a>00517                 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"updated WHOWAS entry"</span>);
611 <a name="l00518"></a>00518                 <span class="keywordflow">if</span> (iter-&gt;second) <span class="keyword">delete</span> iter-&gt;second;
612 <a name="l00519"></a>00519                 iter-&gt;second = a;
613 <a name="l00520"></a>00520         }
614 <a name="l00521"></a>00521 }
615 </pre></div>
616 <p>
617     </td>
618   </tr>
619 </table>
620 <a class="anchor" name="ConnectUser_28userrec_20_2Auser_29"></a><!-- doxytag: member="users.h::ConnectUser" ref="ConnectUser_28userrec_20_2Auser_29" args="(userrec *user)" --><p>
621 <table class="mdTable" cellpadding="2" cellspacing="0">
622   <tr>
623     <td class="mdRow">
624       <table cellpadding="0" cellspacing="0" border="0">
625         <tr>
626           <td class="md" nowrap valign="top">void ConnectUser           </td>
627           <td class="md" valign="top">(&nbsp;</td>
628           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
629           <td class="mdname1" valign="top" nowrap> <em>user</em>          </td>
630           <td class="md" valign="top">&nbsp;)&nbsp;</td>
631           <td class="md" nowrap></td>
632         </tr>
633       </table>
634     </td>
635   </tr>
636 </table>
637 <table cellspacing="5" cellpadding="0" border="0">
638   <tr>
639     <td>
640       &nbsp;
641     </td>
642     <td>
643
644 <p>
645
646 <p>
647 Definition at line <a class="el" href="users_8cpp-source.html#l00731">731</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
648 <p>
649 References <a class="el" href="users_8h-source.html#l00185">userrec::dns_done</a>, <a class="el" href="users_8cpp-source.html#l00647">FullConnectUser()</a>, and <a class="el" href="connection_8h-source.html#l00080">connection::registered</a>.<div class="fragment"><pre class="fragment"><a name="l00732"></a>00732 {
650 <a name="l00733"></a>00733         <span class="comment">// dns is already done, things are fast. no need to wait for dns to complete just pass them straight on</span>
651 <a name="l00734"></a>00734         <span class="keywordflow">if</span> ((user-&gt;<a class="code" href="classuserrec.html#dns_5Fdone">dns_done</a>) &amp;&amp; (user-&gt;<a class="code" href="classconnection.html#registered">registered</a> &gt;= 3) &amp;&amp; (AllModulesReportReady(user)))
652 <a name="l00735"></a>00735         {
653 <a name="l00736"></a>00736                 <a class="code" href="users_8cpp.html#FullConnectUser_28userrec_20_2Auser_29">FullConnectUser</a>(user);
654 <a name="l00737"></a>00737         }
655 <a name="l00738"></a>00738 }
656 </pre></div>
657 <p>
658     </td>
659   </tr>
660 </table>
661 <a class="anchor" name="ConvToStr_28const_20T_20_26in_29"></a><!-- doxytag: member="users.h::ConvToStr" ref="ConvToStr_28const_20T_20_26in_29" args="(const T &amp;in)" --><p>
662 <table class="mdTable" cellpadding="2" cellspacing="0">
663   <tr>
664     <td class="mdRow">
665       <table cellpadding="0" cellspacing="0" border="0">
666         <tr>
667           <td class="mdPrefix" colspan="4">
668 template&lt;typename T&gt; </td>
669         </tr>
670         <tr>
671           <td class="md" nowrap valign="top"><a class="el" href="namespaceirc.html#string">string</a> ConvToStr           </td>
672           <td class="md" valign="top">(&nbsp;</td>
673           <td class="md" nowrap valign="top">const T &amp;&nbsp;</td>
674           <td class="mdname1" valign="top" nowrap> <em>in</em>          </td>
675           <td class="md" valign="top">&nbsp;)&nbsp;</td>
676           <td class="md" nowrap><code> [inline]</code></td>
677         </tr>
678       </table>
679     </td>
680   </tr>
681 </table>
682 <table cellspacing="5" cellpadding="0" border="0">
683   <tr>
684     <td>
685       &nbsp;
686     </td>
687     <td>
688
689 <p>
690
691 <p>
692 Definition at line <a class="el" href="users_8cpp-source.html#l00056">56</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
693 <p>
694 Referenced by <a class="el" href="users_8cpp-source.html#l00524">AddClient()</a>.<div class="fragment"><pre class="fragment"><a name="l00057"></a>00057 {
695 <a name="l00058"></a>00058         stringstream tmp;
696 <a name="l00059"></a>00059         <span class="keywordflow">if</span> (!(tmp &lt;&lt; in)) <span class="keywordflow">return</span> <a class="code" href="namespaceirc.html#string">string</a>();
697 <a name="l00060"></a>00060         <span class="keywordflow">return</span> tmp.str();
698 <a name="l00061"></a>00061 }
699 </pre></div>
700 <p>
701     </td>
702   </tr>
703 </table>
704 <a class="anchor" name="DeleteOper_28userrec_20_2Auser_29"></a><!-- doxytag: member="users.h::DeleteOper" ref="DeleteOper_28userrec_20_2Auser_29" args="(userrec *user)" --><p>
705 <table class="mdTable" cellpadding="2" cellspacing="0">
706   <tr>
707     <td class="mdRow">
708       <table cellpadding="0" cellspacing="0" border="0">
709         <tr>
710           <td class="md" nowrap valign="top">void DeleteOper           </td>
711           <td class="md" valign="top">(&nbsp;</td>
712           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
713           <td class="mdname1" valign="top" nowrap> <em>user</em>          </td>
714           <td class="md" valign="top">&nbsp;)&nbsp;</td>
715           <td class="md" nowrap></td>
716         </tr>
717       </table>
718     </td>
719   </tr>
720 </table>
721 <table cellspacing="5" cellpadding="0" border="0">
722   <tr>
723     <td>
724       &nbsp;
725     </td>
726     <td>
727
728 <p>
729
730 <p>
731 Definition at line <a class="el" href="users_8cpp-source.html#l00336">336</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
732 <p>
733 References <a class="el" href="users_8cpp-source.html#l00054">all_opers</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, and <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>.<div class="fragment"><pre class="fragment"><a name="l00337"></a>00337 {
734 <a name="l00338"></a>00338         <span class="keywordflow">for</span> (std::vector&lt;userrec*&gt;::iterator a = <a class="code" href="users_8cpp.html#all_5Fopers">all_opers</a>.begin(); a &lt; <a class="code" href="users_8cpp.html#all_5Fopers">all_opers</a>.end(); a++)
735 <a name="l00339"></a>00339         {
736 <a name="l00340"></a>00340                 <span class="keywordflow">if</span> (*a == user)
737 <a name="l00341"></a>00341                 {
738 <a name="l00342"></a>00342                         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Oper removed from optimization list"</span>);
739 <a name="l00343"></a>00343                         <a class="code" href="users_8cpp.html#all_5Fopers">all_opers</a>.erase(a);
740 <a name="l00344"></a>00344                         <span class="keywordflow">return</span>;
741 <a name="l00345"></a>00345                 }
742 <a name="l00346"></a>00346         }
743 <a name="l00347"></a>00347 }
744 </pre></div>
745 <p>
746     </td>
747   </tr>
748 </table>
749 <a class="anchor" name="force_5Fnickchange_28userrec_20_2Auser_2C_20const_20char_20_2Anewnick_29"></a><!-- doxytag: member="users.h::force_nickchange" ref="force_5Fnickchange_28userrec_20_2Auser_2C_20const_20char_20_2Anewnick_29" args="(userrec *user, const char *newnick)" --><p>
750 <table class="mdTable" cellpadding="2" cellspacing="0">
751   <tr>
752     <td class="mdRow">
753       <table cellpadding="0" cellspacing="0" border="0">
754         <tr>
755           <td class="md" nowrap valign="top">void force_nickchange           </td>
756           <td class="md" valign="top">(&nbsp;</td>
757           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
758           <td class="mdname" nowrap> <em>user</em>, </td>
759         </tr>
760         <tr>
761           <td class="md" nowrap align="right"></td>
762           <td class="md"></td>
763           <td class="md" nowrap>const char *&nbsp;</td>
764           <td class="mdname" nowrap> <em>newnick</em></td>
765         </tr>
766         <tr>
767           <td class="md"></td>
768           <td class="md">)&nbsp;</td>
769           <td class="md" colspan="2"></td>
770         </tr>
771       </table>
772     </td>
773   </tr>
774 </table>
775 <table cellspacing="5" cellpadding="0" border="0">
776   <tr>
777     <td>
778       &nbsp;
779     </td>
780     <td>
781
782 <p>
783
784 <p>
785 Definition at line <a class="el" href="users_8cpp-source.html#l00769">769</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
786 <p>
787 References <a class="el" href="modules_8h-source.html#l00090">FOREACH_RESULT</a>, <a class="el" href="users_8cpp-source.html#l00349">kill_link()</a>, <a class="el" href="xline_8h.html#matches_5Fqline_28const_20char_20_2Anick_29">matches_qline()</a>, <a class="el" href="inspircd_8h-source.html#l00110">InspIRCd::Parser</a>, <a class="el" href="connection_8h-source.html#l00080">connection::registered</a>, <a class="el" href="inspircd_8h-source.html#l00112">InspIRCd::stats</a>, and <a class="el" href="inspircd_8h-source.html#l00080">serverstats::statsCollisions</a>.
788 <p>
789 Referenced by <a class="el" href="modules_8cpp-source.html#l00385">Server::ChangeUserNick()</a>.<div class="fragment"><pre class="fragment"><a name="l00770"></a>00770 {
790 <a name="l00771"></a>00771         <span class="keywordtype">char</span> nick[MAXBUF];
791 <a name="l00772"></a>00772         <span class="keywordtype">int</span> MOD_RESULT = 0;
792 <a name="l00773"></a>00773 
793 <a name="l00774"></a>00774         strcpy(nick,<span class="stringliteral">""</span>);
794 <a name="l00775"></a>00775 
795 <a name="l00776"></a>00776         <a class="code" href="modules_8h.html#FOREACH_5FRESULT_28x_29">FOREACH_RESULT</a>(OnUserPreNick(user,newnick));
796 <a name="l00777"></a>00777         <span class="keywordflow">if</span> (MOD_RESULT) {
797 <a name="l00778"></a>00778                 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-&gt;<a class="code" href="classInspIRCd.html#stats">stats</a>-&gt;<a class="code" href="classserverstats.html#statsCollisions">statsCollisions</a>++;
798 <a name="l00779"></a>00779                 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(user,<span class="stringliteral">"Nickname collision"</span>);
799 <a name="l00780"></a>00780                 <span class="keywordflow">return</span>;
800 <a name="l00781"></a>00781         }
801 <a name="l00782"></a>00782         <span class="keywordflow">if</span> (<a class="code" href="xline_8h.html#matches_5Fqline_28const_20char_20_2Anick_29">matches_qline</a>(newnick))
802 <a name="l00783"></a>00783         {
803 <a name="l00784"></a>00784                 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-&gt;<a class="code" href="classInspIRCd.html#stats">stats</a>-&gt;<a class="code" href="classserverstats.html#statsCollisions">statsCollisions</a>++;
804 <a name="l00785"></a>00785                 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(user,<span class="stringliteral">"Nickname collision"</span>);
805 <a name="l00786"></a>00786                 <span class="keywordflow">return</span>;
806 <a name="l00787"></a>00787         }
807 <a name="l00788"></a>00788 
808 <a name="l00789"></a>00789         <span class="keywordflow">if</span> (user)
809 <a name="l00790"></a>00790         {
810 <a name="l00791"></a>00791                 <span class="keywordflow">if</span> (newnick)
811 <a name="l00792"></a>00792                 {
812 <a name="l00793"></a>00793                         strncpy(nick,newnick,MAXBUF);
813 <a name="l00794"></a>00794                 }
814 <a name="l00795"></a>00795                 <span class="keywordflow">if</span> (user-&gt;<a class="code" href="classconnection.html#registered">registered</a> == 7)
815 <a name="l00796"></a>00796                 {
816 <a name="l00797"></a>00797                         <span class="keywordtype">char</span>* pars[1];
817 <a name="l00798"></a>00798                         pars[0] = nick;
818 <a name="l00799"></a>00799                         <a class="code" href="namespaceirc.html#string">std::string</a> cmd = <span class="stringliteral">"NICK"</span>;
819 <a name="l00800"></a>00800                         <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-&gt;<a class="code" href="classInspIRCd.html#Parser">Parser</a>-&gt;CallHandler(cmd,pars,1,user);
820 <a name="l00801"></a>00801                 }
821 <a name="l00802"></a>00802         }
822 <a name="l00803"></a>00803 }
823 </pre></div>
824 <p>
825     </td>
826   </tr>
827 </table>
828 <a class="anchor" name="FullConnectUser_28userrec_20_2Auser_29"></a><!-- doxytag: member="users.h::FullConnectUser" ref="FullConnectUser_28userrec_20_2Auser_29" args="(userrec *user)" --><p>
829 <table class="mdTable" cellpadding="2" cellspacing="0">
830   <tr>
831     <td class="mdRow">
832       <table cellpadding="0" cellspacing="0" border="0">
833         <tr>
834           <td class="md" nowrap valign="top">void FullConnectUser           </td>
835           <td class="md" valign="top">(&nbsp;</td>
836           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
837           <td class="mdname1" valign="top" nowrap> <em>user</em>          </td>
838           <td class="md" valign="top">&nbsp;)&nbsp;</td>
839           <td class="md" nowrap></td>
840         </tr>
841       </table>
842     </td>
843   </tr>
844 </table>
845 <table cellspacing="5" cellpadding="0" border="0">
846   <tr>
847     <td>
848       &nbsp;
849     </td>
850     <td>
851
852 <p>
853
854 <p>
855 Definition at line <a class="el" href="users_8cpp-source.html#l00647">647</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
856 <p>
857 References <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, <a class="el" href="connection_8h-source.html#l00042">connection::fd</a>, <a class="el" href="modules_8h-source.html#l00082">FOREACH_MOD</a>, <a class="el" href="connection_8h-source.html#l00070">connection::haspassed</a>, <a class="el" href="connection_8h-source.html#l00046">connection::host</a>, <a class="el" href="users_8h-source.html#l00133">userrec::ident</a>, <a class="el" href="connection_8h-source.html#l00092">connection::idle_lastmsg</a>, <a class="el" href="connection_8h-source.html#l00050">connection::ip</a>, <a class="el" href="users_8cpp-source.html#l00349">kill_link()</a>, <a class="el" href="users_8cpp-source.html#l00412">kill_link_silent()</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="xline_8h.html#matches_5Fexception_28const_20char_20_2Ahost_29">matches_exception()</a>, <a class="el" href="xline_8h.html#matches_5Fgline_28const_20char_20_2Ahost_29">matches_gline()</a>, <a class="el" href="xline_8h.html#matches_5Fkline_28const_20char_20_2Ahost_29">matches_kline()</a>, <a class="el" href="inspircd__io_8h-source.html#l00075">ServerConfig::Network</a>, <a class="el" href="users_8h-source.html#l00128">userrec::nick</a>, <a class="el" href="connection_8h-source.html#l00076">connection::port</a>, <a class="el" href="connection_8h-source.html#l00080">connection::registered</a>, <a class="el" href="inspircd__io_8h-source.html#l00069">ServerConfig::ServerName</a>, <a class="el" href="inspircd_8h-source.html#l00112">InspIRCd::stats</a>, <a class="el" href="inspircd_8h-source.html#l00084">serverstats::statsConnects</a>, <a class="el" href="channels_8cpp.html#TIME">TIME</a>, <a class="el" href="globals_8h.html#WriteOpers_28char_20_2Atext_2C_2E_2E_2E_29">WriteOpers()</a>, and <a class="el" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ()</a>.
858 <p>
859 Referenced by <a class="el" href="users_8cpp-source.html#l00731">ConnectUser()</a>.<div class="fragment"><pre class="fragment"><a name="l00648"></a>00648 {
860 <a name="l00649"></a>00649         <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-&gt;<a class="code" href="classInspIRCd.html#stats">stats</a>-&gt;<a class="code" href="classserverstats.html#statsConnects">statsConnects</a>++;
861 <a name="l00650"></a>00650         user-&gt;<a class="code" href="classconnection.html#idle_5Flastmsg">idle_lastmsg</a> = <a class="code" href="channels_8cpp.html#TIME">TIME</a>;
862 <a name="l00651"></a>00651         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"ConnectUser: %s"</span>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>);
863 <a name="l00652"></a>00652 
864 <a name="l00653"></a>00653         <span class="keywordflow">if</span> ((strcmp(Passwd(user),<span class="stringliteral">""</span>)) &amp;&amp; (!user-&gt;<a class="code" href="classconnection.html#haspassed">haspassed</a>))
865 <a name="l00654"></a>00654         {
866 <a name="l00655"></a>00655                 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(user,<span class="stringliteral">"Invalid password"</span>);
867 <a name="l00656"></a>00656                 <span class="keywordflow">return</span>;
868 <a name="l00657"></a>00657         }
869 <a name="l00658"></a>00658         <span class="keywordflow">if</span> (IsDenied(user))
870 <a name="l00659"></a>00659         {
871 <a name="l00660"></a>00660                 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(user,<span class="stringliteral">"Unauthorised connection"</span>);
872 <a name="l00661"></a>00661                 <span class="keywordflow">return</span>;
873 <a name="l00662"></a>00662         }
874 <a name="l00663"></a>00663 
875 <a name="l00664"></a>00664         <span class="keywordtype">char</span> match_against[MAXBUF];
876 <a name="l00665"></a>00665         snprintf(match_against,MAXBUF,<span class="stringliteral">"%s@%s"</span>,user-&gt;<a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-&gt;<a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>);
877 <a name="l00666"></a>00666         <span class="keywordtype">char</span>* e = <a class="code" href="xline_8h.html#matches_5Fexception_28const_20char_20_2Ahost_29">matches_exception</a>(match_against);
878 <a name="l00667"></a>00667         <span class="keywordflow">if</span> (!e)
879 <a name="l00668"></a>00668         {
880 <a name="l00669"></a>00669                 <span class="keywordtype">char</span>* r = <a class="code" href="xline_8h.html#matches_5Fgline_28const_20char_20_2Ahost_29">matches_gline</a>(match_against);
881 <a name="l00670"></a>00670                 <span class="keywordflow">if</span> (r)
882 <a name="l00671"></a>00671                 {
883 <a name="l00672"></a>00672                         <span class="keywordtype">char</span> reason[MAXBUF];
884 <a name="l00673"></a>00673                         snprintf(reason,MAXBUF,<span class="stringliteral">"G-Lined: %s"</span>,r);
885 <a name="l00674"></a>00674                         <a class="code" href="users_8cpp.html#kill_5Flink_5Fsilent_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link_silent</a>(user,reason);
886 <a name="l00675"></a>00675                         <span class="keywordflow">return</span>;
887 <a name="l00676"></a>00676                 }
888 <a name="l00677"></a>00677                 r = <a class="code" href="xline_8h.html#matches_5Fkline_28const_20char_20_2Ahost_29">matches_kline</a>(user-&gt;<a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>);
889 <a name="l00678"></a>00678                 <span class="keywordflow">if</span> (r)
890 <a name="l00679"></a>00679                 {
891 <a name="l00680"></a>00680                         <span class="keywordtype">char</span> reason[MAXBUF];
892 <a name="l00681"></a>00681                         snprintf(reason,MAXBUF,<span class="stringliteral">"K-Lined: %s"</span>,r);
893 <a name="l00682"></a>00682                         <a class="code" href="users_8cpp.html#kill_5Flink_5Fsilent_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link_silent</a>(user,reason);
894 <a name="l00683"></a>00683                         <span class="keywordflow">return</span>;
895 <a name="l00684"></a>00684                 }
896 <a name="l00685"></a>00685         }
897 <a name="l00686"></a>00686 
898 <a name="l00687"></a>00687 
899 <a name="l00688"></a>00688         <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"NOTICE Auth :Welcome to \002%s\002!"</span>,<a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#Network_5BMAXBUF_5D">Network</a>);
900 <a name="l00689"></a>00689         <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"001 %s :Welcome to the %s IRC Network %s!%s@%s"</span>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,<a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#Network_5BMAXBUF_5D">Network</a>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,user-&gt;<a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-&gt;<a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>);
901 <a name="l00690"></a>00690         <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"002 %s :Your host is %s, running version %s"</span>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,<a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#ServerName_5BMAXBUF_5D">ServerName</a>,VERSION);
902 <a name="l00691"></a>00691         <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"003 %s :This server was created %s %s"</span>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,__TIME__,__DATE__);
903 <a name="l00692"></a>00692         <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"004 %s %s %s iowghraAsORVSxNCWqBzvdHtGI lvhopsmntikrRcaqOALQbSeKVfHGCuzN"</span>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,<a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#ServerName_5BMAXBUF_5D">ServerName</a>,VERSION);
904 <a name="l00693"></a>00693         <span class="comment">// the neatest way to construct the initial 005 numeric, considering the number of configure constants to go in it...</span>
905 <a name="l00694"></a>00694         std::stringstream v;
906 <a name="l00695"></a>00695         v &lt;&lt; <span class="stringliteral">"WALLCHOPS MODES=13 CHANTYPES=# PREFIX=(ohv)@%+ MAP SAFELIST MAXCHANNELS="</span> &lt;&lt; MAXCHANS;
907 <a name="l00696"></a>00696         v &lt;&lt; <span class="stringliteral">" MAXBANS=60 NICKLEN="</span> &lt;&lt; NICKMAX;
908 <a name="l00697"></a>00697         v &lt;&lt; <span class="stringliteral">" TOPICLEN="</span> &lt;&lt; MAXTOPIC &lt;&lt; <span class="stringliteral">" KICKLEN="</span> &lt;&lt; MAXKICK &lt;&lt; <span class="stringliteral">" MAXTARGETS=20 AWAYLEN="</span> &lt;&lt; MAXAWAY &lt;&lt; <span class="stringliteral">" CHANMODES=ohvb,k,l,psmnti NETWORK="</span>;
909 <a name="l00698"></a>00698         v &lt;&lt; <a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#Network_5BMAXBUF_5D">Network</a>;
910 <a name="l00699"></a>00699         <a class="code" href="namespaceirc.html#string">std::string</a> data005 = v.str();
911 <a name="l00700"></a>00700         <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> On005Numeric(data005);
912 <a name="l00701"></a>00701         <span class="comment">// anfl @ #ratbox, efnet reminded me that according to the RFC this cant contain more than 13 tokens per line...</span>
913 <a name="l00702"></a>00702         <span class="comment">// so i'd better split it :)</span>
914 <a name="l00703"></a>00703         std::stringstream out(data005);
915 <a name="l00704"></a>00704         <a class="code" href="namespaceirc.html#string">std::string</a> token = <span class="stringliteral">""</span>;
916 <a name="l00705"></a>00705         <a class="code" href="namespaceirc.html#string">std::string</a> line5 = <span class="stringliteral">""</span>;
917 <a name="l00706"></a>00706         <span class="keywordtype">int</span> token_counter = 0;
918 <a name="l00707"></a>00707         <span class="keywordflow">while</span> (!out.eof())
919 <a name="l00708"></a>00708         {
920 <a name="l00709"></a>00709                 out &gt;&gt; token;
921 <a name="l00710"></a>00710                 line5 = line5 + token + <span class="stringliteral">" "</span>;
922 <a name="l00711"></a>00711                 token_counter++;
923 <a name="l00712"></a>00712                 <span class="keywordflow">if</span> ((token_counter &gt;= 13) || (out.eof() == <span class="keyword">true</span>))
924 <a name="l00713"></a>00713                 {
925 <a name="l00714"></a>00714                         <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"005 %s %s:are supported by this server"</span>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,line5.c_str());
926 <a name="l00715"></a>00715                         line5 = <span class="stringliteral">""</span>;
927 <a name="l00716"></a>00716                         token_counter = 0;
928 <a name="l00717"></a>00717                 }
929 <a name="l00718"></a>00718         }
930 <a name="l00719"></a>00719         ShowMOTD(user);
931 <a name="l00720"></a>00720 
932 <a name="l00721"></a>00721         <span class="comment">// fix 3 by brain, move registered = 7 below these so that spurious modes and host changes dont go out</span>
933 <a name="l00722"></a>00722         <span class="comment">// onto the network and produce 'fake direction'</span>
934 <a name="l00723"></a>00723         <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnUserConnect(user);
935 <a name="l00724"></a>00724         <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnGlobalConnect(user);
936 <a name="l00725"></a>00725         user-&gt;<a class="code" href="classconnection.html#registered">registered</a> = 7;
937 <a name="l00726"></a>00726         <a class="code" href="globals_8h.html#WriteOpers_28char_20_2Atext_2C_2E_2E_2E_29">WriteOpers</a>(<span class="stringliteral">"*** Client connecting on port %lu: %s!%s@%s [%s]"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)user-&gt;<a class="code" href="classconnection.html#port">port</a>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,user-&gt;<a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-&gt;<a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>,user-&gt;<a class="code" href="classconnection.html#ip_5B_31_36_5D">ip</a>);
938 <a name="l00727"></a>00727 }
939 </pre></div>
940 <p>
941     </td>
942   </tr>
943 </table>
944 <a class="anchor" name="kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29"></a><!-- doxytag: member="users.h::kill_link" ref="kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29" args="(userrec *user, const char *r)" --><p>
945 <table class="mdTable" cellpadding="2" cellspacing="0">
946   <tr>
947     <td class="mdRow">
948       <table cellpadding="0" cellspacing="0" border="0">
949         <tr>
950           <td class="md" nowrap valign="top">void kill_link           </td>
951           <td class="md" valign="top">(&nbsp;</td>
952           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
953           <td class="mdname" nowrap> <em>user</em>, </td>
954         </tr>
955         <tr>
956           <td class="md" nowrap align="right"></td>
957           <td class="md"></td>
958           <td class="md" nowrap>const char *&nbsp;</td>
959           <td class="mdname" nowrap> <em>r</em></td>
960         </tr>
961         <tr>
962           <td class="md"></td>
963           <td class="md">)&nbsp;</td>
964           <td class="md" colspan="2"></td>
965         </tr>
966       </table>
967     </td>
968   </tr>
969 </table>
970 <table cellspacing="5" cellpadding="0" border="0">
971   <tr>
972     <td>
973       &nbsp;
974     </td>
975     <td>
976
977 <p>
978
979 <p>
980 Definition at line <a class="el" href="users_8cpp-source.html#l00349">349</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
981 <p>
982 References <a class="el" href="users_8cpp-source.html#l00471">AddWhoWas()</a>, <a class="el" href="modules_8cpp.html#clientlist">clientlist</a>, <a class="el" href="users_8cpp-source.html#l00093">userrec::CloseSocket()</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, <a class="el" href="socketengine_8cpp-source.html#l00103">SocketEngine::DelFd()</a>, <a class="el" href="connection_8h-source.html#l00042">connection::fd</a>, <a class="el" href="users_8cpp-source.html#l00295">userrec::FlushWriteBuf()</a>, <a class="el" href="modules_8h-source.html#l00082">FOREACH_MOD</a>, <a class="el" href="classServerConfig.html#GetIOHook_28int_20port_29">ServerConfig::GetIOHook()</a>, <a class="el" href="connection_8h-source.html#l00046">connection::host</a>, <a class="el" href="users_8h-source.html#l00133">userrec::ident</a>, <a class="el" href="users_8cpp-source.html#l00052">local_users</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="users_8h-source.html#l00128">userrec::nick</a>, <a class="el" href="modules_8cpp-source.html#l00270">Module::OnRawSocketClose()</a>, <a class="el" href="connection_8h-source.html#l00076">connection::port</a>, <a class="el" href="connection_8h-source.html#l00080">connection::registered</a>, <a class="el" href="inspircd_8h-source.html#l00111">InspIRCd::SE</a>, <a class="el" href="globals_8h.html#Write_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">Write()</a>, <a class="el" href="globals_8h.html#WriteCommonExcept_28userrec_20_2Au_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteCommonExcept()</a>, and <a class="el" href="globals_8h.html#WriteOpers_28char_20_2Atext_2C_2E_2E_2E_29">WriteOpers()</a>.
983 <p>
984 Referenced by <a class="el" href="users_8cpp-source.html#l00524">AddClient()</a>, <a class="el" href="users_8cpp-source.html#l00769">force_nickchange()</a>, <a class="el" href="users_8cpp-source.html#l00647">FullConnectUser()</a>, <a class="el" href="modules_8cpp-source.html#l00609">Server::PseudoToUser()</a>, and <a class="el" href="modules_8cpp-source.html#l00390">Server::QuitUser()</a>.<div class="fragment"><pre class="fragment"><a name="l00350"></a>00350 {
985 <a name="l00351"></a>00351         user_hash::iterator iter = <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.find(user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>);
986 <a name="l00352"></a>00352 
987 <a name="l00353"></a>00353         <span class="keywordtype">char</span> reason[MAXBUF];
988 <a name="l00354"></a>00354 
989 <a name="l00355"></a>00355         strncpy(reason,r,MAXBUF);
990 <a name="l00356"></a>00356 
991 <a name="l00357"></a>00357         <span class="keywordflow">if</span> (strlen(reason)&gt;MAXQUIT)
992 <a name="l00358"></a>00358         {
993 <a name="l00359"></a>00359                 reason[MAXQUIT-1] = <span class="charliteral">'\0'</span>;
994 <a name="l00360"></a>00360         }
995 <a name="l00361"></a>00361 
996 <a name="l00362"></a>00362         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"kill_link: %s '%s'"</span>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,reason);
997 <a name="l00363"></a>00363         <a class="code" href="globals_8h.html#Write_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">Write</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"ERROR :Closing link (%s@%s) [%s]"</span>,user-&gt;<a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-&gt;<a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>,reason);
998 <a name="l00364"></a>00364         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"closing fd %lu"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)user-&gt;<a class="code" href="classconnection.html#fd">fd</a>);
999 <a name="l00365"></a>00365 
1000 <a name="l00366"></a>00366         <span class="keywordflow">if</span> (user-&gt;<a class="code" href="classconnection.html#registered">registered</a> == 7) {
1001 <a name="l00367"></a>00367                 <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnUserQuit(user,reason);
1002 <a name="l00368"></a>00368                 <a class="code" href="globals_8h.html#WriteCommonExcept_28userrec_20_2Au_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteCommonExcept</a>(user,<span class="stringliteral">"QUIT :%s"</span>,reason);
1003 <a name="l00369"></a>00369         }
1004 <a name="l00370"></a>00370 
1005 <a name="l00371"></a>00371         user-&gt;<a class="code" href="classuserrec.html#FlushWriteBuf_28_29">FlushWriteBuf</a>();
1006 <a name="l00372"></a>00372 
1007 <a name="l00373"></a>00373         <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnUserDisconnect(user);
1008 <a name="l00374"></a>00374 
1009 <a name="l00375"></a>00375         <span class="keywordflow">if</span> (user-&gt;<a class="code" href="classconnection.html#fd">fd</a> &gt; -1)
1010 <a name="l00376"></a>00376         {
1011 <a name="l00377"></a>00377                 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#GetIOHook_28int_20port_29">GetIOHook</a>(user-&gt;<a class="code" href="classconnection.html#port">port</a>))
1012 <a name="l00378"></a>00378                 {
1013 <a name="l00379"></a>00379                         <a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#GetIOHook_28int_20port_29">GetIOHook</a>(user-&gt;<a class="code" href="classconnection.html#port">port</a>)-&gt;<a class="code" href="classModule.html#OnRawSocketClose_28int_20fd_29">OnRawSocketClose</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>);
1014 <a name="l00380"></a>00380                 }
1015 <a name="l00381"></a>00381                 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-&gt;<a class="code" href="classInspIRCd.html#SE">SE</a>-&gt;<a class="code" href="classSocketEngine.html#DelFd_28int_20fd_29">DelFd</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>);
1016 <a name="l00382"></a>00382                 user-&gt;<a class="code" href="classuserrec.html#CloseSocket_28_29">CloseSocket</a>();
1017 <a name="l00383"></a>00383         }
1018 <a name="l00384"></a>00384 
1019 <a name="l00385"></a>00385         <span class="comment">// this must come before the WriteOpers so that it doesnt try to fill their buffer with anything</span>
1020 <a name="l00386"></a>00386         <span class="comment">// if they were an oper with +s.</span>
1021 <a name="l00387"></a>00387         <span class="keywordflow">if</span> (user-&gt;<a class="code" href="classconnection.html#registered">registered</a> == 7) {
1022 <a name="l00388"></a>00388                 purge_empty_chans(user);
1023 <a name="l00389"></a>00389                 <span class="comment">// fix by brain: only show local quits because we only show local connects (it just makes SENSE)</span>
1024 <a name="l00390"></a>00390                 <span class="keywordflow">if</span> (user-&gt;<a class="code" href="classconnection.html#fd">fd</a> &gt; -1)
1025 <a name="l00391"></a>00391                         <a class="code" href="globals_8h.html#WriteOpers_28char_20_2Atext_2C_2E_2E_2E_29">WriteOpers</a>(<span class="stringliteral">"*** Client exiting: %s!%s@%s [%s]"</span>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,user-&gt;<a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-&gt;<a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>,reason);
1026 <a name="l00392"></a>00392                 <a class="code" href="users_8cpp.html#AddWhoWas_28userrec_20_2Au_29">AddWhoWas</a>(user);
1027 <a name="l00393"></a>00393         }
1028 <a name="l00394"></a>00394 
1029 <a name="l00395"></a>00395         <span class="keywordflow">if</span> (iter != <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.end())
1030 <a name="l00396"></a>00396         {
1031 <a name="l00397"></a>00397                 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"deleting user hash value %lu"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)user);
1032 <a name="l00398"></a>00398                 <span class="keywordflow">if</span> (user-&gt;<a class="code" href="classconnection.html#fd">fd</a> &gt; -1)
1033 <a name="l00399"></a>00399                 {
1034 <a name="l00400"></a>00400                         <a class="code" href="modules_8cpp.html#fd_5Fref_5Ftable_5B_36_35_35_33_36_5D">fd_ref_table</a>[user-&gt;<a class="code" href="classconnection.html#fd">fd</a>] = NULL;
1035 <a name="l00401"></a>00401                         <span class="keywordflow">if</span> (find(<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.begin(),<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end(),user) != <a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end())
1036 <a name="l00402"></a>00402                         {
1037 <a name="l00403"></a>00403                                 <a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.erase(find(<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.begin(),<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end(),user));
1038 <a name="l00404"></a>00404                                 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Delete local user"</span>);
1039 <a name="l00405"></a>00405                         }
1040 <a name="l00406"></a>00406                 }
1041 <a name="l00407"></a>00407                 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.erase(iter);
1042 <a name="l00408"></a>00408         }
1043 <a name="l00409"></a>00409         <span class="keyword">delete</span> user;
1044 <a name="l00410"></a>00410 }
1045 </pre></div>
1046 <p>
1047     </td>
1048   </tr>
1049 </table>
1050 <a class="anchor" name="kill_5Flink_5Fsilent_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29"></a><!-- doxytag: member="users.h::kill_link_silent" ref="kill_5Flink_5Fsilent_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29" args="(userrec *user, const char *r)" --><p>
1051 <table class="mdTable" cellpadding="2" cellspacing="0">
1052   <tr>
1053     <td class="mdRow">
1054       <table cellpadding="0" cellspacing="0" border="0">
1055         <tr>
1056           <td class="md" nowrap valign="top">void kill_link_silent           </td>
1057           <td class="md" valign="top">(&nbsp;</td>
1058           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> *&nbsp;</td>
1059           <td class="mdname" nowrap> <em>user</em>, </td>
1060         </tr>
1061         <tr>
1062           <td class="md" nowrap align="right"></td>
1063           <td class="md"></td>
1064           <td class="md" nowrap>const char *&nbsp;</td>
1065           <td class="mdname" nowrap> <em>r</em></td>
1066         </tr>
1067         <tr>
1068           <td class="md"></td>
1069           <td class="md">)&nbsp;</td>
1070           <td class="md" colspan="2"></td>
1071         </tr>
1072       </table>
1073     </td>
1074   </tr>
1075 </table>
1076 <table cellspacing="5" cellpadding="0" border="0">
1077   <tr>
1078     <td>
1079       &nbsp;
1080     </td>
1081     <td>
1082
1083 <p>
1084
1085 <p>
1086 Definition at line <a class="el" href="users_8cpp-source.html#l00412">412</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
1087 <p>
1088 References <a class="el" href="modules_8cpp.html#clientlist">clientlist</a>, <a class="el" href="users_8cpp-source.html#l00093">userrec::CloseSocket()</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, <a class="el" href="socketengine_8cpp-source.html#l00103">SocketEngine::DelFd()</a>, <a class="el" href="connection_8h-source.html#l00042">connection::fd</a>, <a class="el" href="users_8cpp-source.html#l00295">userrec::FlushWriteBuf()</a>, <a class="el" href="modules_8h-source.html#l00082">FOREACH_MOD</a>, <a class="el" href="classServerConfig.html#GetIOHook_28int_20port_29">ServerConfig::GetIOHook()</a>, <a class="el" href="connection_8h-source.html#l00046">connection::host</a>, <a class="el" href="users_8h-source.html#l00133">userrec::ident</a>, <a class="el" href="users_8cpp-source.html#l00052">local_users</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="users_8h-source.html#l00128">userrec::nick</a>, <a class="el" href="modules_8cpp-source.html#l00270">Module::OnRawSocketClose()</a>, <a class="el" href="connection_8h-source.html#l00076">connection::port</a>, <a class="el" href="connection_8h-source.html#l00080">connection::registered</a>, <a class="el" href="inspircd_8h-source.html#l00111">InspIRCd::SE</a>, <a class="el" href="globals_8h.html#Write_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">Write()</a>, and <a class="el" href="globals_8h.html#WriteCommonExcept_28userrec_20_2Au_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteCommonExcept()</a>.
1089 <p>
1090 Referenced by <a class="el" href="users_8cpp-source.html#l00647">FullConnectUser()</a>.<div class="fragment"><pre class="fragment"><a name="l00413"></a>00413 {
1091 <a name="l00414"></a>00414         user_hash::iterator iter = <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.find(user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>);
1092 <a name="l00415"></a>00415 
1093 <a name="l00416"></a>00416         <span class="keywordtype">char</span> reason[MAXBUF];
1094 <a name="l00417"></a>00417 
1095 <a name="l00418"></a>00418         strncpy(reason,r,MAXBUF);
1096 <a name="l00419"></a>00419 
1097 <a name="l00420"></a>00420         <span class="keywordflow">if</span> (strlen(reason)&gt;MAXQUIT)
1098 <a name="l00421"></a>00421         {
1099 <a name="l00422"></a>00422                 reason[MAXQUIT-1] = <span class="charliteral">'\0'</span>;
1100 <a name="l00423"></a>00423         }
1101 <a name="l00424"></a>00424 
1102 <a name="l00425"></a>00425         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"kill_link: %s '%s'"</span>,user-&gt;<a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,reason);
1103 <a name="l00426"></a>00426         <a class="code" href="globals_8h.html#Write_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">Write</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"ERROR :Closing link (%s@%s) [%s]"</span>,user-&gt;<a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-&gt;<a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>,reason);
1104 <a name="l00427"></a>00427         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"closing fd %lu"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)user-&gt;<a class="code" href="classconnection.html#fd">fd</a>);
1105 <a name="l00428"></a>00428 
1106 <a name="l00429"></a>00429         user-&gt;<a class="code" href="classuserrec.html#FlushWriteBuf_28_29">FlushWriteBuf</a>();
1107 <a name="l00430"></a>00430 
1108 <a name="l00431"></a>00431         <span class="keywordflow">if</span> (user-&gt;<a class="code" href="classconnection.html#registered">registered</a> == 7) {
1109 <a name="l00432"></a>00432                 <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnUserQuit(user,reason);
1110 <a name="l00433"></a>00433                 <a class="code" href="globals_8h.html#WriteCommonExcept_28userrec_20_2Au_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteCommonExcept</a>(user,<span class="stringliteral">"QUIT :%s"</span>,reason);
1111 <a name="l00434"></a>00434         }
1112 <a name="l00435"></a>00435 
1113 <a name="l00436"></a>00436         <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnUserDisconnect(user);
1114 <a name="l00437"></a>00437 
1115 <a name="l00438"></a>00438         <span class="keywordflow">if</span> (user-&gt;<a class="code" href="classconnection.html#fd">fd</a> &gt; -1)
1116 <a name="l00439"></a>00439         {
1117 <a name="l00440"></a>00440                 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#GetIOHook_28int_20port_29">GetIOHook</a>(user-&gt;<a class="code" href="classconnection.html#port">port</a>))
1118 <a name="l00441"></a>00441                 {
1119 <a name="l00442"></a>00442                         <a class="code" href="channels_8cpp.html#Config">Config</a>-&gt;<a class="code" href="classServerConfig.html#GetIOHook_28int_20port_29">GetIOHook</a>(user-&gt;<a class="code" href="classconnection.html#port">port</a>)-&gt;<a class="code" href="classModule.html#OnRawSocketClose_28int_20fd_29">OnRawSocketClose</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>);
1120 <a name="l00443"></a>00443                 }
1121 <a name="l00444"></a>00444                 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-&gt;<a class="code" href="classInspIRCd.html#SE">SE</a>-&gt;<a class="code" href="classSocketEngine.html#DelFd_28int_20fd_29">DelFd</a>(user-&gt;<a class="code" href="classconnection.html#fd">fd</a>);
1122 <a name="l00445"></a>00445                 user-&gt;<a class="code" href="classuserrec.html#CloseSocket_28_29">CloseSocket</a>();
1123 <a name="l00446"></a>00446         }
1124 <a name="l00447"></a>00447 
1125 <a name="l00448"></a>00448         <span class="keywordflow">if</span> (user-&gt;<a class="code" href="classconnection.html#registered">registered</a> == 7) {
1126 <a name="l00449"></a>00449                 purge_empty_chans(user);
1127 <a name="l00450"></a>00450         }
1128 <a name="l00451"></a>00451 
1129 <a name="l00452"></a>00452         <span class="keywordflow">if</span> (iter != <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.end())
1130 <a name="l00453"></a>00453         {
1131 <a name="l00454"></a>00454                 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"deleting user hash value %lu"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)user);
1132 <a name="l00455"></a>00455                 <span class="keywordflow">if</span> (user-&gt;<a class="code" href="classconnection.html#fd">fd</a> &gt; -1)
1133 <a name="l00456"></a>00456                 {
1134 <a name="l00457"></a>00457                         <a class="code" href="modules_8cpp.html#fd_5Fref_5Ftable_5B_36_35_35_33_36_5D">fd_ref_table</a>[user-&gt;<a class="code" href="classconnection.html#fd">fd</a>] = NULL;
1135 <a name="l00458"></a>00458                         <span class="keywordflow">if</span> (find(<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.begin(),<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end(),user) != <a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end())
1136 <a name="l00459"></a>00459                         {
1137 <a name="l00460"></a>00460                                 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Delete local user"</span>);
1138 <a name="l00461"></a>00461                                 <a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.erase(find(<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.begin(),<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end(),user));
1139 <a name="l00462"></a>00462                         }
1140 <a name="l00463"></a>00463                 }
1141 <a name="l00464"></a>00464                 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.erase(iter);
1142 <a name="l00465"></a>00465         }
1143 <a name="l00466"></a>00466         <span class="keyword">delete</span> user;
1144 <a name="l00467"></a>00467 }
1145 </pre></div>
1146 <p>
1147     </td>
1148   </tr>
1149 </table>
1150 <a class="anchor" name="ReHashNick_28char_20_2AOld_2C_20char_20_2ANew_29"></a><!-- doxytag: member="users.h::ReHashNick" ref="ReHashNick_28char_20_2AOld_2C_20char_20_2ANew_29" args="(char *Old, char *New)" --><p>
1151 <table class="mdTable" cellpadding="2" cellspacing="0">
1152   <tr>
1153     <td class="mdRow">
1154       <table cellpadding="0" cellspacing="0" border="0">
1155         <tr>
1156           <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a>* ReHashNick           </td>
1157           <td class="md" valign="top">(&nbsp;</td>
1158           <td class="md" nowrap valign="top">char *&nbsp;</td>
1159           <td class="mdname" nowrap> <em>Old</em>, </td>
1160         </tr>
1161         <tr>
1162           <td class="md" nowrap align="right"></td>
1163           <td class="md"></td>
1164           <td class="md" nowrap>char *&nbsp;</td>
1165           <td class="mdname" nowrap> <em>New</em></td>
1166         </tr>
1167         <tr>
1168           <td class="md"></td>
1169           <td class="md">)&nbsp;</td>
1170           <td class="md" colspan="2"></td>
1171         </tr>
1172       </table>
1173     </td>
1174   </tr>
1175 </table>
1176 <table cellspacing="5" cellpadding="0" border="0">
1177   <tr>
1178     <td>
1179       &nbsp;
1180     </td>
1181     <td>
1182
1183 <p>
1184
1185 <p>
1186 Definition at line <a class="el" href="users_8cpp-source.html#l00743">743</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
1187 <p>
1188 References <a class="el" href="modules_8cpp.html#clientlist">clientlist</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, and <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>.<div class="fragment"><pre class="fragment"><a name="l00744"></a>00744 {
1189 <a name="l00745"></a>00745         <span class="comment">//user_hash::iterator newnick;</span>
1190 <a name="l00746"></a>00746         user_hash::iterator oldnick = <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.find(Old);
1191 <a name="l00747"></a>00747 
1192 <a name="l00748"></a>00748         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"ReHashNick: %s %s"</span>,Old,New);
1193 <a name="l00749"></a>00749 
1194 <a name="l00750"></a>00750         <span class="keywordflow">if</span> (!strcasecmp(Old,New))
1195 <a name="l00751"></a>00751         {
1196 <a name="l00752"></a>00752                 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"old nick is new nick, skipping"</span>);
1197 <a name="l00753"></a>00753                 <span class="keywordflow">return</span> oldnick-&gt;second;
1198 <a name="l00754"></a>00754         }
1199 <a name="l00755"></a>00755 
1200 <a name="l00756"></a>00756         <span class="keywordflow">if</span> (oldnick == <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.end()) <span class="keywordflow">return</span> NULL; <span class="comment">/* doesnt exist */</span>
1201 <a name="l00757"></a>00757 
1202 <a name="l00758"></a>00758         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"ReHashNick: Found hashed nick %s"</span>,Old);
1203 <a name="l00759"></a>00759 
1204 <a name="l00760"></a>00760         <a class="code" href="classuserrec.html">userrec</a>* olduser = oldnick-&gt;second;
1205 <a name="l00761"></a>00761         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[New] = olduser;
1206 <a name="l00762"></a>00762         <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.erase(oldnick);
1207 <a name="l00763"></a>00763 
1208 <a name="l00764"></a>00764         <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"ReHashNick: Nick rehashed as %s"</span>,New);
1209 <a name="l00765"></a>00765 
1210 <a name="l00766"></a>00766         <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[New];
1211 <a name="l00767"></a>00767 }
1212 </pre></div>
1213 <p>
1214     </td>
1215   </tr>
1216 </table>
1217 <hr size="1"><address style="align: right;"><small>Generated on Mon Dec 19 18:05:21 2005 for InspIRCd by&nbsp;
1218 <a href="http://www.doxygen.org/index.html">
1219 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4-20050815 </small></address>
1220 </body>
1221 </html>