summaryrefslogtreecommitdiff
path: root/docs/module-doc/classuserrec.html
blob: 1ca6025f21a0e393d83695593d51e5ca9042daeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>InspIRCd: userrec class Reference</title>
<link href="inspircd.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<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">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>userrec Class Reference</h1>Holds all information about a user This class stores all information about a user connected to the irc server.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="users_8h-source.html">users.h</a>&gt;</code>
<p>
Inherits <a class="el" href="classconnection.html">connection</a>.
<p>
<a href="classuserrec-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a0">userrec</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a1">~userrec</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a2">GetFullHost</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the full displayed host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a3">GetFullRealHost</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the full real host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form. </em> <a href="#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a4">IsInvited</a> (char *channel)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if a user is invited to a channel. </em> <a href="#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a5">InviteTo</a> (char *channel)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adds a channel to a users invite list (invites them to a channel). </em> <a href="#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a6">RemoveInvite</a> (char *channel)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removes a channel from a users invite list. </em> <a href="#a6"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#a7">HasPermission</a> (char *command)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true or false for if a user can execute a privilaged oper command. </em> <a href="#a7"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o0">nick</a> [NICKMAX]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The users nickname. </em> <a href="#o0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o1">ident</a> [64]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The users ident reply. </em> <a href="#o1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o2">dhost</a> [256]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The host displayed to non-opers (used for cloaking etc). </em> <a href="#o2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o3">fullname</a> [128]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The users full name. </em> <a href="#o3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o4">modes</a> [MAXBUF]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The user's mode string. </em> <a href="#o4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classucrec.html">ucrec</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o5">chans</a> [MAXCHANS]</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o6">server</a> [256]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The server the user is connected to. </em> <a href="#o6"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o7">awaymsg</a> [512]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The user's away message. </em> <a href="#o7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o8">result</a> [256]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stores the result of the last GetFullHost or GetRealHost call. </em> <a href="#o8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o9">flood</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of lines the user can place into the buffer (up to the global NetBufferSize bytes) before they are disconnected for excess flood. </em> <a href="#o9"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>unsigned long&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o10">timeout</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of seconds this user is given to send USER/NICK If they do not send their details in this time limit they will be disconnected. </em> <a href="#o10"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#o11">oper</a> [NICKMAX]</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The oper type they logged in as, if they are an oper. </em> <a href="#o11"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="users_8h.html#a6">InvitedList</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classuserrec.html#r0">invites</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A list of channels the user has a pending invite to. </em> <a href="#r0"></a><em><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Holds all information about a user This class stores all information about a user connected to the irc server. 
<p>
Everything about a connection is stored here primarily, from the user's socket ID (file descriptor) through to the user's nickname and hostname. Use the Find method of the server class to locate a specific user by nickname. 
<p>

<p>
Definition at line <a class="el" href="users_8h-source.html#l00089">89</a> of file <a class="el" href="users_8h-source.html">users.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a0" doxytag="userrec::userrec"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> userrec::userrec </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00026">26</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="users_8h-source.html#l00132">awaymsg</a>, <a class="el" href="connection_8h-source.html#l00194">connection::bytes_in</a>, <a class="el" href="connection_8h-source.html#l00198">connection::bytes_out</a>, <a class="el" href="channels_8h-source.html#l00213">ucrec::channel</a>, <a class="el" href="users_8h-source.html#l00123">chans</a>, <a class="el" href="connection_8h-source.html#l00202">connection::cmds_in</a>, <a class="el" href="connection_8h-source.html#l00206">connection::cmds_out</a>, <a class="el" href="users_8h-source.html#l00111">dhost</a>, <a class="el" href="connection_8h-source.html#l00178">connection::fd</a>, <a class="el" href="users_8h-source.html#l00143">flood</a>, <a class="el" href="users_8h-source.html#l00115">fullname</a>, <a class="el" href="connection_8h-source.html#l00210">connection::haspassed</a>, <a class="el" href="connection_8h-source.html#l00182">connection::host</a>, <a class="el" href="users_8h-source.html#l00106">ident</a>, <a class="el" href="connection_8h-source.html#l00236">connection::idle_lastmsg</a>, <a class="el" href="connection_8h-source.html#l00190">connection::inbuf</a>, <a class="el" href="users_8h-source.html#l00095">invites</a>, <a class="el" href="connection_8h-source.html#l00186">connection::ip</a>, <a class="el" href="connection_8h-source.html#l00228">connection::lastping</a>, <a class="el" href="users_8h-source.html#l00121">modes</a>, <a class="el" href="users_8h-source.html#l00102">nick</a>, <a class="el" href="connection_8h-source.html#l00240">connection::nping</a>, <a class="el" href="users_8h-source.html#l00156">oper</a>, <a class="el" href="connection_8h-source.html#l00216">connection::port</a>, <a class="el" href="connection_8h-source.html#l00220">connection::registered</a>, <a class="el" href="users_8h-source.html#l00137">result</a>, <a class="el" href="users_8h-source.html#l00127">server</a>, <a class="el" href="connection_8h-source.html#l00232">connection::signon</a>, <a class="el" href="users_8h-source.html#l00149">timeout</a>, and <a class="el" href="channels_8h-source.html#l00208">ucrec::uc_modes</a>.
<p>
<div class="fragment"><pre>00027 {
00028         <span class="comment">// the PROPER way to do it, AVOID bzero at *ALL* costs</span>
00029         strcpy(nick,<span class="stringliteral">""</span>);
00030         strcpy(ip,<span class="stringliteral">"127.0.0.1"</span>);
00031         <a class="code" href="classuserrec.html#o10">timeout</a> = 0;
00032         strcpy(ident,<span class="stringliteral">""</span>);
00033         strcpy(host,<span class="stringliteral">""</span>);
00034         strcpy(dhost,<span class="stringliteral">""</span>);
00035         strcpy(fullname,<span class="stringliteral">""</span>);
00036         strcpy(modes,<span class="stringliteral">""</span>);
00037         strcpy(inbuf,<span class="stringliteral">""</span>);
00038         strcpy(server,<span class="stringliteral">""</span>);
00039         strcpy(awaymsg,<span class="stringliteral">""</span>);
00040         strcpy(oper,<span class="stringliteral">""</span>);
00041         <a class="code" href="classconnection.html#o0">fd</a> = <a class="code" href="classconnection.html#o12">lastping</a> = <a class="code" href="classconnection.html#o13">signon</a> = <a class="code" href="classconnection.html#o14">idle_lastmsg</a> = <a class="code" href="classconnection.html#o15">nping</a> = <a class="code" href="classconnection.html#o10">registered</a> = 0;
00042         <a class="code" href="classuserrec.html#o9">flood</a> = <a class="code" href="classconnection.html#o9">port</a> = <a class="code" href="classconnection.html#o4">bytes_in</a> = <a class="code" href="classconnection.html#o5">bytes_out</a> = <a class="code" href="classconnection.html#o6">cmds_in</a> = <a class="code" href="classconnection.html#o7">cmds_out</a> = 0;
00043         <a class="code" href="classconnection.html#o8">haspassed</a> = <span class="keyword">false</span>;
00044         strcpy(result,<span class="stringliteral">""</span>);
00045         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; MAXCHANS; i++)
00046         {
00047                 this-&gt;<a class="code" href="classuserrec.html#o5">chans</a>[i].<a class="code" href="classucrec.html#o1">channel</a> = NULL;
00048                 this-&gt;<a class="code" href="classuserrec.html#o5">chans</a>[i].<a class="code" href="classucrec.html#o0">uc_modes</a> = 0;
00049         }
00050         <a class="code" href="classuserrec.html#r0">invites</a>.clear();
00051 }
</pre></div>    </td>
  </tr>
</table>
<a name="a1" doxytag="userrec::~userrec"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual userrec::~<a class="el" href="classuserrec.html">userrec</a> </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="users_8h-source.html#l00160">160</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
<div class="fragment"><pre>00160 {  }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a2" doxytag="userrec::GetFullHost"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char * userrec::GetFullHost </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns the full displayed host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form. 
<p>

<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00055">55</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="users_8h-source.html#l00111">dhost</a>, <a class="el" href="users_8h-source.html#l00106">ident</a>, <a class="el" href="users_8h-source.html#l00102">nick</a>, and <a class="el" href="users_8h-source.html#l00137">result</a>.
<p>
<div class="fragment"><pre>00056 {
00057         snprintf(result,MAXBUF,<span class="stringliteral">"%s!%s@%s"</span>,nick,ident,dhost);
00058         <span class="keywordflow">return</span> <a class="code" href="classuserrec.html#o8">result</a>;
00059 }
</pre></div>    </td>
  </tr>
</table>
<a name="a3" doxytag="userrec::GetFullRealHost"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char * userrec::GetFullRealHost </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns the full real host of the user This member function returns the hostname of the user as seen by other users on the server, in nick!identhost form. 
<p>
If any form of hostname cloaking is in operation, e.g. through a module, then this method will ignore it and return the true hostname.
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00062">62</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="connection_8h-source.html#l00182">connection::host</a>, <a class="el" href="users_8h-source.html#l00106">ident</a>, <a class="el" href="users_8h-source.html#l00102">nick</a>, and <a class="el" href="users_8h-source.html#l00137">result</a>.
<p>
<div class="fragment"><pre>00063 {
00064         snprintf(result,MAXBUF,<span class="stringliteral">"%s!%s@%s"</span>,nick,ident,host);
00065         <span class="keywordflow">return</span> <a class="code" href="classuserrec.html#o8">result</a>;
00066 }
</pre></div>    </td>
  </tr>
</table>
<a name="a7" doxytag="userrec::HasPermission"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool userrec::HasPermission </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>command</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns true or false for if a user can execute a privilaged oper command. 
<p>
This is done by looking up their oper type from <a class="el" href="classuserrec.html#o11">userrec::oper</a>, then referencing this to their oper classes and checking the commands they can execute.
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00111">111</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="channels_8cpp-source.html#l00101">config_f</a>, and <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>.
<p>
<div class="fragment"><pre>00112 {
00113         <span class="keywordtype">char</span> TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF];
00114         <span class="keywordtype">char</span>* myclass;
00115         <span class="keywordtype">char</span>* mycmd;
00116         <span class="keywordtype">char</span>* savept;
00117         <span class="keywordtype">char</span>* savept2;
00118         
00119         <span class="comment">// are they even an oper at all?</span>
00120         <span class="keywordflow">if</span> (strchr(this-&gt;modes,<span class="charliteral">'o'</span>))
00121         {
00122                 log(DEBUG,<span class="stringliteral">"*** HasPermission: %s is an oper"</span>,this-&gt;nick);
00123                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j =0; j &lt; ConfValueEnum(<span class="stringliteral">"type"</span>,&amp;config_f); j++)
00124                 {
00125                         ConfValue(<span class="stringliteral">"type"</span>,<span class="stringliteral">"name"</span>,j,TypeName,&amp;config_f);
00126                         <span class="keywordflow">if</span> (!strcmp(TypeName,this-&gt;oper))
00127                         {
00128                                 log(DEBUG,<span class="stringliteral">"*** HasPermission: %s is an oper of type '%s'"</span>,this-&gt;nick,this-&gt;oper);
00129                                 ConfValue(<span class="stringliteral">"type"</span>,<span class="stringliteral">"classes"</span>,j,Classes,&amp;config_f);
00130                                 <span class="keywordtype">char</span>* myclass = strtok_r(Classes,<span class="stringliteral">" "</span>,&amp;savept);
00131                                 <span class="keywordflow">while</span> (myclass)
00132                                 {
00133                                         log(DEBUG,<span class="stringliteral">"*** HasPermission: checking classtype '%s'"</span>,myclass);
00134                                         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k =0; k &lt; ConfValueEnum(<span class="stringliteral">"class"</span>,&amp;config_f); k++)
00135                                         {
00136                                                 ConfValue(<span class="stringliteral">"class"</span>,<span class="stringliteral">"name"</span>,k,ClassName,&amp;config_f);
00137                                                 <span class="keywordflow">if</span> (!strcmp(ClassName,myclass))
00138                                                 {
00139                                                         ConfValue(<span class="stringliteral">"class"</span>,<span class="stringliteral">"commands"</span>,k,CommandList,&amp;config_f);
00140                                                         log(DEBUG,<span class="stringliteral">"*** HasPermission: found class named %s with commands: '%s'"</span>,ClassName,CommandList);
00141                                                         
00142                                                         
00143                                                         mycmd = strtok_r(CommandList,<span class="stringliteral">" "</span>,&amp;savept2);
00144                                                         <span class="keywordflow">while</span> (mycmd)
00145                                                         {
00146                                                                 <span class="keywordflow">if</span> (!strcasecmp(mycmd,command))
00147                                                                 {
00148                                                                         log(DEBUG,<span class="stringliteral">"*** Command %s found, returning true"</span>,command);
00149                                                                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00150                                                                 }
00151                                                                 mycmd = strtok_r(NULL,<span class="stringliteral">" "</span>,&amp;savept2);
00152                                                         }
00153                                                 }
00154                                         }
00155                                         myclass = strtok_r(NULL,<span class="stringliteral">" "</span>,&amp;savept);
00156                                 }
00157                         }
00158                 }
00159         }
00160         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00161 }
</pre></div>    </td>
  </tr>
</table>
<a name="a5" doxytag="userrec::InviteTo"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void userrec::InviteTo </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>channel</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Adds a channel to a users invite list (invites them to a channel). 
<p>

<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00082">82</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="users_8h-source.html#l00039">Invited::channel</a>, and <a class="el" href="users_8h-source.html#l00095">invites</a>.
<p>
<div class="fragment"><pre>00083 {
00084         <a class="code" href="classInvited.html">Invited</a> i;
00085         strlcpy(i.<a class="code" href="classInvited.html#o0">channel</a>,channel,CHANMAX);
00086         <a class="code" href="classuserrec.html#r0">invites</a>.push_back(i);
00087 }
</pre></div>    </td>
  </tr>
</table>
<a name="a4" doxytag="userrec::IsInvited"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool userrec::IsInvited </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>channel</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns true if a user is invited to a channel. 
<p>

<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00068">68</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="users_8h-source.html#l00095">invites</a>.
<p>
<div class="fragment"><pre>00069 {
00070         <span class="keywordflow">for</span> (InvitedList::iterator i = <a class="code" href="classuserrec.html#r0">invites</a>.begin(); i != <a class="code" href="classuserrec.html#r0">invites</a>.end(); i++)
00071         {
00072                 <span class="keywordflow">if</span> (i-&gt;channel) {
00073                         <span class="keywordflow">if</span> (!strcasecmp(i-&gt;channel,channel))
00074                         {
00075                                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00076                         }
00077                 }
00078         }
00079         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00080 }
</pre></div>    </td>
  </tr>
</table>
<a name="a6" doxytag="userrec::RemoveInvite"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void userrec::RemoveInvite </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>channel</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Removes a channel from a users invite list. 
<p>
This member function is called on successfully joining an invite only channel to which the user has previously been invited, to clear the invitation.
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00089">89</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, and <a class="el" href="users_8h-source.html#l00095">invites</a>.
<p>
<div class="fragment"><pre>00090 {
00091         log(DEBUG,<span class="stringliteral">"Removing invites"</span>);
00092         <span class="keywordflow">if</span> (channel)
00093         {
00094                 <span class="keywordflow">if</span> (<a class="code" href="classuserrec.html#r0">invites</a>.size())
00095                 {
00096                         <span class="keywordflow">for</span> (InvitedList::iterator i = <a class="code" href="classuserrec.html#r0">invites</a>.begin(); i != <a class="code" href="classuserrec.html#r0">invites</a>.end(); i++)
00097                         {
00098                                 <span class="keywordflow">if</span> (i-&gt;channel)
00099                                 {
00100                                         <span class="keywordflow">if</span> (!strcasecmp(i-&gt;channel,channel))
00101                                         {
00102                                                 <a class="code" href="classuserrec.html#r0">invites</a>.erase(i);
00103                                                 <span class="keywordflow">return</span>;
00104                                         }
00105                                 }
00106                         }
00107                 }
00108         }
00109 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a name="o7" doxytag="userrec::awaymsg"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o7">userrec::awaymsg</a>[512]
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The user's away message. 
<p>
If this string is empty, the user is not marked as away.
<p>
Definition at line <a class="el" href="users_8h-source.html#l00132">132</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o5" doxytag="userrec::chans"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="classucrec.html">ucrec</a> <a class="el" href="classuserrec.html#o5">userrec::chans</a>[MAXCHANS]
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="users_8h-source.html#l00123">123</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o2" doxytag="userrec::dhost"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o2">userrec::dhost</a>[256]
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The host displayed to non-opers (used for cloaking etc). 
<p>
This usually matches the value of <a class="el" href="classconnection.html#o1">userrec::host</a>.
<p>
Definition at line <a class="el" href="users_8h-source.html#l00111">111</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00055">GetFullHost()</a>, and <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o9" doxytag="userrec::flood"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int <a class="el" href="classuserrec.html#o9">userrec::flood</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Number of lines the user can place into the buffer (up to the global NetBufferSize bytes) before they are disconnected for excess flood. 
<p>

<p>
Definition at line <a class="el" href="users_8h-source.html#l00143">143</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o3" doxytag="userrec::fullname"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o3">userrec::fullname</a>[128]
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The users full name. 
<p>

<p>
Definition at line <a class="el" href="users_8h-source.html#l00115">115</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o1" doxytag="userrec::ident"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o1">userrec::ident</a>[64]
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The users ident reply. 
<p>

<p>
Definition at line <a class="el" href="users_8h-source.html#l00106">106</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00055">GetFullHost()</a>, <a class="el" href="users_8cpp-source.html#l00062">GetFullRealHost()</a>, and <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="r0" doxytag="userrec::invites"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="users_8h.html#a6">InvitedList</a> <a class="el" href="classuserrec.html#r0">userrec::invites</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A list of channels the user has a pending invite to. 
<p>

<p>
Definition at line <a class="el" href="users_8h-source.html#l00095">95</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00082">InviteTo()</a>, <a class="el" href="users_8cpp-source.html#l00068">IsInvited()</a>, <a class="el" href="users_8cpp-source.html#l00089">RemoveInvite()</a>, and <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o4" doxytag="userrec::modes"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o4">userrec::modes</a>[MAXBUF]
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The user's mode string. 
<p>
This may contain any of the following RFC characters: o, w, s, i Your module may define other mode characters as it sees fit.
<p>
Definition at line <a class="el" href="users_8h-source.html#l00121">121</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o0" doxytag="userrec::nick"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o0">userrec::nick</a>[NICKMAX]
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The users nickname. 
<p>
An invalid nickname indicates an unregistered connection prior to the NICK command.
<p>
Definition at line <a class="el" href="users_8h-source.html#l00102">102</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="modules_8cpp-source.html#l00673">ConfigReader::DumpErrors()</a>, <a class="el" href="users_8cpp-source.html#l00055">GetFullHost()</a>, <a class="el" href="users_8cpp-source.html#l00062">GetFullRealHost()</a>, <a class="el" href="modules_8cpp-source.html#l00396">Server::QuitUser()</a>, and <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o11" doxytag="userrec::oper"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o11">userrec::oper</a>[NICKMAX]
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The oper type they logged in as, if they are an oper. 
<p>
This is used to check permissions in operclasses, so that we can say 'yay' or 'nay' to any commands they issue. The value of this is the value of a valid 'type name=' tag.
<p>
Definition at line <a class="el" href="users_8h-source.html#l00156">156</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o8" doxytag="userrec::result"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o8">userrec::result</a>[256]
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Stores the result of the last GetFullHost or GetRealHost call. 
<p>
You may use this to increase the speed of use of this class.
<p>
Definition at line <a class="el" href="users_8h-source.html#l00137">137</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00055">GetFullHost()</a>, <a class="el" href="users_8cpp-source.html#l00062">GetFullRealHost()</a>, and <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o6" doxytag="userrec::server"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char <a class="el" href="classuserrec.html#o6">userrec::server</a>[256]
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The server the user is connected to. 
<p>

<p>
Definition at line <a class="el" href="users_8h-source.html#l00127">127</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<a name="o10" doxytag="userrec::timeout"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> unsigned long <a class="el" href="classuserrec.html#o10">userrec::timeout</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Number of seconds this user is given to send USER/NICK If they do not send their details in this time limit they will be disconnected. 
<p>

<p>
Definition at line <a class="el" href="users_8h-source.html#l00149">149</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00026">userrec()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="users_8h-source.html">users.h</a><li><a class="el" href="users_8cpp-source.html">users.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Mon Mar 28 21:09:38 2005 for InspIRCd by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.3 </small></address>
</body>
</html>