diff options
| author | Adam <Adam@anope.org> | 2017-05-29 12:49:22 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2017-05-29 13:11:16 -0400 |
| commit | 3f143633541a5361bf5b02b0d69b65447aea7b79 (patch) | |
| tree | 3a33bd044bc8936150dcab38f355f3c3726b05e5 /modules/nickserv | |
| parent | e36d24a6c500b5ad921041fcb905f684c09d71e9 (diff) | |
Remove recognized status and secure
Also remove /ns status, which is now almost useless with no recognized
status, and /ns access.
Diffstat (limited to 'modules/nickserv')
| -rw-r--r-- | modules/nickserv/access.cpp | 277 | ||||
| -rw-r--r-- | modules/nickserv/main/account.cpp | 28 | ||||
| -rw-r--r-- | modules/nickserv/main/account.h | 5 | ||||
| -rw-r--r-- | modules/nickserv/main/accounttype.cpp | 1 | ||||
| -rw-r--r-- | modules/nickserv/main/accounttype.h | 2 | ||||
| -rw-r--r-- | modules/nickserv/main/nickserv.cpp | 53 | ||||
| -rw-r--r-- | modules/nickserv/recover.cpp | 6 | ||||
| -rw-r--r-- | modules/nickserv/set.cpp | 98 | ||||
| -rw-r--r-- | modules/nickserv/status.cpp | 96 |
9 files changed, 24 insertions, 542 deletions
diff --git a/modules/nickserv/access.cpp b/modules/nickserv/access.cpp deleted file mode 100644 index f0116d95c..000000000 --- a/modules/nickserv/access.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Anope IRC Services - * - * Copyright (C) 2003-2017 Anope Team <team@anope.org> - * - * This file is part of Anope. Anope is free software; you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License as published by the Free Software - * Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see see <http://www.gnu.org/licenses/>. - */ - -#include "module.h" -#include "modules/nickserv.h" -#include "modules/nickserv/access.h" - -class NickAccessImpl : public NickAccess -{ - friend class NickAccessType; - - Serialize::Storage<NickServ::Account *> account; - Serialize::Storage<Anope::string> mask; - - public: - using NickAccess::NickAccess; - - NickServ::Account *GetAccount() override; - void SetAccount(NickServ::Account *) override; - - Anope::string GetMask() override; - void SetMask(const Anope::string &) override; -}; - -class NickAccessType : public Serialize::Type<NickAccessImpl> -{ - public: - Serialize::ObjectField<NickAccessImpl, NickServ::Account *> account; - Serialize::Field<NickAccessImpl, Anope::string> mask; - - NickAccessType(Module *creator) : Serialize::Type<NickAccessImpl>(creator) - , account(this, "account", &NickAccessImpl::account, true) - , mask(this, "mask", &NickAccessImpl::mask) - { - } -}; - -NickServ::Account *NickAccessImpl::GetAccount() -{ - return Get(&NickAccessType::account); -} - -void NickAccessImpl::SetAccount(NickServ::Account *acc) -{ - Set(&NickAccessType::account, acc); -} - -Anope::string NickAccessImpl::GetMask() -{ - return Get(&NickAccessType::mask); -} - -void NickAccessImpl::SetMask(const Anope::string &m) -{ - Set(&NickAccessType::mask, m); -} - -class CommandNSAccess : public Command -{ - private: - void DoAdd(CommandSource &source, NickServ::Account *nc, const Anope::string &mask) - { - if (mask.empty()) - { - this->OnSyntaxError(source, "ADD"); - return; - } - - if (Anope::ReadOnly) - { - source.Reply(_("Services are in read-only mode.")); - return; - } - - std::vector<NickAccess *> access = nc->GetRefs<NickAccess *>(); - - if (access.size() >= Config->GetModule(this->GetOwner())->Get<unsigned>("accessmax", "32")) - { - source.Reply(_("Sorry, the maximum of \002{0}\002 access entries has been reached."), Config->GetModule(this->GetOwner())->Get<unsigned>("accessmax")); - return; - } - - for (NickAccess *a : access) - if (a->GetMask().equals_ci(mask)) - { - source.Reply(_("Mask \002{0}\002 already present on the access list of \002{1}\002."), mask, nc->GetDisplay()); - return; - } - - NickAccess *a = Serialize::New<NickAccess *>(); - a->SetAccount(nc); - a->SetMask(mask); - - logger.Command(nc == source.GetAccount() ? LogType::COMMAND : LogType::ADMIN, source, _("{source} used {command} to add mask {0} to {1}"), mask, nc->GetDisplay()); - source.Reply(_("\002{0}\002 added to the access list of \002{1}\002."), mask, nc->GetDisplay()); - } - - void DoDel(CommandSource &source, NickServ::Account *nc, const Anope::string &mask) - { - if (mask.empty()) - { - this->OnSyntaxError(source, "DEL"); - return; - } - - if (Anope::ReadOnly) - { - source.Reply(_("Services are in read-only mode.")); - return; - } - - for (NickAccess *a : nc->GetRefs<NickAccess *>()) - if (a->GetMask().equals_ci(mask)) - { - a->Delete(); - logger.Command(nc == source.GetAccount() ? LogType::COMMAND : LogType::ADMIN, source, - _("{source} used {command} to delete mask {0} from {1}"), - mask, nc->GetDisplay()); - source.Reply(_("\002{0}\002 deleted from the access list of \002{1}\002."), mask, nc->GetDisplay()); - return; - } - - - source.Reply(_("\002{0}\002 not found on the access list of \002{1}\002."), mask, nc->GetDisplay()); - } - - void DoList(CommandSource &source, NickServ::Account *nc, const Anope::string &mask) - { - std::vector<NickAccess *> access = nc->GetRefs<NickAccess *>(); - if (access.empty()) - { - source.Reply(_("The access list of \002{0}\002 is empty."), nc->GetDisplay()); - return; - } - - source.Reply(_("Access list for \002{0}\002:"), nc->GetDisplay()); - for (NickAccess *a : access) - { - if (!mask.empty() && !Anope::Match(a->GetMask(), mask)) - continue; - - source.Reply(" {0}", a->GetMask()); - } - } - public: - CommandNSAccess(Module *creator) : Command(creator, "nickserv/access", 1, 3) - { - this->SetDesc(_("Modify the list of authorized addresses")); - this->SetSyntax(_("ADD [\037nickname\037] \037mask\037")); - this->SetSyntax(_("DEL [\037nickname\037] \037mask\037")); - this->SetSyntax(_("LIST [\037nickname\037]")); - } - - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override - { - const Anope::string &cmd = params[0]; - Anope::string nick, mask; - - if (cmd.equals_ci("LIST")) - nick = params.size() > 1 ? params[1] : ""; - else - { - nick = params.size() == 3 ? params[1] : ""; - mask = params.size() > 1 ? params[params.size() - 1] : ""; - } - - NickServ::Account *nc; - if (!nick.empty() && source.HasPriv("nickserv/access")) - { - NickServ::Nick *na = NickServ::FindNick(nick); - if (na == NULL) - { - source.Reply(_("\002{0}\002 isn't registered."), nick); - return; - } - - if (Config->GetModule("nickserv/main")->Get<bool>("secureadmins", "yes") && source.GetAccount() != na->GetAccount() && na->GetAccount()->GetOper() && !cmd.equals_ci("LIST")) - { - source.Reply(_("You may view but not modify the access list of other Services Operators.")); - return; - } - - nc = na->GetAccount(); - } - else - { - nc = source.nc; - } - - if (!mask.empty() && (mask.find('@') == Anope::string::npos || mask.find('!') != Anope::string::npos)) - { - source.Reply(_("Mask must be in the form \037user\037@\037host\037.")); - source.Reply(_("\002%s%s HELP %s\002 for more information."), Config->StrictPrivmsg, source.service->nick, source.GetCommand()); // XXX - return; - } - - if (cmd.equals_ci("LIST")) - return this->DoList(source, nc, mask); - else if (nc->HasFieldS("NS_SUSPENDED")) - source.Reply(_("\002{0}\002 is suspended."), nc->GetDisplay()); - else if (cmd.equals_ci("ADD")) - return this->DoAdd(source, nc, mask); - else if (cmd.equals_ci("DEL")) - return this->DoDel(source, nc, mask); - else - this->OnSyntaxError(source, ""); - } - - bool OnHelp(CommandSource &source, const Anope::string &subcommand) override - { - source.Reply(_("Modifies or displays the access list for your account." - " The access list is a list of addresses that {1} uses to recognize you." - " If you match one of the hosts on the access list, services will not force you to change your nickname if the \002KILL\002 option is set." - " Furthermore, if the \002SECURE\002 option is disabled, services will recognize you just based on your hostmask, without having to supply a password." - " To gain access to channels when only recognized by your hostmask, the channel must too have the \002SECURE\002 option off." - " Services Operators may provide \037nickname\037 to modify other user's access lists.\n" - "\n" - "Examples:\n" - " \n" - " {command} ADD anyone@*.bepeg.com\n" - " Allows access to user \"anyone\" from any machine in the \"bepeg.com\" domain.\n" - "\n" - " {command} DEL anyone@*.bepeg.com\n" - " Reverses the previous command.\n" - "\n" - " {command} LIST\n" - " Displays the current access list."), - source.GetCommand(), source.service->nick); - return true; - } -}; - -class NSAccess : public Module - , public EventHook<NickServ::Event::NickRegister> -{ - CommandNSAccess commandnsaccess; - NickAccessType nick_type; - - public: - NSAccess(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<NickServ::Event::NickRegister>(this) - , commandnsaccess(this) - , nick_type(this) - { - } - - void OnNickRegister(User *u, NickServ::Nick *na, const Anope::string &) override - { - if (u && Config->GetModule(this)->Get<bool>("addaccessonreg")) - { - NickAccess *a = Serialize::New<NickAccess *>(); - a->SetAccount(na->GetAccount()); - a->SetMask(u->WildMask()); - - u->SendMessage(Config->GetClient("NickServ"), - _("\002{0}\002 has been registered under your hostmask: \002{1}\002"), na->GetNick(), a->GetMask()); - } - } -}; - -MODULE_INIT(NSAccess) diff --git a/modules/nickserv/main/account.cpp b/modules/nickserv/main/account.cpp index 0ff20420b..9c3275cbe 100644 --- a/modules/nickserv/main/account.cpp +++ b/modules/nickserv/main/account.cpp @@ -19,7 +19,6 @@ #include "module.h" #include "accounttype.h" -#include "modules/nickserv/access.h" AccountImpl::~AccountImpl() { @@ -187,16 +186,6 @@ void AccountImpl::SetMsg(bool msg) Set(&AccountType::msg, msg); } -bool AccountImpl::IsSecure() -{ - return Get(&AccountType::secure); -} - -void AccountImpl::SetSecure(bool secure) -{ - Set(&AccountType::secure, secure); -} - bool AccountImpl::IsMemoSignon() { return Get(&AccountType::memosignon); @@ -288,23 +277,6 @@ void AccountImpl::SetDisplay(NickServ::Nick *na) nc = this; } -bool AccountImpl::IsOnAccess(User *u) -{ - Anope::string buf = u->GetIdent() + "@" + u->host, buf2, buf3; - if (!u->vhost.empty()) - buf2 = u->GetIdent() + "@" + u->vhost; - if (!u->GetCloakedHost().empty()) - buf3 = u->GetIdent() + "@" + u->GetCloakedHost(); - - for (NickAccess *access : GetRefs<NickAccess *>()) - { - Anope::string a = access->GetMask(); - if (Anope::Match(buf, a) || (!buf2.empty() && Anope::Match(buf2, a)) || (!buf3.empty() && Anope::Match(buf3, a))) - return true; - } - return false; -} - unsigned int AccountImpl::GetChannelCount() { unsigned int i = 0; diff --git a/modules/nickserv/main/account.h b/modules/nickserv/main/account.h index 8f8b0e123..39424faf3 100644 --- a/modules/nickserv/main/account.h +++ b/modules/nickserv/main/account.h @@ -34,7 +34,6 @@ class AccountImpl : public NickServ::Account Serialize::Storage<bool> killquick; Serialize::Storage<bool> killimmed; Serialize::Storage<bool> msg; - Serialize::Storage<bool> secure; Serialize::Storage<bool> memosignon, memoreceive, memomail; Serialize::Storage<bool> hideemail, hidemask, hidestatus, hidequit; Serialize::Storage<time_t> lastmail; @@ -88,9 +87,6 @@ class AccountImpl : public NickServ::Account bool IsMsg() override; void SetMsg(bool) override; - bool IsSecure() override; - void SetSecure(bool) override; - bool IsMemoSignon() override; void SetMemoSignon(bool) override; @@ -115,7 +111,6 @@ class AccountImpl : public NickServ::Account MemoServ::MemoInfo *GetMemos() override; void SetDisplay(NickServ::Nick *na) override; - bool IsOnAccess(User *u) override; unsigned int GetChannelCount() override; time_t GetLastMail() override; diff --git a/modules/nickserv/main/accounttype.cpp b/modules/nickserv/main/accounttype.cpp index 4c951a698..0f4ebbd16 100644 --- a/modules/nickserv/main/accounttype.cpp +++ b/modules/nickserv/main/accounttype.cpp @@ -35,7 +35,6 @@ AccountType::AccountType(Module *me) : Serialize::Type<AccountImpl>(me) , killquick(this, "killquick", &AccountImpl::killquick) , killimmed(this, "killimmed", &AccountImpl::killimmed) , msg(this, "msg", &AccountImpl::msg) - , secure(this, "secure", &AccountImpl::secure) , memosignon(this, "memo_signon", &AccountImpl::memosignon) , memoreceive(this, "memo_receive", &AccountImpl::memoreceive) , memomail(this, "memo_mail", &AccountImpl::memomail) diff --git a/modules/nickserv/main/accounttype.h b/modules/nickserv/main/accounttype.h index 6fa1bbaa3..1a6ab37cd 100644 --- a/modules/nickserv/main/accounttype.h +++ b/modules/nickserv/main/accounttype.h @@ -37,7 +37,7 @@ class AccountType : public Serialize::Type<AccountImpl> Serialize::ObjectField<AccountImpl, Oper *> oper; Serialize::Field<AccountImpl, Anope::string> greet; Serialize::Field<AccountImpl, bool> unconfirmed, _private, autoop, keepmodes, - killprotect, killquick, killimmed, msg, secure, memosignon, memoreceive, + killprotect, killquick, killimmed, msg, memosignon, memoreceive, memomail, hideemail, hidemask, hidestatus, hidequit; Serialize::Field<AccountImpl, time_t> last_mail; diff --git a/modules/nickserv/main/nickserv.cpp b/modules/nickserv/main/nickserv.cpp index ba20a0108..ab6a06af3 100644 --- a/modules/nickserv/main/nickserv.cpp +++ b/modules/nickserv/main/nickserv.cpp @@ -244,45 +244,32 @@ class NickServCore : public Module, public NickServ::NickServService if (MOD_RESULT == EVENT_ALLOW) return; - if (!na->GetAccount()->IsSecure() && u->IsRecognized()) - { - na->SetLastSeen(Anope::CurTime); - na->SetLastUsermask(u->GetIdent() + "@" + u->GetDisplayedHost()); - na->SetLastRealname(u->realname); + if (Config->GetModule("nickserv/main")->Get<bool>("nonicknameownership")) return; - } - if (Config->GetModule("nickserv/main")->Get<bool>("nonicknameownership")) + if (!na->GetAccount()->IsKillProtect()) return; - bool on_access = u->IsRecognized(false); + if (na->GetAccount()->IsKillImmed()) + { + u->SendMessage(*NickServ, _("This nickname has been registered; you may not use it.")); + this->Collide(u, na); + return; + } + + u->SendMessage(*NickServ, _("This nickname is registered. If this is your nickname, type \002{0}{1} IDENTIFY \037password\037\002. Otherwise, please choose a different nickname."), Config->StrictPrivmsg, NickServ->nick); // XXX - if (on_access || !na->GetAccount()->IsKillImmed()) + if (na->GetAccount()->IsKillQuick()) { - if (na->GetAccount()->IsSecure()) - u->SendMessage(*NickServ, _("This nickname is registered and protected. If this is your nickname, type \002{0}{1} IDENTIFY \037password\037\002. Otherwise, please choose a different nickname."), Config->StrictPrivmsg, NickServ->nick); // XXX - else - u->SendMessage(*NickServ, _("This nickname is owned by someone else. If this is your nickname, type \002{0}{1} IDENTIFY \037password\037\002. Otherwise, please choose a different nickname."), Config->StrictPrivmsg, NickServ->nick); // XXX + time_t killquick = Config->GetModule("nickserv/main")->Get<time_t>("killquick", "20s"); + u->SendMessage(*NickServ, _("If you do not change within {0}, I will change your nick."), Anope::Duration(killquick, u->Account())); + new NickServCollide(this, this, u, na, killquick); } - if (na->GetAccount()->IsKillProtect() && !on_access) + else { - if (na->GetAccount()->IsKillImmed()) - { - u->SendMessage(*NickServ, _("This nickname has been registered; you may not use it.")); - this->Collide(u, na); - } - else if (na->GetAccount()->IsKillQuick()) - { - time_t killquick = Config->GetModule("nickserv/main")->Get<time_t>("killquick", "20s"); - u->SendMessage(*NickServ, _("If you do not change within %s, I will change your nick."), Anope::Duration(killquick, u->Account()).c_str()); - new NickServCollide(this, this, u, na, killquick); - } - else - { - time_t kill = Config->GetModule("nickserv/main")->Get<time_t>("kill", "60s"); - u->SendMessage(*NickServ, _("If you do not change within %s, I will change your nick."), Anope::Duration(kill, u->Account()).c_str()); - new NickServCollide(this, this, u, na, kill); - } + time_t kill = Config->GetModule("nickserv/main")->Get<time_t>("kill", "60s"); + u->SendMessage(*NickServ, _("If you do not change within {0}, I will change your nick."), Anope::Duration(kill, u->Account())); + new NickServCollide(this, this, u, na, kill); } } @@ -626,7 +613,7 @@ class NickServCore : public Module, public NickServ::NickServService /* Update last quit and last seen for the user */ NickServ::Nick *na = NickServ::FindNick(u->nick); - if (na && !na->GetAccount()->HasFieldS("NS_SUSPENDED") && (u->IsRecognized() || u->IsIdentified(true))) + if (na && !na->GetAccount()->HasFieldS("NS_SUSPENDED") && u->IsIdentified(true)) { na->SetLastSeen(Anope::CurTime); na->SetLastQuit(msg); @@ -643,7 +630,7 @@ class NickServCore : public Module, public NickServ::NickServService for (NickServ::Nick *na : Serialize::GetObjects<NickServ::Nick *>()) { User *u = User::Find(na->GetNick(), true); - if (u && (u->IsIdentified(true) || u->IsRecognized())) + if (u && u->IsIdentified(true)) na->SetLastSeen(Anope::CurTime); bool expire = false; diff --git a/modules/nickserv/recover.cpp b/modules/nickserv/recover.cpp index f18c78379..91ce7639d 100644 --- a/modules/nickserv/recover.cpp +++ b/modules/nickserv/recover.cpp @@ -66,7 +66,7 @@ class NSRecoverRequestListener : public NickServ::IdentifyRequestListener // same person that is executing the command, so kill them off (old GHOST command). else if (u->Account() == na->GetAccount()) { - if (!source.GetAccount() && na->GetAccount()->IsSecure()) + if (!source.GetAccount()) { source.GetUser()->Login(u->Account()); cmd->logger.Command(LogType::COMMAND, source, _("{source} used {command} and was automatically identified to {0}"), u->Account()->GetDisplay()); @@ -97,7 +97,7 @@ class NSRecoverRequestListener : public NickServ::IdentifyRequestListener /* User is not identified or not identified to the same account as the person using this command */ else { - if (!source.GetAccount() && na->GetAccount()->IsSecure()) + if (!source.GetAccount()) { source.GetUser()->Login(na->GetAccount()); // Identify the user using the command if they arent identified cmd->logger.Command(LogType::COMMAND, source, _("{source} used {command} and was automatically identified to {0} ({1})"), na->GetNick(), na->GetAccount()->GetDisplay()); @@ -193,8 +193,6 @@ class CommandNSRecover : public Command bool ok = false; if (source.GetAccount() == na->GetAccount()) ok = true; - else if (!na->GetAccount()->IsSecure() && source.GetUser() && na->GetAccount()->IsOnAccess(source.GetUser())) - ok = true; if (certservice && source.GetUser() && certservice->Matches(source.GetUser(), na->GetAccount())) ok = true; diff --git a/modules/nickserv/set.cpp b/modules/nickserv/set.cpp index f712611a7..33882f110 100644 --- a/modules/nickserv/set.cpp +++ b/modules/nickserv/set.cpp @@ -719,7 +719,7 @@ class CommandNSSetKill : public Command "\n" "If you select \002QUICK\002, the user will be given only {1} to change their nick instead {0}." " If you select \002IMMED\002, the user's nickname will be changed immediately \037without\037 being warned first or given a chance to change their nick." - " With this set, the only way to use the nickname is to match an entry on the account's access list.")); + " With this set, the only way to use the nickname is to login to ihe account while not using the nickname (like via SASL).")); return true; } }; @@ -961,95 +961,6 @@ class CommandNSSASetMessage : public CommandNSSetMessage } }; -class CommandNSSetSecure : public Command -{ - public: - CommandNSSetSecure(Module *creator, const Anope::string &sname = "nickserv/set/secure", size_t min = 1) : Command(creator, sname, min, min + 1) - { - this->SetDesc(_("Turn nickname security on or off")); - this->SetSyntax("{ON | OFF}"); - } - - void Run(CommandSource &source, const Anope::string &user, const Anope::string ¶m) - { - if (Anope::ReadOnly) - { - source.Reply(_("Services are in read-only mode.")); - return; - } - - NickServ::Nick *na = NickServ::FindNick(user); - if (!na) - { - source.Reply(_("\002{0}\002 isn't registered."), user); - return; - } - NickServ::Account *nc = na->GetAccount(); - - EventReturn MOD_RESULT; - MOD_RESULT = EventManager::Get()->Dispatch(&Event::SetNickOption::OnSetNickOption, source, this, nc, param); - if (MOD_RESULT == EVENT_STOP) - return; - - if (param.equals_ci("ON")) - { - logger.Command(nc == source.GetAccount() ? LogType::COMMAND : LogType::ADMIN, source, _("{source} used {command} to enable {0} for {1}"), - "SECURE", nc->GetDisplay()); - nc->SetSecure(true); - source.Reply(_("Secure option is now \002on\002 for \002{0}\002."), nc->GetDisplay()); - } - else if (param.equals_ci("OFF")) - { - logger.Command(nc == source.GetAccount() ? LogType::COMMAND : LogType::ADMIN, source, _("{source} used {command} to disable {0} for {1}"), - "SECURE", nc->GetDisplay()); - nc->SetSecure(false); - source.Reply(_("Secure option is now \002off\002 for \002{0}\002."), nc->GetDisplay()); - } - else - { - this->OnSyntaxError(source, "SECURE"); - } - } - - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override - { - this->Run(source, source.nc->GetDisplay(), params[0]); - } - - bool OnHelp(CommandSource &source, const Anope::string &) override - { - source.Reply(_("Turns the security feature on or off for your account." - " With \002SECURE\002 set, you must enter your password before you will be recognized as the owner of the account," - " regardless of whether your address is on the access list or not." - " However, if you are on the access list, services will not force you to change your nickname, regardless of the setting of the \002kill\002 option.")); - return true; - } -}; - -class CommandNSSASetSecure : public CommandNSSetSecure -{ - public: - CommandNSSASetSecure(Module *creator) : CommandNSSetSecure(creator, "nickserv/saset/secure", 2) - { - this->ClearSyntax(); - this->SetSyntax(_("\037account\037 {ON | OFF}")); - } - - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override - { - this->Run(source, params[0], params[1]); - } - - bool OnHelp(CommandSource &source, const Anope::string &) override - { - source.Reply(_("Turns the security feature on or off for \037account\037." - " With \002SECURE\002 set, you the user must enter their password before they will be recognized as the owner of the account," - " regardless of whether their address address is on the access list or not." - " However, if they are on the access list, services will not force them to change your nickname, regardless of the setting of the \002kill\002 option.")); - return true; - } -}; - class CommandNSSASetNoexpire : public Command { public: @@ -1142,9 +1053,6 @@ class NSSet : public Module CommandNSSetPassword commandnssetpassword; CommandNSSASetPassword commandnssasetpassword; - CommandNSSetSecure commandnssetsecure; - CommandNSSASetSecure commandnssasetsecure; - CommandNSSASetNoexpire commandnssasetnoexpire; /* email, passcode */ @@ -1178,8 +1086,6 @@ class NSSet : public Module , commandnssasetmessage(this) , commandnssetpassword(this) , commandnssasetpassword(this) - , commandnssetsecure(this) - , commandnssasetsecure(this) , commandnssasetnoexpire(this) , ns_set_email(this, "ns_set_email") @@ -1236,8 +1142,6 @@ class NSSet : public Module info.AddOption(_("Quick protection")); else if (na->GetAccount()->IsKillProtect()) info.AddOption(_("Protection")); - if (na->GetAccount()->IsSecure()) - info.AddOption(_("Security")); if (na->GetAccount()->IsMsg()) info.AddOption(_("Message mode")); if (na->GetAccount()->IsAutoOp()) diff --git a/modules/nickserv/status.cpp b/modules/nickserv/status.cpp deleted file mode 100644 index 9c68f2949..000000000 --- a/modules/nickserv/status.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Anope IRC Services - * - * Copyright (C) 2003-2017 Anope Team <team@anope.org> - * - * This file is part of Anope. Anope is free software; you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License as published by the Free Software - * Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see see <http://www.gnu.org/licenses/>. - */ - -#include "module.h" - -class CommandNSStatus : public Command -{ - public: - CommandNSStatus(Module *creator) : Command(creator, "nickserv/status", 0, 16) - { - this->SetDesc(_("Returns the owner status of the given nickname")); - this->SetSyntax(_("[\037nickname\037]")); - this->AllowUnregistered(true); - } - - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override - { - const Anope::string &nick = !params.empty() ? params[0] : source.GetNick(); - const NickServ::Nick *na = NickServ::FindNick(nick); - spacesepstream sep(nick); - Anope::string nickbuf; - -#warning "this is all disabled" - while (sep.GetToken(nickbuf)) - { - #if 0 - User *u2 = User::Find(nickbuf, true); - if (!u2) /* Nick is not online */ - source.Reply("STATUS %s %d %s", nickbuf.c_str(), 0, ""); - else if (u2->IsIdentified() && na && na->GetAccount() == u2->Account()) /* Nick is identified */ - source.Reply("STATUS %s %d %s", nickbuf.c_str(), 3, u2->Account()->GetDisplay().c_str()); - else if (u2->IsRecognized()) /* Nick is recognised, but NOT identified */ - source.Reply("STATUS %s %d %s", nickbuf.c_str(), 2, u2->Account() ? u2->Account()->GetDisplay().c_str() : ""); - else if (!na) /* Nick is online, but NOT a registered */ - source.Reply("STATUS %s %d %s", nickbuf.c_str(), 0, ""); - else - /* Nick is not identified for the nick, but they could be logged into an account, - * so we tell the user about it - */ - source.Reply("STATUS %s %d %s", nickbuf.c_str(), 1, u2->Account() ? u2->Account()->GetDisplay().c_str() : ""); - #endif - } - } - - bool OnHelp(CommandSource &source, const Anope::string &subcommand) override - { - this->SendSyntax(source); - source.Reply(" "); - source.Reply(_("Returns whether the user using the given nickname is\n" - "recognized as the owner of the nickname. The response has\n" - "this format:\n" - " \n" - " \037nickname\037 \037status-code\037 \037account\037\n" - " \n" - "where \037nickname\037 is the nickname sent with the command,\n" - "\037status-code\037 is one of the following, and \037account\037\n" - "is the account they are logged in as.\n" - " \n" - " 0 - no such user online \002or\002 nickname not registered\n" - " 1 - user not recognized as nickname's owner\n" - " 2 - user recognized as owner via access list only\n" - " 3 - user recognized as owner via password identification\n" - " \n" - "If no nickname is given, your status will be returned.")); - return true; - } -}; - -class NSStatus : public Module -{ - CommandNSStatus commandnsstatus; - - public: - NSStatus(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , commandnsstatus(this) - { - } -}; - -MODULE_INIT(NSStatus) |
