From cd9f9a8add02597a2998ba74b803ed3fbf81314c Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 27 Nov 2005 01:44:46 +0000 Subject: Added new documentation git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1966 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/classuserrec.html | 1244 +++++++++++++++++++------------------ 1 file changed, 623 insertions(+), 621 deletions(-) (limited to 'docs/module-doc/classuserrec.html') diff --git a/docs/module-doc/classuserrec.html b/docs/module-doc/classuserrec.html index c96dc5009..9c47c4518 100644 --- a/docs/module-doc/classuserrec.html +++ b/docs/module-doc/classuserrec.html @@ -1,178 +1,177 @@ - + -InspIRCd: userrec class Reference +InspIRCd: userrec Class Reference - -
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | 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 | Class List | Directories | File List | Namespace Members | Class 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. +
[legend]
List of all members.
- - + + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - - + + - - - + + + - +

Public Member Functions

 userrec ()

Public Member Functions

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

int ReadData (void *buffer, size_t size)
 Returns true or false for if a user can execute a privilaged oper command.
int ReadData (void *buffer, size_t size)
 Calls read() to read some data for this user using their fd.

bool AddBuffer (std::string a)
 Calls read() to read some data for this user using their fd.
bool AddBuffer (std::string a)
 This method adds data to the buffer of the user.

bool BufferIsReady ()
 This method adds data to the buffer of the user.
bool BufferIsReady ()
 This method returns true if the buffer contains at least one carriage return character (e.g.

void ClearBuffer ()
 This method returns true if the buffer contains at least one carriage return character (e.g.
void ClearBuffer ()
 This function clears the entire buffer by setting it to an empty string.

std::string GetBuffer ()
 This function clears the entire buffer by setting it to an empty string.
std::string GetBuffer ()
 This method returns the first available string at the tail end of the buffer and advances the tail end of the buffer past the string.

void SetWriteError (std::string error)
 This method returns the first available string at the tail end of the buffer and advances the tail end of the buffer past the string.
void SetWriteError (std::string error)
 Sets the write error for a connection.

std::string GetWriteError ()
 Sets the write error for a connection.
std::string GetWriteError ()
 Returns the write error which last occured on this connection or an empty string if none occured.

void AddWriteBuf (std::string data)
 Returns the write error which last occured on this connection or an empty string if none occured.
void AddWriteBuf (std::string data)
 Adds to the user's write buffer.

void FlushWriteBuf ()
 Adds to the user's write buffer.
void FlushWriteBuf ()
 Flushes as much of the user's buffer to the file descriptor as possible.

InvitedListGetInviteList ()
 Flushes as much of the user's buffer to the file descriptor as possible.
InvitedListGetInviteList ()
 Returns the list of channels this user has been invited to but has not yet joined.

void CloseSocket ()
 Returns the list of channels this user has been invited to but has not yet joined.
void CloseSocket ()
 Shuts down and closes the user's socket.


Public Attributes

char nick [NICKMAX]
 Shuts down and closes the user's socket.

Public Attributes

char nick [NICKMAX]
 The users nickname.

char ident [IDENTMAX+2]
 The users nickname.
char ident [IDENTMAX+2]
 The users ident reply.

char dhost [160]
 The users ident reply.
char dhost [160]
 The host displayed to non-opers (used for cloaking etc).

char fullname [MAXGECOS+1]
 The host displayed to non-opers (used for cloaking etc).
char fullname [MAXGECOS+1]
 The users full name.

char modes [54]
 The users full name.
char modes [54]
 The user's mode string.

ucrec chans [MAXCHANS]
 The user's mode string.
ucrec chans [MAXCHANS]
char * server
char * server
 The server the user is connected to.

char awaymsg [MAXAWAY+1]
 The server the user is connected to.
char awaymsg [MAXAWAY+1]
 The user's away message.

int flood
 The user's away message.
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 int timeout
 Number of lines the user can place into the buffer (up to the global NetBufferSize bytes) before they are disconnected for excess flood.
unsigned int 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]
 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.

bool dns_done
 The oper type they logged in as, if they are an oper.
bool dns_done
 True when DNS lookups are completed.

unsigned int pingmax
 True when DNS lookups are completed.
unsigned int pingmax
 Number of seconds between PINGs for this user (set from <connect:allow> tag.

char password [MAXBUF]
 Number of seconds between PINGs for this user (set from <connect:allow> tag.
char password [MAXBUF]
 Password specified by the user when they registered.

std::string recvq
 Password specified by the user when they registered.
std::string recvq
 User's receive queue.

std::string sendq
 User's receive queue.
std::string sendq
 User's send queue.

int lines_in
 User's send queue.
int lines_in
 Flood counters.

time_t reset_due
 Flood counters.
time_t reset_due
long threshold
long threshold
std::string WriteError
std::string WriteError
long sendqmax
long sendqmax
 Maximum size this user's sendq can become.

long recvqmax
 Maximum size this user's sendq can become.
long recvqmax
 Maximum size this user's recvq can become.


Private Attributes

InvitedList invites
 Maximum size this user's recvq can become.

Private Attributes

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

 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.

-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. +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 108 of file users.h.


Constructor & Destructor Documentation

-

- +

+

- + -
userrec::userrec userrec::userrec  ) 
- +
+
  @@ -182,59 +181,58 @@ Definition at line 108 of f

-Definition at line 32 of file users.cpp. +Definition at line 33 of file users.cpp.

-References awaymsg, connection::bytes_in, connection::bytes_out, ucrec::channel, chans, connection::cmds_in, connection::cmds_out, dhost, dns_done, connection::fd, flood, fullname, connection::haspassed, connection::host, ident, connection::idle_lastmsg, invites, connection::ip, connection::lastping, lines_in, modes, nick, connection::nping, oper, connection::port, recvq, connection::registered, reset_due, sendq, server, ServerName, connection::signon, TIME, timeout, and ucrec::uc_modes. +References awaymsg, connection::bytes_in, connection::bytes_out, ucrec::channel, chans, connection::cmds_in, connection::cmds_out, dhost, dns_done, connection::fd, flood, fullname, connection::haspassed, connection::host, ident, connection::idle_lastmsg, invites, connection::ip, connection::lastping, lines_in, modes, nick, connection::nping, oper, connection::port, recvq, connection::registered, reset_due, sendq, server, ServerName, connection::signon, TIME, timeout, and ucrec::uc_modes.

00034 {
+00035         // the PROPER way to do it, AVOID bzero at *ALL* costs
+00036         strcpy(nick,"");
+00037         strcpy(ip,"127.0.0.1");
+00038         timeout = 0;
+00039         strcpy(ident,"");
+00040         strcpy(host,"");
+00041         strcpy(dhost,"");
+00042         strcpy(fullname,"");
+00043         strcpy(modes,"");
+00044         server = (char*)FindServerNamePtr(ServerName);
+00045         strcpy(awaymsg,"");
+00046         strcpy(oper,"");
+00047         reset_due = TIME;
+00048         lines_in = 0;
+00049         fd = lastping = signon = idle_lastmsg = nping = registered = 0;
+00050         flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
+00051         haspassed = false;
+00052         dns_done = false;
+00053         recvq = "";
+00054         sendq = "";
+00055         for (int i = 0; i < MAXCHANS; i++)
+00056         {
+00057                 this->chans[i].channel = NULL;
+00058                 this->chans[i].uc_modes = 0;
+00059         }
+00060         invites.clear();
+00061 }
+

-

00033 {
-00034         // the PROPER way to do it, AVOID bzero at *ALL* costs
-00035         strcpy(nick,"");
-00036         strcpy(ip,"127.0.0.1");
-00037         timeout = 0;
-00038         strcpy(ident,"");
-00039         strcpy(host,"");
-00040         strcpy(dhost,"");
-00041         strcpy(fullname,"");
-00042         strcpy(modes,"");
-00043         server = (char*)FindServerNamePtr(ServerName);
-00044         strcpy(awaymsg,"");
-00045         strcpy(oper,"");
-00046         reset_due = TIME;
-00047         lines_in = 0;
-00048         fd = lastping = signon = idle_lastmsg = nping = registered = 0;
-00049         flood = port = bytes_in = bytes_out = cmds_in = cmds_out = 0;
-00050         haspassed = false;
-00051         dns_done = false;
-00052         recvq = "";
-00053         sendq = "";
-00054         for (int i = 0; i < MAXCHANS; i++)
-00055         {
-00056                 this->chans[i].channel = NULL;
-00057                 this->chans[i].uc_modes = 0;
-00058         }
-00059         invites.clear();
-00060 }
-
-

- +

+

- + -
virtual userrec::~userrec virtual userrec::~userrec  )  [inline, virtual]
- +
+
  @@ -244,32 +242,31 @@ References awaymsg,

-Definition at line 221 of file users.h. +Definition at line 221 of file users.h.

00221 {  }
+

-

00221 {  }
-


Member Function Documentation

-

- +

+

- + - + -
bool userrec::AddBuffer bool userrec::AddBuffer std::string std::string  a  ) 
- +
- -
  @@ -279,58 +276,57 @@ Definition at line 221 of f

This method adds data to the buffer of the user.

-The buffer can grow to any size within limits of the available memory, managed by the size of a std::string, however if any individual line in the buffer grows over 600 bytes in length (which is 88 chars over the RFC-specified limit per line) then the method will return false and the text will not be inserted. -

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

-References recvq, recvqmax, and SetWriteError(). -

-

00193 {
-00194         std::string b = "";
-00195         for (int i = 0; i < a.length(); i++)
-00196                 if ((a[i] != '\r') && (a[i] != '\0') && (a[i] != 7))
-00197                         b = b + a[i];
-00198         std::stringstream stream(recvq);
-00199         stream << b;
-00200         recvq = stream.str();
-00201         int i = 0;
-00202         // count the size of the first line in the buffer.
-00203         while (i < recvq.length())
-00204         {
-00205                 if (recvq[i++] == '\n')
-00206                         break;
-00207         }
-00208         if (recvq.length() > this->recvqmax)
-00209         {
-00210                 this->SetWriteError("RecvQ exceeded");
-00211                 WriteOpers("*** User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->recvqmax);
-00212         }
-00213         // return false if we've had more than 600 characters WITHOUT
-00214         // a carriage return (this is BAD, drop the socket)
-00215         return (i < 600);
-00216 }
-
-

- +The buffer can grow to any size within limits of the available memory, managed by the size of a std::string, however if any individual line in the buffer grows over 600 bytes in length (which is 88 chars over the RFC-specified limit per line) then the method will return false and the text will not be inserted. +

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

+References recvq, recvqmax, and SetWriteError().

00195 {
+00196         std::string b = "";
+00197         for (unsigned int i = 0; i < a.length(); i++)
+00198                 if ((a[i] != '\r') && (a[i] != '\0') && (a[i] != 7))
+00199                         b = b + a[i];
+00200         std::stringstream stream(recvq);
+00201         stream << b;
+00202         recvq = stream.str();
+00203         unsigned int i = 0;
+00204         // count the size of the first line in the buffer.
+00205         while (i < recvq.length())
+00206         {
+00207                 if (recvq[i++] == '\n')
+00208                         break;
+00209         }
+00210         if (recvq.length() > (unsigned)this->recvqmax)
+00211         {
+00212                 this->SetWriteError("RecvQ exceeded");
+00213                 WriteOpers("*** User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->recvqmax);
+00214         }
+00215         // return false if we've had more than 600 characters WITHOUT
+00216         // a carriage return (this is BAD, drop the socket)
+00217         return (i < 600);
+00218 }
+
+

+ + +

+

+
- + - + -
void userrec::AddWriteBuf void userrec::AddWriteBuf std::string std::string  data  ) 
- +
+
  @@ -340,46 +336,45 @@ References recvq, Adds to the user's write buffer.

-You may add any amount of text up to this users sendq value, if you exceed the sendq value, SetWriteError() will be called to set the users error string to "SendQ exceeded", and further buffer adds will be dropped. +You may add any amount of text up to this users sendq value, if you exceed the sendq value, SetWriteError() will be called to set the users error string to "SendQ exceeded", and further buffer adds will be dropped.

-Definition at line 248 of file users.cpp. +Definition at line 250 of file users.cpp.

-References GetWriteError(), sendq, sendqmax, and SetWriteError(). +References sendq, sendqmax, and SetWriteError().

00251 {
+00252         if (this->GetWriteError() != "")
+00253                 return;
+00254         if (sendq.length() + data.length() > (unsigned)this->sendqmax)
+00255         {
+00256                 WriteOpers("*** User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->sendqmax);
+00257                 this->SetWriteError("SendQ exceeded");
+00258                 return;
+00259         }
+00260         std::stringstream stream;
+00261         stream << sendq << data;
+00262         sendq = stream.str();
+00263 }
+

-

00249 {
-00250         if (this->GetWriteError() != "")
-00251                 return;
-00252         if (sendq.length() + data.length() > this->sendqmax)
-00253         {
-00254                 WriteOpers("*** User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->sendqmax);
-00255                 this->SetWriteError("SendQ exceeded");
-00256                 return;
-00257         }
-00258         std::stringstream stream;
-00259         stream << sendq << data;
-00260         sendq = stream.str();
-00261 }
-
-

- +

+

- + -
bool userrec::BufferIsReady bool userrec::BufferIsReady  ) 
- +
+
  @@ -391,37 +386,36 @@ This method returns true if the buffer contains at least one carriage return cha

one complete line may be read)

-Definition at line 218 of file users.cpp. +Definition at line 220 of file users.cpp.

-References recvq. +References recvq.

00221 {
+00222         for (unsigned int i = 0; i < recvq.length(); i++)
+00223                 if (recvq[i] == '\n')
+00224                         return true;
+00225         return false;
+00226 }
+

-

00219 {
-00220         for (int i = 0; i < recvq.length(); i++)
-00221                 if (recvq[i] == '\n')
-00222                         return true;
-00223         return false;
-00224 }
-
-

- +

+

- + -
void userrec::ClearBuffer void userrec::ClearBuffer  ) 
- +
+
  @@ -433,36 +427,35 @@ This function clears the entire buffer by setting it to an empty string.

-Definition at line 226 of file users.cpp. +Definition at line 228 of file users.cpp.

References recvq.

-Referenced by Server::PseudoToUser(), and Server::UserToPseudo(). +Referenced by Server::PseudoToUser(), and Server::UserToPseudo().

00229 {
+00230         recvq = "";
+00231 }
+

-

00227 {
-00228         recvq = "";
-00229 }
-
-

- +

+

- + -
void userrec::CloseSocket void userrec::CloseSocket  ) 
- +
+
  @@ -474,33 +467,32 @@ Shuts down and closes the user's socket.

-Definition at line 62 of file users.cpp. +Definition at line 63 of file users.cpp.

00064 {
+00065         shutdown(this->fd,2);
+00066         close(this->fd);
+00067 }
+

-

00063 {
-00064         shutdown(this->fd,2);
-00065         close(this->fd);
-00066 }
-
-

- +

+

- + -
void userrec::FlushWriteBuf void userrec::FlushWriteBuf  ) 
- +
- -
  @@ -512,51 +504,50 @@ Flushes as much of the user's buffer to the file descriptor as possible.

This function may not always flush the entire buffer, rather instead as much of it as it possibly can. If the send() call fails to send the entire buffer, the buffer position is advanced forwards and the rest of the data sent at the next call to this method.

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

-References connection::bytes_out, connection::cmds_out, sendq, and SetWriteError(). -

-

00265 {
-00266         if (sendq.length())
-00267         {
-00268                 char* tb = (char*)this->sendq.c_str();
-00269                 int n_sent = write(this->fd,tb,this->sendq.length());
-00270                 if (n_sent == -1)
-00271                 {
-00272                         this->SetWriteError(strerror(errno));
-00273                 }
-00274                 else
-00275                 {
-00276                         // advance the queue
-00277                         tb += n_sent;
-00278                         this->sendq = tb;
-00279                         // update the user's stats counters
-00280                         this->bytes_out += n_sent;
-00281                         this->cmds_out++;
-00282                 }
-00283         }
-00284 }
-
-

- +Definition at line 266 of file users.cpp. +

+References connection::bytes_out, connection::cmds_out, sendq, and SetWriteError().

00267 {
+00268         if (sendq.length())
+00269         {
+00270                 char* tb = (char*)this->sendq.c_str();
+00271                 int n_sent = write(this->fd,tb,this->sendq.length());
+00272                 if (n_sent == -1)
+00273                 {
+00274                         this->SetWriteError(strerror(errno));
+00275                 }
+00276                 else
+00277                 {
+00278                         // advance the queue
+00279                         tb += n_sent;
+00280                         this->sendq = tb;
+00281                         // update the user's stats counters
+00282                         this->bytes_out += n_sent;
+00283                         this->cmds_out++;
+00284                 }
+00285         }
+00286 }
+
+

+ + +

+

+
- + -
std::string userrec::GetBuffer std::string userrec::GetBuffer  ) 
- +
- -
  @@ -566,48 +557,47 @@ References connection::byt

This method returns the first available string at the tail end of the buffer and advances the tail end of the buffer past the string.

-This means it is a one way operation in a similar way to strtok(), and multiple calls return multiple lines if they are available. The results of this function if there are no lines to be read are unknown, always use BufferIsReady() to check if it is ok to read the buffer before calling GetBuffer(). +This means it is a one way operation in a similar way to strtok(), and multiple calls return multiple lines if they are available. The results of this function if there are no lines to be read are unknown, always use BufferIsReady() to check if it is ok to read the buffer before calling GetBuffer().

-Definition at line 231 of file users.cpp. +Definition at line 233 of file users.cpp.

-References recvq. +References recvq.

00234 {
+00235         if (recvq == "")
+00236                 return "";
+00237         char* line = (char*)recvq.c_str();
+00238         std::string ret = "";
+00239         while ((*line != '\n') && (strlen(line)))
+00240         {
+00241                 ret = ret + *line;
+00242                 line++;
+00243         }
+00244         if ((*line == '\n') || (*line == '\r'))
+00245                 line++;
+00246         recvq = line;
+00247         return ret;
+00248 }
+

-

00232 {
-00233         if (recvq == "")
-00234                 return "";
-00235         char* line = (char*)recvq.c_str();
-00236         std::string ret = "";
-00237         while ((*line != '\n') && (strlen(line)))
-00238         {
-00239                 ret = ret + *line;
-00240                 line++;
-00241         }
-00242         if ((*line == '\n') || (*line == '\r'))
-00243                 line++;
-00244         recvq = line;
-00245         return ret;
-00246 }
-
-

- + + +
+

+
- + -
char * userrec::GetFullHost char * userrec::GetFullHost  )  [virtual]
- +
+
  @@ -619,36 +609,35 @@ Returns the full displayed host of the user This member function returns the hos

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

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

00070 {
+00071         static char result[MAXBUF];
+00072         snprintf(result,MAXBUF,"%s!%s@%s",nick,ident,dhost);
+00073         return result;
+00074 }
+

-

00069 {
-00070         static char result[MAXBUF];
-00071         snprintf(result,MAXBUF,"%s!%s@%s",nick,ident,dhost);
-00072         return result;
-00073 }
-
-

- +

+

- + -
char * userrec::GetFullRealHost char * userrec::GetFullRealHost  )  [virtual]
- +
+
  @@ -660,36 +649,35 @@ Returns the full real host of the user This member function returns the hostname

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 85 of file users.cpp. +Definition at line 87 of file users.cpp.

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

00088 {
+00089         static char fresult[MAXBUF];
+00090         snprintf(fresult,MAXBUF,"%s!%s@%s",nick,ident,host);
+00091         return fresult;
+00092 }
+

-

00086 {
-00087         static char fresult[MAXBUF];
-00088         snprintf(fresult,MAXBUF,"%s!%s@%s",nick,ident,host);
-00089         return fresult;
-00090 }
-
-

- +

+

- + -
InvitedList * userrec::GetInviteList InvitedList * userrec::GetInviteList  ) 
- +
+
  @@ -701,34 +689,33 @@ Returns the list of channels this user has been invited to but has not yet joine

-Definition at line 106 of file users.cpp. +Definition at line 108 of file users.cpp.

-References InvitedList, and invites. +References invites.

00109 {
+00110         return &invites;
+00111 }
+

-

00107 {
-00108         return &invites;
-00109 }
-
-

- +

+

- + -
std::string userrec::GetWriteError std::string userrec::GetWriteError  ) 
- +
+
  @@ -740,37 +727,34 @@ Returns the write error which last occured on this connection or an empty string

-Definition at line 294 of file users.cpp. +Definition at line 296 of file users.cpp.

-References WriteError. +References WriteError.

00297 {
+00298         return this->WriteError;
+00299 }
+

-Referenced by AddWriteBuf(). -

-

00295 {
-00296         return this->WriteError;
-00297 }
-
-

- +

+

- + -
bool userrec::HasPermission bool userrec::HasPermission char *  command  ) 
- +
- -
  @@ -780,83 +764,82 @@ Referenced by AddWriteBuf() 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 140 of file users.cpp. -

-References config_f, and DEBUG. -

-

00141 {
-00142         char TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF];
-00143         char* mycmd;
-00144         char* savept;
-00145         char* savept2;
-00146         
-00147         // are they even an oper at all?
-00148         if (strchr(this->modes,'o'))
-00149         {
-00150                 log(DEBUG,"*** HasPermission: %s is an oper",this->nick);
-00151                 for (int j =0; j < ConfValueEnum("type",&config_f); j++)
-00152                 {
-00153                         ConfValue("type","name",j,TypeName,&config_f);
-00154                         if (!strcmp(TypeName,this->oper))
-00155                         {
-00156                                 log(DEBUG,"*** HasPermission: %s is an oper of type '%s'",this->nick,this->oper);
-00157                                 ConfValue("type","classes",j,Classes,&config_f);
-00158                                 char* myclass = strtok_r(Classes," ",&savept);
-00159                                 while (myclass)
-00160                                 {
-00161                                         log(DEBUG,"*** HasPermission: checking classtype '%s'",myclass);
-00162                                         for (int k =0; k < ConfValueEnum("class",&config_f); k++)
-00163                                         {
-00164                                                 ConfValue("class","name",k,ClassName,&config_f);
-00165                                                 if (!strcmp(ClassName,myclass))
-00166                                                 {
-00167                                                         ConfValue("class","commands",k,CommandList,&config_f);
-00168                                                         log(DEBUG,"*** HasPermission: found class named %s with commands: '%s'",ClassName,CommandList);
-00169                                                         
-00170                                                         
-00171                                                         mycmd = strtok_r(CommandList," ",&savept2);
-00172                                                         while (mycmd)
-00173                                                         {
-00174                                                                 if (!strcasecmp(mycmd,command))
-00175                                                                 {
-00176                                                                         log(DEBUG,"*** Command %s found, returning true",command);
-00177                                                                         return true;
-00178                                                                 }
-00179                                                                 mycmd = strtok_r(NULL," ",&savept2);
-00180                                                         }
-00181                                                 }
-00182                                         }
-00183                                         myclass = strtok_r(NULL," ",&savept);
-00184                                 }
-00185                         }
-00186                 }
-00187         }
-00188         return false;
-00189 }
-
-

- +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 142 of file users.cpp. +

+References config_f, and DEBUG.

00143 {
+00144         char TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF];
+00145         char* mycmd;
+00146         char* savept;
+00147         char* savept2;
+00148         
+00149         // are they even an oper at all?
+00150         if (strchr(this->modes,'o'))
+00151         {
+00152                 log(DEBUG,"*** HasPermission: %s is an oper",this->nick);
+00153                 for (int j =0; j < ConfValueEnum("type",&config_f); j++)
+00154                 {
+00155                         ConfValue("type","name",j,TypeName,&config_f);
+00156                         if (!strcmp(TypeName,this->oper))
+00157                         {
+00158                                 log(DEBUG,"*** HasPermission: %s is an oper of type '%s'",this->nick,this->oper);
+00159                                 ConfValue("type","classes",j,Classes,&config_f);
+00160                                 char* myclass = strtok_r(Classes," ",&savept);
+00161                                 while (myclass)
+00162                                 {
+00163                                         log(DEBUG,"*** HasPermission: checking classtype '%s'",myclass);
+00164                                         for (int k =0; k < ConfValueEnum("class",&config_f); k++)
+00165                                         {
+00166                                                 ConfValue("class","name",k,ClassName,&config_f);
+00167                                                 if (!strcmp(ClassName,myclass))
+00168                                                 {
+00169                                                         ConfValue("class","commands",k,CommandList,&config_f);
+00170                                                         log(DEBUG,"*** HasPermission: found class named %s with commands: '%s'",ClassName,CommandList);
+00171                                                         
+00172                                                         
+00173                                                         mycmd = strtok_r(CommandList," ",&savept2);
+00174                                                         while (mycmd)
+00175                                                         {
+00176                                                                 if (!strcasecmp(mycmd,command))
+00177                                                                 {
+00178                                                                         log(DEBUG,"*** Command %s found, returning true",command);
+00179                                                                         return true;
+00180                                                                 }
+00181                                                                 mycmd = strtok_r(NULL," ",&savept2);
+00182                                                         }
+00183                                                 }
+00184                                         }
+00185                                         myclass = strtok_r(NULL," ",&savept);
+00186                                 }
+00187                         }
+00188                 }
+00189         }
+00190         return false;
+00191 }
+
+

+ + +

+

+
- + -
void userrec::InviteTo void userrec::InviteTo char *  channel  )  [virtual]
- +
+
  @@ -868,37 +851,36 @@ Adds a channel to a users invite list (invites them to a channel).

-Definition at line 111 of file users.cpp. +Definition at line 113 of file users.cpp.

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

00114 {
+00115         Invited i;
+00116         strlcpy(i.channel,channel,CHANMAX);
+00117         invites.push_back(i);
+00118 }
+

-

00112 {
-00113         Invited i;
-00114         strlcpy(i.channel,channel,CHANMAX);
-00115         invites.push_back(i);
-00116 }
-
-

- +

+

- + -
bool userrec::IsInvited bool userrec::IsInvited char *  channel  )  [virtual]
- +
+
  @@ -910,53 +892,52 @@ Returns true if a user is invited to a channel.

-Definition at line 92 of file users.cpp. +Definition at line 94 of file users.cpp.

-References invites. +References invites.

00095 {
+00096         for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
+00097         {
+00098                 if (i->channel) {
+00099                         if (!strcasecmp(i->channel,channel))
+00100                         {
+00101                                 return true;
+00102                         }
+00103                 }
+00104         }
+00105         return false;
+00106 }
+

-

00093 {
-00094         for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
-00095         {
-00096                 if (i->channel) {
-00097                         if (!strcasecmp(i->channel,channel))
-00098                         {
-00099                                 return true;
-00100                         }
-00101                 }
-00102         }
-00103         return false;
-00104 }
-
-

- +

+

- + - - + + - + -
int userrec::ReadData int userrec::ReadData void *  buffer,
size_t  size
- +
+
  @@ -968,39 +949,39 @@ Calls read() to read some data for this user using their fd.

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

-References connection::fd. +References DEBUG.

00077 {
+00078         if (this->fd > -1)
+00079         {
+00080                 log(DEBUG,"userrec::ReadData on fd %d",this->fd);
+00081                 return read(this->fd, buffer, size);
+00082         }
+00083         else return 0;
+00084 }
+

-

00076 {
-00077         if (this->fd > -1)
-00078         {
-00079                 return read(this->fd, buffer, size);
-00080         }
-00081         else return 0;
-00082 }
-
-

- +

+

- + -
void userrec::RemoveInvite void userrec::RemoveInvite char *  channel  )  [virtual]
- +
- -
  @@ -1012,52 +993,51 @@ 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 118 of file users.cpp. -

-References DEBUG, and invites. -

-

00119 {
-00120         log(DEBUG,"Removing invites");
-00121         if (channel)
-00122         {
-00123                 if (invites.size())
-00124                 {
-00125                         for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
-00126                         {
-00127                                 if (i->channel)
-00128                                 {
-00129                                         if (!strcasecmp(i->channel,channel))
-00130                                         {
-00131                                                 invites.erase(i);
-00132                                                 return;
-00133                                         }
-00134                                 }
-00135                         }
-00136                 }
-00137         }
-00138 }
-
-

- +Definition at line 120 of file users.cpp. +

+References DEBUG, and invites.

00121 {
+00122         log(DEBUG,"Removing invites");
+00123         if (channel)
+00124         {
+00125                 if (invites.size())
+00126                 {
+00127                         for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
+00128                         {
+00129                                 if (i->channel)
+00130                                 {
+00131                                         if (!strcasecmp(i->channel,channel))
+00132                                         {
+00133                                                 invites.erase(i);
+00134                                                 return;
+00135                                         }
+00136                                 }
+00137                         }
+00138                 }
+00139         }
+00140 }
+
+

+ + +

+

+
- + - + -
void userrec::SetWriteError void userrec::SetWriteError std::string std::string  error  ) 
- +
+
  @@ -1069,34 +1049,35 @@ Sets the write error for a connection.

This is done because the actual disconnect of a client may occur at an inopportune time such as half way through /LIST output. The WriteErrors of clients are checked at a more ideal time (in the mainloop) and errored clients purged.

-Definition at line 286 of file users.cpp. +Definition at line 288 of file users.cpp.

References DEBUG, and WriteError.

-Referenced by AddBuffer(), AddWriteBuf(), and FlushWriteBuf(). +Referenced by AddBuffer(), AddWriteBuf(), and FlushWriteBuf().

00289 {
+00290         log(DEBUG,"Setting error string for %s to '%s'",this->nick,error.c_str());
+00291         // don't try to set the error twice, its already set take the first string.
+00292         if (this->WriteError == "")
+00293                 this->WriteError = error;
+00294 }
+

-

00287 {
-00288         log(DEBUG,"Setting error string for %s to '%s'",this->nick,error.c_str());
-00289         // don't try to set the error twice, its already set take the first string.
-00290         if (this->WriteError == "")
-00291                 this->WriteError = error;
-00292 }
-


Member Data Documentation

-

- +

+

- +
char userrec::awaymsg[MAXAWAY+1] + char userrec::awaymsg[MAXAWAY+1]
- +
+Referenced by userrec().
  @@ -1110,21 +1091,22 @@ If this string is empty, the user is not marked as away.

Definition at line 155 of file users.h.

-Referenced by userrec().

-

- +

+

- +
ucrec userrec::chans[MAXCHANS] + ucrec userrec::chans[MAXCHANS]
- +
+Referenced by Server::PseudoToUser(), and userrec().
  @@ -1136,21 +1118,22 @@ Referenced by userrec().

Definition at line 146 of file users.h.

-Referenced by Server::PseudoToUser(), and userrec().

-

- +

+

- +
char userrec::dhost[160] + char userrec::dhost[160]
- +
+Referenced by GetFullHost(), and userrec().
  @@ -1160,25 +1143,26 @@ Referenced by Server::Pseud

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 131 of file users.h.

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

-

- +

+

- +
bool userrec::dns_done + bool userrec::dns_done
- +
+Referenced by userrec().
  @@ -1192,21 +1176,22 @@ True when DNS lookups are completed.

Definition at line 178 of file users.h.

-Referenced by userrec().

-

- +

+

- +
int userrec::flood + int userrec::flood
- +
+Referenced by userrec().
  @@ -1220,21 +1205,22 @@ Number of lines the user can place into the buffer (up to the global NetBufferSi

Definition at line 161 of file users.h.

-Referenced by userrec().

-

- +

+

- +
char userrec::fullname[MAXGECOS+1] + char userrec::fullname[MAXGECOS+1]
- +
+Referenced by userrec().
  @@ -1248,21 +1234,22 @@ The users full name.

Definition at line 135 of file users.h.

-Referenced by userrec().

-

- +

+

- +
char userrec::ident[IDENTMAX+2] + char userrec::ident[IDENTMAX+2]
- +
+Referenced by GetFullHost(), GetFullRealHost(), Server::PseudoToUser(), userrec(), and Server::UserToPseudo().
  @@ -1276,21 +1263,22 @@ Two characters are added to the user-defined limit to compensate for the tilde e

Definition at line 126 of file users.h.

-Referenced by GetFullHost(), GetFullRealHost(), Server::PseudoToUser(), userrec(), and Server::UserToPseudo().

-

- +

+

- +
InvitedList userrec::invites [private] + InvitedList userrec::invites [private]
- +
+Referenced by GetInviteList(), InviteTo(), IsInvited(), RemoveInvite(), and userrec().
  @@ -1304,21 +1292,22 @@ A list of channels the user has a pending invite to.

Definition at line 114 of file users.h.

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

-

- +

+

- +
int userrec::lines_in + int userrec::lines_in
- +
+Referenced by userrec().
  @@ -1332,21 +1321,22 @@ Flood counters.

Definition at line 203 of file users.h.

-Referenced by userrec().

-

- +

+

- +
char userrec::modes[54] + char userrec::modes[54]
- +
+Referenced by userrec().
  @@ -1360,21 +1350,22 @@ This may contain any of the following RFC characters: o, w, s, i Your module may

Definition at line 144 of file users.h.

-Referenced by userrec().

-

- +

+

- +
char userrec::nick[NICKMAX] + char userrec::nick[NICKMAX]
- +
+Referenced by ConfigReader::DumpErrors(), GetFullHost(), GetFullRealHost(), Server::PseudoToUser(), and userrec().
  @@ -1388,21 +1379,22 @@ An invalid nickname indicates an unregistered connection prior to the NICK comma

Definition at line 121 of file users.h.

-Referenced by ConfigReader::DumpErrors(), GetFullHost(), GetFullRealHost(), Server::PseudoToUser(), and userrec().

-

- +

+

- +
char userrec::oper[NICKMAX] + char userrec::oper[NICKMAX]
- +
+Referenced by userrec().
  @@ -1416,21 +1408,22 @@ This is used to check permissions in operclasses, so that we can say 'yay' or 'n

Definition at line 174 of file users.h.

-Referenced by userrec().

-

- +

+

- +
char userrec::password[MAXBUF] + char userrec::password[MAXBUF]
- +
  @@ -1440,23 +1433,24 @@ Referenced by userrec().

Password specified by the user when they registered.

-This is stored even if the block doesnt need a password, so that modules may check it. +This is stored even if the <connect> block doesnt need a password, so that modules may check it.

Definition at line 188 of file users.h.

-

- +

+

- +
unsigned int userrec::pingmax + unsigned int userrec::pingmax
- +
  @@ -1471,18 +1465,19 @@ Number of seconds between PINGs for this user (set from <connect:allow> ta Definition at line 182 of file users.h.
-

- +

+

- +
std::string userrec::recvq + std::string userrec::recvq
- +
+Referenced by AddBuffer(), BufferIsReady(), ClearBuffer(), GetBuffer(), and userrec().
  @@ -1496,21 +1491,22 @@ Lines from the IRCd awaiting processing are stored here. Upgraded april 2005, ol

Definition at line 194 of file users.h.

-Referenced by AddBuffer(), BufferIsReady(), ClearBuffer(), GetBuffer(), and userrec().

-

- +

+

- +
long userrec::recvqmax + long userrec::recvqmax
- +
+Referenced by AddBuffer().
  @@ -1524,21 +1520,22 @@ Maximum size this user's recvq can become.

Definition at line 217 of file users.h.

-Referenced by AddBuffer().

-

- +

+

- +
time_t userrec::reset_due + time_t userrec::reset_due
- +
+Referenced by userrec().
  @@ -1550,21 +1547,22 @@ Referenced by AddBuffer()

Definition at line 204 of file users.h.

-Referenced by userrec().

-

- +

+

- +
std::string userrec::sendq + std::string userrec::sendq
- +
+Referenced by AddWriteBuf(), FlushWriteBuf(), and userrec().
  @@ -1578,21 +1576,22 @@ Lines waiting to be sent are stored here until their buffer is flushed.

Definition at line 199 of file users.h.

-Referenced by AddWriteBuf(), FlushWriteBuf(), and userrec().

-

- +

+

- +
long userrec::sendqmax + long userrec::sendqmax
- +
+Referenced by AddWriteBuf().
  @@ -1606,21 +1605,22 @@ Maximum size this user's sendq can become.

Definition at line 213 of file users.h.

-Referenced by AddWriteBuf().

-

- +

+

- +
char* userrec::server + char* userrec::server
- +
+Referenced by userrec().
  @@ -1634,21 +1634,22 @@ The server the user is connected to.

Definition at line 150 of file users.h.

-Referenced by userrec().

-

- +

+

- +
long userrec::threshold + long userrec::threshold
- +
  @@ -1661,18 +1662,19 @@ Referenced by userrec(). Definition at line 205 of file users.h.
-

- +

+

- +
unsigned int userrec::timeout + unsigned int userrec::timeout
- +
+Referenced by userrec().
  @@ -1686,21 +1688,22 @@ Number of seconds this user is given to send USER/NICK If they do not send their

Definition at line 167 of file users.h.

-Referenced by userrec().

-

- +

+

- +
std::string userrec::WriteError + std::string userrec::WriteError
- +
+Referenced by GetWriteError(), and SetWriteError().
  @@ -1712,14 +1715,13 @@ Referenced by userrec().

Definition at line 209 of file users.h.

-Referenced by GetWriteError(), and SetWriteError().


The documentation for this class was generated from the following files: -
Generated on Mon May 30 05:17:43 2005 for InspIRCd by +
Generated on Sun Nov 27 01:43:26 2005 for InspIRCd by  -doxygen -1.3.3
+doxygen 1.4.4-20050815
-- cgit v1.2.3