summaryrefslogtreecommitdiff
path: root/src/users.cpp
AgeCommit message (Collapse)Author
2007-11-11Implement roadmap item: "userrec::HasPermission -> map of maps, for (even ↵brain
faster) access" This is not a map of maps, but a single level map per oper, in non-opers this member is NULL. Please note that this is not yet tested. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8564 e03df62e-2008-0410-955e-edbf42e46eb7
2007-11-04BanCache: Add a negative hit for an IP address upon FullConnect.w00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8540 e03df62e-2008-0410-955e-edbf42e46eb7
2007-11-04Integrate K/Gline into the bancache system by making some modifications to ↵w00t
DefaultApply method. This means any type of XLine that uses DefaultApply can hook into the bancache system and add positive hits quickly and easily with no modification, which is neat. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8538 e03df62e-2008-0410-955e-edbf42e46eb7
2007-11-04Honking huge commit. Removal of DELETE() template that never worked right anywaybrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8527 e03df62e-2008-0410-955e-edbf42e46eb7
2007-11-04Avoid code duplication, just call XLine::Apply() rather than retyping all ↵brain
that moronbanner stuff each time git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8494 e03df62e-2008-0410-955e-edbf42e46eb7
2007-11-04BanCache positive hits should be overridden by E:, thanks Brainw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8493 e03df62e-2008-0410-955e-edbf42e46eb7
2007-11-04Hook BanCache up to work on Z:Lines. BanCache is checked first, for positive ↵w00t
hits, users are quit instantly. For negative hits, no checking is done (though we don't have any negative hits just yet). If no hit, zlines are checked -- if user is matched by a Z:, positive bancache entry is inserted. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8492 e03df62e-2008-0410-955e-edbf42e46eb7
2007-11-02Tidy up, and make the identifer for a line type be std::string not charbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8459 e03df62e-2008-0410-955e-edbf42e46eb7
2007-11-02xline gutting, once more. There is no longer an active_lines vector, and no ↵brain
requirement for sorting. Expiry will be cheked on a per-line basis for each positive hit on that line, saving on cpu time. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8457 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-28Fix this to pass a Userw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8405 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-25If the connect:limit is 0, dont deny connections for going over itbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8360 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-25this should fix any of the crashes w00t outlined where User::MyClass == NULL.brain
The simplest fix seems to be that if the user has no class, skip all the code that uses the class values. This makes sense because the only situation where User::MyClass == NULL is when they arent authorised to connect and are being quit so checking flood levels and max sendq etc are irrelevent. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8358 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-24Implement <connect:limit> - limits how many clients can sit inside a ↵w00t
<connect> tag. Brain, we have a problem here in that if we User::QuitUser() a user with a NULL MyClass member (connect class), then things break (like sendq et al). What should we do with this, create a generic catchall class or something just in case? (to replicate, set up a single connect class with a low limit, and connect too many clients. Crash is the result) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8357 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-24Disable all connect classes, reenable them as we find them in the config. ↵w00t
This stops users using a connect class removed from the conf (or will in a second) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8355 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-24Try this w00t, compiles, test running nowbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8343 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-24Start of refcount-based rehash stuff for <connect> tags, this is broken and ↵w00t
rather ugly right now.. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8342 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-23Move some stuff from using userrec cached stuff to using stuff in the ↵w00t
connect classes git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8339 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-23Fix a bug before I even started this.. don't let User::SetClass() decrease ↵w00t
the reference count if we cannot find the new class to plop them into, that will nark things up nicely.. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8338 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-23Some more class stuff, blah. Now possible to move a user to a different ↵w00t
class via User::SetClass(), which cmd_oper uses. GetClass() is now just a wrapper around User::MyClass. User::CheckClass() does not support any parameters anymore, nor does User::GetClass().. I think I have this all right ;p git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8337 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-23Some initial work towards tying <connect> classes to user accounts. This ↵w00t
will (in the longer term) allow for things like limits on how many users can fit in a <connect> for 1.2 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8336 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-22Remove the need for a bunch of the hard coded arrays/hashes by scanning the ↵brain
src/ dir for tag comments, like in modules git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8307 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-21Tidy up some DNS stuff morew00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8280 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-21Add User::IncreasePenalty() and User::DecreasePenalty()w00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8264 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-21Fixed ssl clients on trunk. The problem peavey was having was that before ↵brain
ReadBuffer was char[] now its char*. sizeof() on char[] returns its size in chars, and sizeof on char* returns 4. :p git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8263 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-21*untested* command buffering/penaltybrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8250 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-21Dont forget to initialize the new valuebrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8248 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-21Add User::UnderPenaltybrain
/** If this bool is set for a user, then the user is under penalty, in short they * are waiting for some held commands to be executed. If this is the case, then * any commands they have in their sendq are executed on a timer tick rather than in * their event handler. */ git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8244 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-21Change a !string.length to string.empty. these are more readable and on some ↵brain
implementations faster git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8243 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-18Socket engine tweaks to fix a glitch, and improvements to new m_identbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8225 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-16Remove second overridden (fully duplicated :/) copy of GetIPString which ↵w00t
copies into a user specified buffer. It's not used anywhere, and is duplication ;( git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8218 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-16Typo fixw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8217 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-16Update a commentw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8216 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-15Move oper classes and types stuff from users to configreader. It may need to ↵w00t
go in a class, I'm not going to investigate that now. Also make HasPermission() a bit easier to read via same changes I did in command_parse, but the strtok/strdup stuff really really has to go somehow I think.. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8215 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-15Split user resolver into its own file.w00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8209 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-15In the grand tradition of huge fucking commits:w00t
- chanrec -> Channel - userrec -> User Enjoy. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8204 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-15class command_t -> class Command. Whey :Dw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8203 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-14Put this back how it was, it didnt help with the fix last night which turned ↵brain
out to be something else git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8190 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-14Tweaksbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8174 e03df62e-2008-0410-955e-edbf42e46eb7
2007-10-13Move some stuff around, this will move a crash to a different place and ↵brain
maybe we'll catch it git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8171 e03df62e-2008-0410-955e-edbf42e46eb7
2007-09-30Whoops, forgot some stuff for when GECOS was moved to position 10 in the UID ↵brain
command, this was broken git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8102 e03df62e-2008-0410-955e-edbf42e46eb7
2007-09-26Fixed bug #404; this was caused by recieving multiple OPERTYPEs from a ↵special
remote server, which eventually resulted in bad pointers inside the all_opers list git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8084 e03df62e-2008-0410-955e-edbf42e46eb7
2007-09-23More compile fixesbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8057 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-29Add a pointless WriteOpersbrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7998 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-28Slight change to traffic logging, as I never remember which way the damn ↵w00t
arrows go: I now means in, O now means out. C and S remain unchanged git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7948 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-27Catch exceptions here for duplicate uuid (it shouldnt happen, which is why ↵brain
the exception message is so rediculous) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7914 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-27Remove more unnecessary header trafficw00t
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7887 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-27Add FindNickOnly, that wont fall through to uid checks if isdigit(*first). ↵brain
We may need this. (i thought we did for this fix, we dont) Fix cmd_nick to not treat all nicks as invalid and make the client give up. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7883 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-27Whoops, i had a ! and i didnt need onebrain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7882 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-27Fixed sigabrtbrain
NOTE to w00t: When a user gets allocated a uid that is duplicate, the constructor throws. This was happening because i didnt pay attention to what i wrote and it always added uid "" :P git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7881 e03df62e-2008-0410-955e-edbf42e46eb7
2007-08-27Add uuid hash_map - its management is automatic via userrec ↵brain
constructors/destructors. Note that this means 'fake' users used to set modes etc get a uid, but this isnt a major thing. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7876 e03df62e-2008-0410-955e-edbf42e46eb7