1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 #ifndef __USERMANAGER_H
15 #define __USERMANAGER_H
17 /** A list of ip addresses cross referenced against clone counts */
18 typedef std::map<irc::string, unsigned int> clonemap;
20 class CoreExport UserManager : public classbase
23 InspIRCd *ServerInstance;
25 /** Map of local ip addresses for clone counting
27 clonemap local_clones;
29 UserManager(InspIRCd *Instance)
31 ServerInstance = Instance;
34 /** Map of global ip addresses for clone counting
35 * XXX - this should be private, but m_clones depends on it currently.
37 clonemap global_clones;
39 /** Add a user to the local clone map
40 * @param user The user to add
42 void AddLocalClone(User *user);
44 /** Add a user to the global clone map
45 * @param user The user to add
47 void AddGlobalClone(User *user);
49 /** Remove all clone counts from the user, you should
50 * use this if you change the user's IP address
51 * after they have registered.
52 * @param user The user to remove
54 void RemoveCloneCounts(User *user);
56 /** Return the number of global clones of this user
57 * @param user The user to get a count for
58 * @return The global clone count of this user
60 unsigned long GlobalCloneCount(User *user);
62 /** Return the number of local clones of this user
63 * @param user The user to get a count for
64 * @return The local clone count of this user
66 unsigned long LocalCloneCount(User *user);
71 void RemoveCloneCounts();