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

ModuleOperHash Class Reference

Inheritance diagram for ModuleOperHash:

Inheritance graph
[legend]
Collaboration diagram for ModuleOperHash:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleOperHash (InspIRCd *Me)
virtual ~ModuleOperHash ()
virtual void OnLoadModule (Module *mod, const std::string &name)
 Called whenever a module is loaded.
virtual int OnPassCompare (Extensible *ex, const std::string &data, const std::string &input, const std::string &hashtype)
 Called whenever a password check is to be made.
virtual Version GetVersion ()
 Returns the version number of a Module.

Private Attributes

CommandMkpasswdmycommand
hashymodules hashers
std::deque< std::stringnames
bool diduseiface

Detailed Description

Definition at line 71 of file m_password_hash.cpp.


Constructor & Destructor Documentation

ModuleOperHash::ModuleOperHash InspIRCd Me  )  [inline]
 

Definition at line 81 of file m_password_hash.cpp.

References InspIRCd::AddCommand(), ModuleManager::Attach(), diduseiface, ModuleManager::FindInterface(), hashers, I_OnLoadModule, I_OnPassCompare, InspIRCd::Modules, mycommand, names, Module::OnRehash(), Module::ServerInstance, and ModuleManager::UseInterface().

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

Definition at line 118 of file m_password_hash.cpp.

References diduseiface, ModuleManager::DoneWithInterface(), InspIRCd::Modules, and Module::ServerInstance.


Member Function Documentation

virtual Version ModuleOperHash::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 161 of file m_password_hash.cpp.

References API_VERSION, and VF_VENDOR.

virtual void ModuleOperHash::OnLoadModule Module mod,
const std::string name
[inline, virtual]
 

Called whenever a module is loaded.

mod will contain a pointer to the module, and string will contain its name, for example m_widgets.so. This function is primary for dependency checking, your module may decide to enable some extra features if it sees that you have for example loaded "m_killwidgets.so" with "m_makewidgets.so". It is highly recommended that modules do *NOT* bail if they cannot satisfy dependencies, but instead operate under reduced functionality, unless the dependency is absolutely neccessary (e.g. a module that extends the features of another module).

Parameters:
mod A pointer to the new module
name The new module's filename

Reimplemented from Module.

Definition at line 124 of file m_password_hash.cpp.

References DEBUG, diduseiface, hashers, LogManager::Log(), InspIRCd::Logs, ModuleManager::ModuleHasInterface(), InspIRCd::Modules, names, Module::ServerInstance, and ModuleManager::UseInterface().

virtual int ModuleOperHash::OnPassCompare Extensible ex,
const std::string data,
const std::string input,
const std::string hashtype
[inline, virtual]
 

Called whenever a password check is to be made.

Replaces the old OldOperCompare API. The password field (from the config file) is in 'password' and is to be compared against 'input'. This method allows for encryption of passwords (oper, connect:allow, die/restart, etc). You should return a nonzero value to override the normal comparison, or zero to pass it on.

Parameters:
ex The object that's causing the authentication (User* for <oper> <connect:allow> etc, Server* for <link>).
password The password from the configuration file (the password="" value).
input The password entered by the user or whoever.
hashtype The hash value from the config
Returns:
0 to do nothing (pass on to next module/default), 1 == password is OK, -1 == password is not OK

Reimplemented from Module.

Definition at line 140 of file m_password_hash.cpp.

References hashers.


Member Data Documentation

bool ModuleOperHash::diduseiface [private]
 

Definition at line 78 of file m_password_hash.cpp.

Referenced by ModuleOperHash(), OnLoadModule(), and ~ModuleOperHash().

hashymodules ModuleOperHash::hashers [private]
 

Definition at line 75 of file m_password_hash.cpp.

Referenced by ModuleOperHash(), OnLoadModule(), and OnPassCompare().

CommandMkpasswd* ModuleOperHash::mycommand [private]
 

Definition at line 74 of file m_password_hash.cpp.

Referenced by ModuleOperHash().

std::deque<std::string> ModuleOperHash::names [private]
 

Definition at line 76 of file m_password_hash.cpp.

Referenced by ModuleOperHash(), and OnLoadModule().


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