X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fusers.h;h=0dfbc222367ee41f84de20559edc0b8421e606c5;hb=db11f2b24c6aeb5ab7ba4678638890bc68b1d0c1;hp=95805454e517100d985fcd2c1ca4cc29ca501b8c;hpb=6a17cb616683c2ffe3b26a8c8f1f9b5b2c3e76d3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/users.h b/include/users.h index 95805454e..0dfbc2223 100644 --- a/include/users.h +++ b/include/users.h @@ -1,46 +1,23 @@ -/* - -$Log$ -Revision 1.3 2003/01/27 00:22:53 brain -Modified documentation -Moved some classes below base class - -Revision 1.2 2003/01/26 23:52:59 brain -Modified documentation for base classes -Added base classes - -Revision 1.1.1.1 2003/01/23 19:45:58 brain -InspIRCd second source tree - -Revision 1.9 2003/01/22 00:44:26 brain -Added documentation comments - -Revision 1.8 2003/01/21 21:11:17 brain -Added documentation - -Revision 1.7 2003/01/17 13:21:38 brain -Added CONNECT ALLOW and CONNECT DENY config tags -Added PASS command - -Revision 1.6 2003/01/17 10:37:55 brain -Added /INVITE command and relevent structures - -Revision 1.5 2003/01/16 20:11:56 brain -fixed some ugly pointer bugs (thanks dblack and a|KK|y!) - -Revision 1.4 2003/01/15 22:47:44 brain -Changed user and channel structs to classes (finally) - -Revision 1.3 2003/01/14 21:14:30 brain -added /ISON command (for mIRC etc basic notify) - - -*/ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * Inspire is copyright (C) 2002-2004 ChatSpike-Dev. + * E-mail: + * + * + * + * Written by Craig Edwards, Craig McLure, and others. + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ #include "inspircd_config.h" #include "channels.h" #include "connection.h" - +#include "inspstring.h" #include #ifndef __USERS_H__ @@ -68,20 +45,49 @@ class Invited : public classbase class ConnectClass : public classbase { public: + /** Type of line, either CC_ALLOW or CC_DENY + */ int type; + /** Max time to register the connection in seconds + */ + int registration_timeout; + /** Number of lines in buffer before excess flood is triggered + */ + int flood; + /** Host mask for this line + */ char host[MAXBUF]; + /** Number of seconds between pings for this line + */ + int pingtime; + /** (Optional) Password for this line + */ char pass[MAXBUF]; + + /** Threshold value for flood disconnect + */ + long threshold; + + ConnectClass() + { + registration_timeout = 0; + flood = 0; + pingtime = 0; + threshold = 0; + strlcpy(host,"",MAXBUF); + strlcpy(pass,"",MAXBUF); + } }; /** Holds a complete list of all channels to which a user has been invited and has not yet joined. */ -typedef vector InvitedList; +typedef std::vector InvitedList; /** Holds a complete list of all allow and deny tags from the configuration file (connection classes) */ -typedef vector ClassVector; +typedef std::vector ClassVector; /** Holds all information about a user * This class stores all information about a user connected to the irc server. Everything about a @@ -121,7 +127,7 @@ class userrec : public connection * This may contain any of the following RFC characters: o, w, s, i * Your module may define other mode characters as it sees fit. */ - char modes[32]; + char modes[MAXBUF]; ucrec chans[MAXCHANS]; @@ -139,6 +145,51 @@ class userrec : public connection */ char result[256]; + /** Number of lines the user can place into the buffer + * (up to the global NetBufferSize bytes) before they + * are disconnected for excess flood + */ + int flood; + + /** 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 + */ + unsigned long timeout; + + /** 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. + */ + char oper[NICKMAX]; + + /** True when DNS lookups are completed. + */ + bool dns_done; + + /** Number of seconds between PINGs for this user (set from <connect:allow> tag + */ + unsigned long pingmax; + + /** 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. + */ + char password[MAXBUF]; + + /** User's receive queue. + * Lines from the IRCd awaiting processing are stored here. + * Upgraded april 2005, old system a bit hairy. + */ + std::string recvq; + + /** Flood counters + */ + long lines_in; + time_t reset_due; + long threshold; + userrec(); virtual ~userrec() { } @@ -170,6 +221,17 @@ class userrec : public connection */ virtual void RemoveInvite(char* channel); + /** 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. + */ + bool HasPermission(char* command); + + bool userrec::AddBuffer(std::string a); + bool userrec::BufferIsReady(); + void userrec::ClearBuffer(); + std::string userrec::GetBuffer(); + };