*
* ---------------------------------------------------
*/
-
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include <vector>
#include "inspircd.h"
/* $ModDesc: A module overriding /list, and making it safe - stop those sendq problems. */
{
private:
std::vector<std::string> allowlist;
- unsigned int WaitTime;
+ time_t WaitTime;
public:
- ModuleSecureList(InspIRCd* Me) : Module::Module(Me)
+ ModuleSecureList(InspIRCd* Me) : Module(Me)
{
OnRehash(NULL,"");
}
{
ConfigReader* MyConf = new ConfigReader(ServerInstance);
allowlist.clear();
- for (int i = 0; i < MyConf->Enumerate("securelist"); i++)
- allowlist.push_back(MyConf->ReadValue("securelist", "exception", i));
+ for (int i = 0; i < MyConf->Enumerate("securehost"); i++)
+ allowlist.push_back(MyConf->ReadValue("securehost", "exception", i));
WaitTime = MyConf->ReadInteger("securelist", "waittime", "60", 0, true);
DELETE(MyConf);
}
if (!validated)
return 0;
- if ((command == "LIST") && (ServerInstance->Time() < (user->signon+WaitTime)) && (!*user->oper))
+ if ((command == "LIST") && (ServerInstance->Time() < (user->signon+WaitTime)) && (!IS_OPER(user)))
{
/* Normally wouldnt be allowed here, are they exempt? */
for (std::vector<std::string>::iterator x = allowlist.begin(); x != allowlist.end(); x++)
};
-
-
-/******************************************************************************************************/
-
-class ModuleSecureListFactory : public ModuleFactory
-{
- public:
- ModuleSecureListFactory()
- {
- }
-
- ~ModuleSecureListFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
- {
- return new ModuleSecureList(Me);
- }
-
-};
-
-extern "C" void * init_module( void )
-{
- return new ModuleSecureListFactory;
-}
+MODULE_INIT(ModuleSecureList)