From 52899de0ff2d62ca0542b243c41626010bf62083 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 25 Mar 2005 03:51:56 +0000 Subject: Documentation update git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@899 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/classuserrec.html | 673 ++++++++++++++++++++------------------ 1 file changed, 349 insertions(+), 324 deletions(-) (limited to 'docs/module-doc/classuserrec.html') diff --git a/docs/module-doc/classuserrec.html b/docs/module-doc/classuserrec.html index 661dd1b7e..7f5755497 100644 --- a/docs/module-doc/classuserrec.html +++ b/docs/module-doc/classuserrec.html @@ -1,90 +1,101 @@ -userrec class Reference +InspIRCd: userrec class Reference - -
-Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  
-

userrec Class Reference

Holds all information about a user This class stores all information about a user connected to the irc server. + +
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members
+

userrec Class Reference

Holds all information about a user This class stores all information about a user connected to the irc server. More...

#include <users.h>

-Inheritance diagram for userrec:

Inheritance graph
- - - - - -
[legend]
Collaboration diagram for userrec:

Collaboration graph
- - - - -
[legend]
List of all members. +Inherits connection. +

+List of all members.

- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + +

Public Member Functions

 userrec ()
virtual ~userrec ()
virtual char * GetFullHost ()
 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.

virtual char * GetFullRealHost ()
 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.

virtual bool IsInvited (char *channel)
 Returns true if a user is invited to a channel.

virtual void InviteTo (char *channel)
 Adds a channel to a users invite list (invites them to a channel).

virtual void RemoveInvite (char *channel)
 Removes a channel from a users invite list.

bool HasPermission (char *command)
 Returns true or false for if a user can execute a privilaged oper command.

 userrec ()
virtual ~userrec ()
virtual char * GetFullHost ()
 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.

virtual char * GetFullRealHost ()
 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.

virtual bool IsInvited (char *channel)
 Returns true if a user is invited to a channel.

virtual void InviteTo (char *channel)
 Adds a channel to a users invite list (invites them to a channel).

virtual void RemoveInvite (char *channel)
 Removes a channel from a users invite list.

bool HasPermission (char *command)
 Returns true or false for if a user can execute a privilaged oper command.


Public Attributes

char nick [NICKMAX]
 The users nickname.

char ident [64]
 The users ident reply.

char dhost [256]
 The host displayed to non-opers (used for cloaking etc).

char fullname [128]
 The users full name.

char modes [MAXBUF]
 The user's mode string.

ucrec chans [MAXCHANS]
char server [256]
 The server the user is connected to.

char awaymsg [512]
 The user's away message.

char result [256]
 Stores the result of the last GetFullHost or GetRealHost call.

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

unsigned long timeout
 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.

char oper [NICKMAX]
 The oper type they logged in as, if they are an oper.

char nick [NICKMAX]
 The users nickname.

char ident [64]
 The users ident reply.

char dhost [256]
 The host displayed to non-opers (used for cloaking etc).

char fullname [128]
 The users full name.

char modes [MAXBUF]
 The user's mode string.

ucrec chans [MAXCHANS]
char server [256]
 The server the user is connected to.

char awaymsg [512]
 The user's away message.

char result [256]
 Stores the result of the last GetFullHost or GetRealHost call.

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

unsigned long timeout
 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.

char oper [NICKMAX]
 The oper type they logged in as, if they are an oper.


Private Attributes

InvitedList invites
 A list of channels the user has a pending invite to.

InvitedList invites
 A list of channels the user has a pending invite to.


Detailed Description

-Holds all information about a user This class stores all information about a user connected to the irc server. +Holds all information about a user This class stores all information about a user connected to the irc server.

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.

-Definition at line 78 of file users.h.


Constructor & Destructor Documentation

+Definition at line 89 of file users.h.

Constructor & Destructor Documentation

- +
-
+ - - + + @@ -102,47 +113,47 @@ Definition at line 78 of fi

-Definition at line 13 of file users.cpp. +Definition at line 25 of file users.cpp.

-References connection::bytes_in, connection::bytes_out, ucrec::channel, chans, connection::cmds_in, connection::cmds_out, connection::fd, flood, connection::haspassed, connection::idle_lastmsg, invites, connection::lastping, connection::nping, connection::port, connection::registered, connection::signon, timeout, and ucrec::uc_modes. +References awaymsg, connection::bytes_in, connection::bytes_out, ucrec::channel, chans, connection::cmds_in, connection::cmds_out, dhost, connection::fd, flood, fullname, connection::haspassed, connection::host, ident, connection::idle_lastmsg, connection::inbuf, invites, connection::ip, connection::lastping, modes, nick, connection::nping, connection::port, connection::registered, result, server, connection::signon, timeout, and ucrec::uc_modes.

-

00014 {
-00015         // the PROPER way to do it, AVOID bzero at *ALL* costs
-00016         strcpy(nick,"");
-00017         strcpy(ip,"127.0.0.1");
-00018         timeout = 0;
-00019         strcpy(ident,"");
-00020         strcpy(host,"");
-00021         strcpy(dhost,"");
-00022         strcpy(fullname,"");
-00023         strcpy(modes,"");
-00024         strcpy(inbuf,"");
-00025         strcpy(server,"");
-00026         strcpy(awaymsg,"");
-00027         fd = lastping = signon = idle_lastmsg = nping = registered = 0;
-00028         flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
-00029         haspassed = false;
-00030         strcpy(result,"");
-00031         for (int i = 0; i < MAXCHANS; i++)
-00032         {
-00033                 this->chans[i].channel = NULL;
-00034                 this->chans[i].uc_modes = 0;
-00035         }
-00036         invites.clear();
-00037 }
+
00026 {
+00027         // the PROPER way to do it, AVOID bzero at *ALL* costs
+00028         strcpy(nick,"");
+00029         strcpy(ip,"127.0.0.1");
+00030         timeout = 0;
+00031         strcpy(ident,"");
+00032         strcpy(host,"");
+00033         strcpy(dhost,"");
+00034         strcpy(fullname,"");
+00035         strcpy(modes,"");
+00036         strcpy(inbuf,"");
+00037         strcpy(server,"");
+00038         strcpy(awaymsg,"");
+00039         fd = lastping = signon = idle_lastmsg = nping = registered = 0;
+00040         flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
+00041         haspassed = false;
+00042         strcpy(result,"");
+00043         for (int i = 0; i < MAXCHANS; i++)
+00044         {
+00045                 this->chans[i].channel = NULL;
+00046                 this->chans[i].uc_modes = 0;
+00047         }
+00048         invites.clear();
+00049 }
 
userrec::userrec    ) 

- +
-
+ - + - - + + @@ -160,23 +171,23 @@ References connection::byt

-Definition at line 149 of file users.h. +Definition at line 160 of file users.h.

-

00149 {  }
+
00160 {  }
 
virtual userrec::~userrec virtual userrec::~userrec    )  [inline, virtual]

Member Function Documentation

- +
-
+ - - + + @@ -192,31 +203,31 @@ Definition at line 149 of f
char * userrec::GetFullHost    )  [virtual]

-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. +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.

-Definition at line 41 of file users.cpp. +Definition at line 53 of file users.cpp.

-References result. +References dhost, ident, nick, and result.

-

00042 {
-00043         sprintf(result,"%s!%s@%s",nick,ident,dhost);
-00044         return result;
-00045 }
+
00054 {
+00055         snprintf(result,MAXBUF,"%s!%s@%s",nick,ident,dhost);
+00056         return result;
+00057 }
 

- +
-
+ - - + + @@ -232,32 +243,32 @@ References result.
char * userrec::GetFullRealHost    )  [virtual]

-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. +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.

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.

-Definition at line 48 of file users.cpp. +Definition at line 60 of file users.cpp.

-References result. +References connection::host, ident, nick, and result.

-

00049 {
-00050         sprintf(result,"%s!%s@%s",nick,ident,host);
-00051         return result;
-00052 }
+
00061 {
+00062         snprintf(result,MAXBUF,"%s!%s@%s",nick,ident,host);
+00063         return result;
+00064 }
 

- +
-
+ - - + + @@ -273,76 +284,78 @@ References result.
bool userrec::HasPermission char *   command command  ) 

-Returns true or false for if a user can execute a privilaged oper command. -

-This is done by looking up their oper type from userrec::oper, then referencing this to their oper classes and checking the commands they can execute. -

-Definition at line 97 of file users.cpp. -

-

00098 {
-00099         char TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF];
-00100         char* myclass;
-00101         char* mycmd;
-00102         char* savept;
-00103         char* savept2;
-00104         
-00105         // are they even an oper at all?
-00106         if (strchr(this->modes,'o'))
-00107         {
-00108                 log(DEBUG,"*** HasPermission: %s is an oper",this->nick);
-00109                 for (int j =0; j < ConfValueEnum("type",&config_f); j++)
-00110                 {
-00111                         ConfValue("type","name",j,TypeName,&config_f);
-00112                         if (!strcmp(TypeName,this->oper))
-00113                         {
-00114                                 log(DEBUG,"*** HasPermission: %s is an oper of type '%s'",this->nick,this->oper);
-00115                                 ConfValue("type","classes",j,Classes,&config_f);
-00116                                 char* myclass = strtok_r(Classes," ",&savept);
-00117                                 while (myclass)
-00118                                 {
-00119                                         log(DEBUG,"*** HasPermission: checking classtype '%s'",myclass);
-00120                                         for (int k =0; k < ConfValueEnum("class",&config_f); k++)
-00121                                         {
-00122                                                 ConfValue("class","name",k,ClassName,&config_f);
-00123                                                 if (!strcmp(ClassName,myclass))
-00124                                                 {
-00125                                                         ConfValue("class","commands",k,CommandList,&config_f);
-00126                                                         log(DEBUG,"*** HasPermission: found class named %s with commands: '%s'",ClassName,CommandList);
-00127                                                         
-00128                                                         
-00129                                                         mycmd = strtok_r(CommandList," ",&savept2);
-00130                                                         while (mycmd)
-00131                                                         {
-00132                                                                 if (!strcasecmp(mycmd,command))
-00133                                                                 {
-00134                                                                         log(DEBUG,"*** Command %s found, returning true",command);
-00135                                                                         return true;
-00136                                                                 }
-00137                                                                 mycmd = strtok_r(NULL," ",&savept2);
-00138                                                         }
-00139                                                 }
-00140                                         }
-00141                                         myclass = strtok_r(NULL," ",&savept);
-00142                                 }
-00143                         }
-00144                 }
-00145         }
-00146         return false;
-00147 }
+Returns true or false for if a user can execute a privilaged oper command. 
+

+This is done by looking up their oper type from userrec::oper, then referencing this to their oper classes and checking the commands they can execute. +

+Definition at line 109 of file users.cpp. +

+References config_f, and DEBUG. +

+

00110 {
+00111         char TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF];
+00112         char* myclass;
+00113         char* mycmd;
+00114         char* savept;
+00115         char* savept2;
+00116         
+00117         // are they even an oper at all?
+00118         if (strchr(this->modes,'o'))
+00119         {
+00120                 log(DEBUG,"*** HasPermission: %s is an oper",this->nick);
+00121                 for (int j =0; j < ConfValueEnum("type",&config_f); j++)
+00122                 {
+00123                         ConfValue("type","name",j,TypeName,&config_f);
+00124                         if (!strcmp(TypeName,this->oper))
+00125                         {
+00126                                 log(DEBUG,"*** HasPermission: %s is an oper of type '%s'",this->nick,this->oper);
+00127                                 ConfValue("type","classes",j,Classes,&config_f);
+00128                                 char* myclass = strtok_r(Classes," ",&savept);
+00129                                 while (myclass)
+00130                                 {
+00131                                         log(DEBUG,"*** HasPermission: checking classtype '%s'",myclass);
+00132                                         for (int k =0; k < ConfValueEnum("class",&config_f); k++)
+00133                                         {
+00134                                                 ConfValue("class","name",k,ClassName,&config_f);
+00135                                                 if (!strcmp(ClassName,myclass))
+00136                                                 {
+00137                                                         ConfValue("class","commands",k,CommandList,&config_f);
+00138                                                         log(DEBUG,"*** HasPermission: found class named %s with commands: '%s'",ClassName,CommandList);
+00139                                                         
+00140                                                         
+00141                                                         mycmd = strtok_r(CommandList," ",&savept2);
+00142                                                         while (mycmd)
+00143                                                         {
+00144                                                                 if (!strcasecmp(mycmd,command))
+00145                                                                 {
+00146                                                                         log(DEBUG,"*** Command %s found, returning true",command);
+00147                                                                         return true;
+00148                                                                 }
+00149                                                                 mycmd = strtok_r(NULL," ",&savept2);
+00150                                                         }
+00151                                                 }
+00152                                         }
+00153                                         myclass = strtok_r(NULL," ",&savept);
+00154                                 }
+00155                         }
+00156                 }
+00157         }
+00158         return false;
+00159 }
 

- +
-
+ - - + + @@ -358,33 +371,33 @@ Definition at line 97 of
void userrec::InviteTo char *   channel channel  )  [virtual]

-Adds a channel to a users invite list (invites them to a channel). +Adds a channel to a users invite list (invites them to a channel).

-Definition at line 68 of file users.cpp. +Definition at line 80 of file users.cpp.

-References Invited::channel, and invites. +References Invited::channel, and invites.

-

00069 {
-00070         Invited i;
-00071         strcpy(i.channel,channel);
-00072         invites.push_back(i);
-00073 }
+
00081 {
+00082         Invited i;
+00083         strlcpy(i.channel,channel,CHANMAX);
+00084         invites.push_back(i);
+00085 }
 

- +
-
+ - - + + @@ -400,40 +413,40 @@ References Invited::channel
bool userrec::IsInvited char *   channel channel  )  [virtual]

-Returns true if a user is invited to a channel. +Returns true if a user is invited to a channel.

-Definition at line 54 of file users.cpp. +Definition at line 66 of file users.cpp.

-References invites. +References invites.

-

00055 {
-00056         for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
-00057         {
-00058                 if (i->channel) {
-00059                         if (!strcasecmp(i->channel,channel))
-00060                         {
-00061                                 return true;
-00062                         }
-00063                 }
-00064         }
-00065         return false;
-00066 }
+
00067 {
+00068         for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
+00069         {
+00070                 if (i->channel) {
+00071                         if (!strcasecmp(i->channel,channel))
+00072                         {
+00073                                 return true;
+00074                         }
+00075                 }
+00076         }
+00077         return false;
+00078 }
 

- +
-
+ - - + + @@ -449,45 +462,45 @@ References invites.
void userrec::RemoveInvite char *   channel channel  )  [virtual]

-Removes a channel from a users invite list. +Removes a channel from a users invite list.

This member function is called on successfully joining an invite only channel to which the user has previously been invited, to clear the invitation.

-Definition at line 75 of file users.cpp. -

-References invites. -

-

00076 {
-00077         log(DEBUG,"Removing invites");
-00078         if (channel)
-00079         {
-00080                 if (invites.size())
-00081                 {
-00082                         for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
-00083                         {
-00084                                 if (i->channel)
-00085                                 {
-00086                                         if (!strcasecmp(i->channel,channel))
-00087                                         {
-00088                                                 invites.erase(i);
-00089                                                 return;
-00090                                         }
-00091                                 }
-00092                         }
-00093                 }
-00094         }
-00095 }
+Definition at line 87 of file users.cpp.
+

+References DEBUG, and invites. +

+

00088 {
+00089         log(DEBUG,"Removing invites");
+00090         if (channel)
+00091         {
+00092                 if (invites.size())
+00093                 {
+00094                         for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
+00095                         {
+00096                                 if (i->channel)
+00097                                 {
+00098                                         if (!strcasecmp(i->channel,channel))
+00099                                         {
+00100                                                 invites.erase(i);
+00101                                                 return;
+00102                                         }
+00103                                 }
+00104                         }
+00105                 }
+00106         }
+00107 }
 

Member Data Documentation

-

- +

+

- @@ -500,20 +513,22 @@ References invites. +Definition at line 132 of file users.h. +

+Referenced by userrec().

+ -
char userrec::awaymsg[512] + char userrec::awaymsg[512]

-The user's away message. +The user's away message.

If this string is empty, the user is not marked as away.

-Definition at line 121 of file users.h.

-

- +

+

- @@ -528,18 +543,18 @@ Definition at line 121 of f

-Definition at line 112 of file users.h. +Definition at line 123 of file users.h.

-Referenced by userrec(). +Referenced by userrec().

+ -
ucrec userrec::chans[MAXCHANS] + ucrec userrec::chans[MAXCHANS]
-

- +

+

- @@ -552,20 +567,22 @@ Referenced by userrec(). +Referenced by GetFullHost(), and userrec().
+ -
char userrec::dhost[256] + char userrec::dhost[256]

-The host displayed to non-opers (used for cloaking etc). +The host displayed to non-opers (used for cloaking etc). +

+This usually matches the value of userrec::host.

-This usually matches the value of userrec::host. +Definition at line 111 of file users.h.

-Definition at line 100 of file users.h.

-

- +

+

- @@ -578,22 +595,22 @@ Definition at line 100 of f +Referenced by userrec().
+ -
int userrec::flood + int userrec::flood

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

-Definition at line 132 of file users.h. +Definition at line 143 of file users.h.

-Referenced by userrec().

-

- +

+

- @@ -606,20 +623,22 @@ Referenced by userrec(). +Definition at line 115 of file users.h. +

+Referenced by userrec().

+ -
char userrec::fullname[128] + char userrec::fullname[128]

-The users full name. +The users full name.

-Definition at line 104 of file users.h.

-

- +

+

- @@ -632,20 +651,22 @@ Definition at line 104 of f +Definition at line 106 of file users.h. +

+Referenced by GetFullHost(), GetFullRealHost(), and userrec().

+ -
char userrec::ident[64] + char userrec::ident[64]

-The users ident reply. +The users ident reply.

-Definition at line 95 of file users.h.

-

- +

+

- @@ -658,22 +679,22 @@ Definition at line 95 of fi +Referenced by InviteTo(), IsInvited(), RemoveInvite(), and userrec().
+ -
InvitedList userrec::invites [private] + InvitedList userrec::invites [private]

-A list of channels the user has a pending invite to. +A list of channels the user has a pending invite to.

-Definition at line 84 of file users.h. +Definition at line 95 of file users.h.

-Referenced by InviteTo(), IsInvited(), RemoveInvite(), and userrec().

-

- +

+

- @@ -686,20 +707,22 @@ Referenced by InviteTo(), +Definition at line 121 of file users.h. +

+Referenced by userrec().

+ -
char userrec::modes[MAXBUF] + char userrec::modes[MAXBUF]

-The user's mode string. +The user's mode string.

This may contain any of the following RFC characters: o, w, s, i Your module may define other mode characters as it sees fit.

-Definition at line 110 of file users.h.

-

- +

+

- @@ -712,22 +735,22 @@ Definition at line 110 of f +Referenced by ConfigReader::DumpErrors(), GetFullHost(), GetFullRealHost(), Server::QuitUser(), and userrec().
+ -
char userrec::nick[NICKMAX] + char userrec::nick[NICKMAX]

-The users nickname. +The users nickname.

An invalid nickname indicates an unregistered connection prior to the NICK command.

-Definition at line 91 of file users.h. +Definition at line 102 of file users.h.

-Referenced by Server::QuitUser().

-

- +

+

- @@ -740,20 +763,20 @@ Referenced by Server::QuitU +Definition at line 156 of file users.h.
+ -
char userrec::oper[NICKMAX] + char userrec::oper[NICKMAX]

-The oper type they logged in as, if they are an oper. +The oper type they logged in as, if they are an oper.

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.

-Definition at line 145 of file users.h.

-

- +

+

- @@ -766,22 +789,22 @@ Definition at line 145 of f +Referenced by GetFullHost(), GetFullRealHost(), and userrec().
+ -
char userrec::result[256] + char userrec::result[256]

-Stores the result of the last GetFullHost or GetRealHost call. +Stores the result of the last GetFullHost or GetRealHost call.

You may use this to increase the speed of use of this class.

-Definition at line 126 of file users.h. +Definition at line 137 of file users.h.

-Referenced by GetFullHost(), and GetFullRealHost().

-

- +

+

- @@ -794,20 +817,22 @@ Referenced by GetFullHost()

-The server the user is connected to. +The server the user is connected to.

-Definition at line 116 of file users.h. +Definition at line 127 of file users.h. +

+Referenced by userrec().

+ -
char userrec::server[256] + char userrec::server[256]
-

- +

+

- @@ -820,20 +845,20 @@ Definition at line 116 of f +Referenced by userrec().
+ -
unsigned long userrec::timeout + unsigned long userrec::timeout

-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. +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.

-Definition at line 138 of file users.h. +Definition at line 149 of file users.h.

-Referenced by userrec().


The documentation for this class was generated from the following files: -
Generated on Sun May 2 00:09:45 2004 for InspIRCd by +
Generated on Fri Mar 25 03:49:34 2005 for InspIRCd by -doxygen1.3-rc3
+doxygen +1.3.3
-- cgit v1.3.1-10-gc9f91