summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-05-29 12:49:22 -0400
committerAdam <Adam@anope.org>2017-05-29 13:11:16 -0400
commit3f143633541a5361bf5b02b0d69b65447aea7b79 (patch)
tree3a33bd044bc8936150dcab38f355f3c3726b05e5 /modules
parente36d24a6c500b5ad921041fcb905f684c09d71e9 (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')
-rw-r--r--modules/chanserv/main/channel.cpp16
-rw-r--r--modules/chanserv/main/channel.h4
-rw-r--r--modules/chanserv/main/channeltype.cpp1
-rw-r--r--modules/chanserv/main/channeltype.h2
-rw-r--r--modules/chanserv/set.cpp71
-rw-r--r--modules/database/flatfile.cpp5
-rw-r--r--modules/database/old.cpp11
-rw-r--r--modules/nickserv/access.cpp277
-rw-r--r--modules/nickserv/main/account.cpp28
-rw-r--r--modules/nickserv/main/account.h5
-rw-r--r--modules/nickserv/main/accounttype.cpp1
-rw-r--r--modules/nickserv/main/accounttype.h2
-rw-r--r--modules/nickserv/main/nickserv.cpp53
-rw-r--r--modules/nickserv/recover.cpp6
-rw-r--r--modules/nickserv/set.cpp98
-rw-r--r--modules/nickserv/status.cpp96
-rw-r--r--modules/webcpanel/pages/chanserv/set.cpp8
-rw-r--r--modules/webcpanel/pages/nickserv/access.cpp53
-rw-r--r--modules/webcpanel/pages/nickserv/access.h37
-rw-r--r--modules/webcpanel/pages/nickserv/info.cpp7
-rw-r--r--modules/webcpanel/templates/default/chanserv/set.html4
-rw-r--r--modules/webcpanel/templates/default/nickserv/info.html4
-rw-r--r--modules/webcpanel/webcpanel.cpp8
-rw-r--r--modules/webcpanel/webcpanel.h1
24 files changed, 34 insertions, 764 deletions
diff --git a/modules/chanserv/main/channel.cpp b/modules/chanserv/main/channel.cpp
index b9e519427..5f7c71c8c 100644
--- a/modules/chanserv/main/channel.cpp
+++ b/modules/chanserv/main/channel.cpp
@@ -247,16 +247,6 @@ void ChannelImpl::SetRestricted(bool restricted)
Set(&ChannelType::restricted, restricted);
}
-bool ChannelImpl::IsSecure()
-{
- return Get(&ChannelType::secure);
-}
-
-void ChannelImpl::SetSecure(bool secure)
-{
- Set(&ChannelType::secure, secure);
-}
-
bool ChannelImpl::IsSecureOps()
{
return Get(&ChannelType::secureops);
@@ -370,12 +360,6 @@ ChanServ::AccessGroup ChannelImpl::AccessFor(const User *u, bool updateLastUsed)
return group;
NickServ::Account *nc = u->Account();
- if (nc == NULL && !this->IsSecure() && u->IsRecognized())
- {
- NickServ::Nick *na = NickServ::FindNick(u->nick);
- if (na != NULL)
- nc = na->GetAccount();
- }
group.super_admin = u->super_admin;
group.founder = IsFounder(u);
diff --git a/modules/chanserv/main/channel.h b/modules/chanserv/main/channel.h
index cd419b351..eebddf91b 100644
--- a/modules/chanserv/main/channel.h
+++ b/modules/chanserv/main/channel.h
@@ -35,7 +35,6 @@ class ChannelImpl : public ChanServ::Channel
Serialize::Storage<bool> peace;
Serialize::Storage<bool> securefounder;
Serialize::Storage<bool> restricted;
- Serialize::Storage<bool> secure;
Serialize::Storage<bool> secureops;
Serialize::Storage<bool> signkick;
Serialize::Storage<bool> signkicklevel;
@@ -110,9 +109,6 @@ class ChannelImpl : public ChanServ::Channel
bool IsRestricted() override;
void SetRestricted(bool) override;
- bool IsSecure() override;
- void SetSecure(bool) override;
-
bool IsSecureOps() override;
void SetSecureOps(bool) override;
diff --git a/modules/chanserv/main/channeltype.cpp b/modules/chanserv/main/channeltype.cpp
index 8e5c10b48..ca74263cd 100644
--- a/modules/chanserv/main/channeltype.cpp
+++ b/modules/chanserv/main/channeltype.cpp
@@ -39,7 +39,6 @@ ChannelType::ChannelType(Module *me) : Serialize::Type<ChannelImpl>(me)
, peace(this, "peace", &ChannelImpl::peace)
, securefounder(this, "securefounder", &ChannelImpl::securefounder)
, restricted(this, "restricted", &ChannelImpl::restricted)
- , secure(this, "secure", &ChannelImpl::secure)
, secureops(this, "secureops", &ChannelImpl::secureops)
, signkick(this, "signkick", &ChannelImpl::signkick)
, signkicklevel(this, "signkicklevel", &ChannelImpl::signkicklevel)
diff --git a/modules/chanserv/main/channeltype.h b/modules/chanserv/main/channeltype.h
index 1e10f01ea..af4bc6cc9 100644
--- a/modules/chanserv/main/channeltype.h
+++ b/modules/chanserv/main/channeltype.h
@@ -48,7 +48,7 @@ class ChannelType : public Serialize::Type<ChannelImpl>
Serialize::ObjectField<ChannelImpl, BotInfo *> servicebot;
Serialize::Field<ChannelImpl, bool> greet, fantasy, noautoop, peace, securefounder,
- restricted, secure, secureops, signkick, signkicklevel, noexpire, keepmodes,
+ restricted, secureops, signkick, signkicklevel, noexpire, keepmodes,
persist, topiclock, keeptopic, _private;
ChannelType(Module *);
diff --git a/modules/chanserv/set.cpp b/modules/chanserv/set.cpp
index 0dbb8c65c..b35d3ae51 100644
--- a/modules/chanserv/set.cpp
+++ b/modules/chanserv/set.cpp
@@ -702,73 +702,6 @@ class CommandCSSetRestricted : public Command
}
};
-class CommandCSSetSecure : public Command
-{
- public:
- CommandCSSetSecure(Module *creator, const Anope::string &cname = "chanserv/set/secure") : Command(creator, cname, 2, 2)
- {
- this->SetDesc(_("Activate security features"));
- this->SetSyntax(_("\037channel\037 {ON | OFF}"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
- {
- const Anope::string &chan = params[0];
- const Anope::string &param = params[1];
-
- if (Anope::ReadOnly)
- {
- source.Reply(_("Services are in read-only mode."));
- return;
- }
-
- ChanServ::Channel *ci = ChanServ::Find(chan);
- if (ci == NULL)
- {
- source.Reply(_("Channel \002{0}\002 isn't registered."), chan);
- return;
- }
-
- EventReturn MOD_RESULT;
- MOD_RESULT = EventManager::Get()->Dispatch(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, param);
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasOverridePriv("chanserv/administration"))
- {
- source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName());
- return;
- }
-
- if (param.equals_ci("ON"))
- {
- logger.Command(source, ci, _("{source} used {command} on {channel} to enable secure"));
-
- ci->SetSecure(true);
- source.Reply(_("Secure option for \002{0}\002 is now \002on\002."), ci->GetName());
- }
- else if (param.equals_ci("OFF"))
- {
- logger.Command(source, ci, _("{source} used {command} on {channel} to disable secure"));
-
- ci->SetSecure(false);
- source.Reply(_("Secure option for \002{0}\002 is now \002off\002."), ci->GetName());
- }
- else
- {
- this->OnSyntaxError(source, "SECURE");
- }
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) override
- {
- source.Reply(_("Enables or disables security features for a channel."
- " When \002secure\002 is set, only users who have logged in (eg. not recognized based on their hostmask)"
- " will be given access to channels from account-based access entries"));
- return true;
- }
-};
-
class CommandCSSetSecureFounder : public Command
{
public:
@@ -1143,7 +1076,6 @@ class CSSet : public Module
CommandCSSetPeace commandcssetpeace;
CommandCSSetPersist commandcssetpersist;
CommandCSSetRestricted commandcssetrestricted;
- CommandCSSetSecure commandcssetsecure;
CommandCSSetSecureFounder commandcssetsecurefounder;
CommandCSSetSecureOps commandcssetsecureops;
CommandCSSetSignKick commandcssetsignkick;
@@ -1176,7 +1108,6 @@ class CSSet : public Module
, commandcssetpeace(this)
, commandcssetpersist(this)
, commandcssetrestricted(this)
- , commandcssetsecure(this)
, commandcssetsecurefounder(this)
, commandcssetsecureops(this)
, commandcssetsignkick(this)
@@ -1301,8 +1232,6 @@ class CSSet : public Module
info.AddOption(_("Peace"));
if (ci->IsRestricted())
info.AddOption(_("Restricted access"));
- if (ci->IsSecure())
- info.AddOption(_("Security"));
if (ci->IsSecureFounder())
info.AddOption(_("Secure founder"));
if (ci->IsSecureOps())
diff --git a/modules/database/flatfile.cpp b/modules/database/flatfile.cpp
index 5c0f43108..9cdc0bff4 100644
--- a/modules/database/flatfile.cpp
+++ b/modules/database/flatfile.cpp
@@ -24,7 +24,6 @@
#include "modules/chanserv/log.h"
#include "modules/chanserv/set_misc.h"
#include "modules/chanserv/suspend.h"
-#include "modules/nickserv/access.h"
#include "modules/nickserv/ajoin.h"
#include "modules/nickserv/cert.h"
#include "modules/nickserv/set_misc.h"
@@ -49,6 +48,7 @@ class DBFlatFile : public Module
account->SetLanguage(data["language"]);
account->SetOper(Oper::Find(account->GetDisplay()));
+#if 0
spacesepstream sep = data["access"];
for (Anope::string token; sep.GetToken(token);)
{
@@ -59,6 +59,7 @@ class DBFlatFile : public Module
access->SetMask(token);
}
}
+#endif
MemoServ::MemoInfo *memos = account->GetMemos();
if (memos != nullptr)
@@ -71,7 +72,7 @@ class DBFlatFile : public Module
catch (const ConvertException &) { }
}
- sep = data["memoignore"];
+ spacesepstream sep = data["memoignore"];
for (Anope::string token; memos && sep.GetToken(token);)
{
MemoServ::Ignore *ign = Serialize::New<MemoServ::Ignore *>();
diff --git a/modules/database/old.cpp b/modules/database/old.cpp
index 49692b8bd..80e179637 100644
--- a/modules/database/old.cpp
+++ b/modules/database/old.cpp
@@ -30,7 +30,6 @@
#include "modules/nickserv/suspend.h"
#include "modules/chanserv/suspend.h"
#include "modules/chanserv/access.h"
-#include "modules/nickserv/access.h"
#define READ(x) \
if (true) \
@@ -517,8 +516,8 @@ static void LoadNicks()
READ(read_uint32(&u32, f));
if (u32 & OLD_NI_KILLPROTECT)
nc->SetKillProtect(true);
- if (u32 & OLD_NI_SECURE)
- nc->SetSecure(true);
+ //if (u32 & OLD_NI_SECURE)
+ // nc->SetSecure(true);
if (u32 & OLD_NI_MSG)
nc->SetMsg(true);
if (u32 & OLD_NI_MEMO_HARDMAX)
@@ -608,12 +607,14 @@ static void LoadNicks()
{
READ(read_string(buffer, f));
+#if 0
NickAccess *a = Serialize::New<NickAccess *>();
if (a)
{
a->SetAccount(nc);
a->SetMask(buffer);
}
+#endif
}
int16_t i16;
@@ -868,8 +869,8 @@ static void LoadChannels()
ci->SetRestricted(true);
if (tmpu32 & OLD_CI_PEACE)
ci->SetPeace(true);
- if (tmpu32 & OLD_CI_SECURE)
- ci->SetSecure(true);
+ //if (tmpu32 & OLD_CI_SECURE)
+ // ci->SetSecure(true);
if (tmpu32 & OLD_CI_NO_EXPIRE)
ci->SetNoExpire(true);
if (tmpu32 & OLD_CI_MEMO_HARDMAX)
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> &params) 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