From a45d1555d3f4751f4d42576a93640bc251c1dfe1 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 23 May 2011 14:47:14 -0400 Subject: Added an IsServicesOper event --- modules/core/os_login.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'modules/core') diff --git a/modules/core/os_login.cpp b/modules/core/os_login.cpp index dc9be1f37..4ff97da1f 100644 --- a/modules/core/os_login.cpp +++ b/modules/core/os_login.cpp @@ -78,6 +78,26 @@ class OSLogin : public Module throw ModuleException("OperServ is not loaded!"); this->AddCommand(operserv->Bot(), &commandoslogin); + + ModuleManager::Attach(I_IsServicesOper, this); + } + + ~OSLogin() + { + for (Anope::insensitive_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it) + it->second->Shrink("os_login_password_correct"); + } + + EventReturn IsServicesOper(User *u) + { + if (!u->Account()->o->password.empty()) + { + if (u->GetExt("os_login_password_correct")) + return EVENT_ALLOW; + return EVENT_STOP; + } + + return EVENT_CONTINUE; } }; -- cgit