diff options
| author | Adam <Adam@anope.org> | 2011-05-23 14:47:14 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-05-23 14:47:14 -0400 |
| commit | a45d1555d3f4751f4d42576a93640bc251c1dfe1 (patch) | |
| tree | 552c5da8ac6562a05409da5f0af437aaaf96f2c3 /modules/core | |
| parent | 121ae0b189361141a5c4ae731556357c903b2723 (diff) | |
Added an IsServicesOper event
Diffstat (limited to 'modules/core')
| -rw-r--r-- | modules/core/os_login.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
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<User *>::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; } }; |
