The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ModuleCgiIRC Class Reference

Inheritance diagram for ModuleCgiIRC:

Inheritance graph
[legend]
Collaboration diagram for ModuleCgiIRC:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleCgiIRC (InspIRCd *Me)
virtual void Prioritize ()
virtual void OnRehash (User *user, const std::string &parameter)
 Called on rehash.
virtual void OnCleanup (int target_type, void *item)
 Called before your module is unloaded to clean up Extensibles.
virtual void OnSyncUserMetaData (User *user, Module *proto, void *opaque, const std::string &extname, bool displayable)
virtual void OnDecodeMetaData (int target_type, void *target, const std::string &extname, const std::string &extdata)
 Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module.
virtual void OnUserDisconnect (User *user)
 Called whenever a user's socket is closed.
virtual int OnUserRegister (User *user)
 Called whenever a user is about to register their connection (e.g.
virtual void OnUserConnect (User *user)
 Called when a user connects.
bool CheckPass (User *user)
bool CheckIdent (User *user)
bool IsValidHost (const std::string &host)
bool IsValidIP (const std::string &ip)
bool HexToInt (int &out, const char *in)
virtual ~ModuleCgiIRC ()
virtual Version GetVersion ()
 Returns the version number of a Module.

Private Attributes

CommandWebircmycommand
bool NotifyOpers
CGIHostlist Hosts

Detailed Description

Definition at line 137 of file m_cgiirc.cpp.


Constructor & Destructor Documentation

ModuleCgiIRC::ModuleCgiIRC InspIRCd Me  )  [inline]
 

Definition at line 143 of file m_cgiirc.cpp.

References InspIRCd::AddCommand(), ModuleManager::Attach(), Hosts, I_OnCleanup, I_OnDecodeMetaData, I_OnRehash, I_OnSyncUserMetaData, I_OnUserConnect, I_OnUserDisconnect, I_OnUserRegister, InspIRCd::Modules, mycommand, NotifyOpers, OnRehash(), and Module::ServerInstance.

virtual ModuleCgiIRC::~ModuleCgiIRC  )  [inline, virtual]
 

Definition at line 503 of file m_cgiirc.cpp.


Member Function Documentation

bool ModuleCgiIRC::CheckIdent User user  )  [inline]
 

Definition at line 382 of file m_cgiirc.cpp.

References UserManager::AddGlobalClone(), UserManager::AddLocalClone(), InspIRCd::AddResolver(), User::CheckClass(), User::dhost, Extensible::Extend(), EventHandler::GetFd(), User::GetIPString(), User::GetPort(), User::GetProtocolFamily(), HexToInt(), User::host, User::ident, User::InvalidateCache(), User::nick, NotifyOpers, UserManager::RemoveCloneCounts(), Module::ServerInstance, User::SetSockAddr(), InspIRCd::SNO, InspIRCd::Users, and SnomaskManager::WriteToSnoMask().

Referenced by OnUserRegister().

bool ModuleCgiIRC::CheckPass User user  )  [inline]
 

Definition at line 327 of file m_cgiirc.cpp.

References UserManager::AddGlobalClone(), UserManager::AddLocalClone(), InspIRCd::AddResolver(), User::CheckClass(), User::dhost, Extensible::Extend(), EventHandler::GetFd(), User::GetIPString(), User::GetProtocolFamily(), User::host, User::InvalidateCache(), User::ip, IsValidHost(), User::nick, NotifyOpers, User::password, UserManager::RemoveCloneCounts(), Module::ServerInstance, InspIRCd::SNO, InspIRCd::Users, and SnomaskManager::WriteToSnoMask().

Referenced by OnUserRegister().

virtual Version ModuleCgiIRC::GetVersion  )  [inline, virtual]
 

Returns the version number of a Module.

The method should return a Version object with its version information assigned via Version::Version

Reimplemented from Module.

Definition at line 507 of file m_cgiirc.cpp.

References API_VERSION, and VF_VENDOR.

bool ModuleCgiIRC::HexToInt int &  out,
const char *  in
[inline]
 

Definition at line 489 of file m_cgiirc.cpp.

Referenced by CheckIdent().

bool ModuleCgiIRC::IsValidHost const std::string host  )  [inline]
 

Definition at line 433 of file m_cgiirc.cpp.

Referenced by CheckPass().

bool ModuleCgiIRC::IsValidIP const std::string ip  )  [inline]
 

Definition at line 454 of file m_cgiirc.cpp.

virtual void ModuleCgiIRC::OnCleanup int  target_type,
void *  item
[inline, virtual]
 

Called before your module is unloaded to clean up Extensibles.

This method is called once for every user and channel on the network, so that when your module unloads it may clear up any remaining data in the form of Extensibles added using Extensible::Extend(). If the target_type variable is TYPE_USER, then void* item refers to a User*, otherwise it refers to a Channel*.

Parameters:
target_type The type of item being cleaned
item A pointer to the item's class

Reimplemented from Module.

Definition at line 209 of file m_cgiirc.cpp.

References Extensible::GetExt(), Extensible::Shrink(), and TYPE_USER.

Referenced by OnUserDisconnect().

virtual void ModuleCgiIRC::OnDecodeMetaData int  target_type,
void *  target,
const std::string extname,
const std::string extdata
[inline, virtual]
 

Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module.

Please see src/modules/m_swhois.cpp for a working example of how to use this method call.

Parameters:
target_type The type of item to decode data for, TYPE_USER or TYPE_CHANNEL
target The Channel* or User* that data should be added to
extname The extension name which is being sent
extdata The extension data, encoded at the other end by an identical module through OnSyncChannelMetaData or OnSyncUserMetaData

Reimplemented from Module.

Definition at line 244 of file m_cgiirc.cpp.

References Extensible::Extend(), Extensible::GetExt(), and TYPE_USER.

virtual void ModuleCgiIRC::OnRehash User user,
const std::string parameter
[inline, virtual]
 

Called on rehash.

This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application. If a parameter is given, the core has done nothing. The module receiving the event can decide if this parameter has any relevence to it.

Parameters:
user The user performing the rehash, if any -- if this is server initiated, the value of this variable will be NULL.
parameter The (optional) parameter given to REHASH from the user.

Reimplemented from Module.

Definition at line 160 of file m_cgiirc.cpp.

References Conf, CONF_VALUE_NOT_FOUND, DEFAULT, ConfigReader::Enumerate(), ConfigReader::GetError(), Hosts, IDENT, INVALID, LogManager::Log(), InspIRCd::Logs, NotifyOpers, PASS, PASSFIRST, ConfigReader::ReadFlag(), ConfigReader::ReadValue(), Module::ServerInstance, and WEBIRC.

Referenced by ModuleCgiIRC().

virtual void ModuleCgiIRC::OnSyncUserMetaData User user,
Module proto,
void *  opaque,
const std::string extname,
bool  displayable
[inline, virtual]
 

Reimplemented from Module.

Definition at line 231 of file m_cgiirc.cpp.

References Extensible::GetExt(), Module::ProtoSendMetaData(), and TYPE_USER.

virtual void ModuleCgiIRC::OnUserConnect User user  )  [inline, virtual]
 

Called when a user connects.

The details of the connecting user are available to you in the parameter User *user

Parameters:
user The user who is connecting

Reimplemented from Module.

Definition at line 302 of file m_cgiirc.cpp.

References UserManager::AddGlobalClone(), UserManager::AddLocalClone(), User::dhost, Extensible::GetExt(), User::host, User::InvalidateCache(), UserManager::RemoveCloneCounts(), Module::ServerInstance, Extensible::Shrink(), and InspIRCd::Users.

virtual void ModuleCgiIRC::OnUserDisconnect User user  )  [inline, virtual]
 

Called whenever a user's socket is closed.

The details of the exiting user are available to you in the parameter User *user This event is called for all users, registered or not, as a cleanup method for modules which might assign resources to user, such as dns lookups, objects and sockets.

Parameters:
user The user who is disconnecting

Reimplemented from Module.

Definition at line 257 of file m_cgiirc.cpp.

References OnCleanup(), and TYPE_USER.

virtual int ModuleCgiIRC::OnUserRegister User user  )  [inline, virtual]
 

Called whenever a user is about to register their connection (e.g.

before the user is sent the MOTD etc). Modules can use this method if they are performing a function which must be done before the actual connection is completed (e.g. ident lookups, dnsbl lookups, etc). Note that you should NOT delete the user record here by causing a disconnection! Use OnUserConnect for that instead.

Parameters:
user The user registering
Returns:
1 to indicate user quit, 0 to continue

Reimplemented from Module.

Definition at line 263 of file m_cgiirc.cpp.

References CheckIdent(), User::CheckLines(), CheckPass(), User::GetIPString(), User::host, Hosts, IDENT, IDENTFIRST, InspIRCd::Match(), InspIRCd::MatchCIDR(), PASS, PASSFIRST, and WEBIRC.

virtual void ModuleCgiIRC::Prioritize  )  [inline, virtual]
 

Reimplemented from Module.

Definition at line 155 of file m_cgiirc.cpp.

References I_OnUserConnect, InspIRCd::Modules, PRIO_FIRST, Module::ServerInstance, and ModuleManager::SetPriority().


Member Data Documentation

CGIHostlist ModuleCgiIRC::Hosts [private]
 

Definition at line 141 of file m_cgiirc.cpp.

Referenced by ModuleCgiIRC(), OnRehash(), and OnUserRegister().

CommandWebirc* ModuleCgiIRC::mycommand [private]
 

Definition at line 139 of file m_cgiirc.cpp.

Referenced by ModuleCgiIRC().

bool ModuleCgiIRC::NotifyOpers [private]
 

Definition at line 140 of file m_cgiirc.cpp.

Referenced by CheckIdent(), CheckPass(), ModuleCgiIRC(), and OnRehash().


The documentation for this class was generated from the following file: