From 38e125bdb8422343a86017479d00b462bf36e784 Mon Sep 17 00:00:00 2001 From: danieldg Date: Fri, 23 Oct 2009 19:07:40 +0000 Subject: Change to and because is taken. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11957 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands/cmd_oper.cpp | 9 --------- src/configreader.cpp | 4 +--- src/listensocket.cpp | 4 ++++ src/modules/m_httpd_config.cpp | 2 +- src/users.cpp | 22 ++++++++++++++++++---- 5 files changed, 24 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index b2db8c95c..42ea0c07d 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -73,15 +73,6 @@ CmdResult CommandOper::HandleLocal(const std::vector& parameters, L if (match_pass && match_hosts) { /* found this oper's opertype */ - std::string host = ifo->getConfig("host"); - if (!host.empty()) - user->ChangeDisplayedHost(host.c_str()); - std::string opClass = ifo->getConfig("class"); - if (!opClass.empty()) - { - user->SetClass(opClass); - user->CheckClass(); - } user->Oper(ifo); return CMD_SUCCESS; } diff --git a/src/configreader.cpp b/src/configreader.cpp index 5fa56ba8f..3785e066c 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -925,7 +925,6 @@ std::string ServerConfig::GetSID() void ConfigReaderThread::Run() { - Config = new ServerConfig; Config->Read(); done = true; } @@ -957,7 +956,7 @@ void ConfigReaderThread::Finish() FOREACH_MOD(I_OnRehash, OnRehash(user)); ServerInstance->BuildISupport(); - delete old; + Config = old; } else { @@ -965,6 +964,5 @@ void ConfigReaderThread::Finish() ServerInstance->Logs->CloseLogs(); ServerInstance->Config = old; ServerInstance->Logs->OpenFileLogs(); - delete this->Config; } } diff --git a/src/listensocket.cpp b/src/listensocket.cpp index 0d6bf89b6..038c665be 100644 --- a/src/listensocket.cpp +++ b/src/listensocket.cpp @@ -155,7 +155,11 @@ void ListenSocket::AcceptInternal() } } if (res != MOD_RES_ALLOW) + { + ServerInstance->Logs->Log("SOCKET",DEFAULT,"Refusing connection on %s - %s", + bind_desc.c_str(), res == MOD_RES_DENY ? "Connection refused by module" : "Module for this port not found"); ServerInstance->SE->Close(incomingSockfd); + } } void ListenSocket::HandleEvent(EventType e, int err) diff --git a/src/modules/m_httpd_config.cpp b/src/modules/m_httpd_config.cpp index 44013b429..0763ad11d 100644 --- a/src/modules/m_httpd_config.cpp +++ b/src/modules/m_httpd_config.cpp @@ -91,7 +91,7 @@ class ModuleHttpStats : public Module { data << "<" << x->first << " "; ConfigTag* tag = x->second; - for (std::vector::iterator j = tag->items.begin(); j != tag->items.end(); j++) + for (std::vector::const_iterator j = tag->getItems().begin(); j != tag->getItems().end(); j++) { data << Sanitize(j->first) << "="" << Sanitize(j->second) << "" "; } diff --git a/src/users.cpp b/src/users.cpp index d1a4b2528..170b0c7ec 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -628,18 +628,32 @@ void User::Oper(OperInfo* info) if (info->oper_block) opername = info->oper_block->getString("name"); + if (IS_LOCAL(this)) + { + LocalUser* l = IS_LOCAL(this); + std::string vhost = oper->getConfig("vhost"); + if (!vhost.empty()) + l->ChangeDisplayedHost(vhost.c_str()); + std::string opClass = oper->getConfig("class"); + if (!opClass.empty()) + { + l->SetClass(opClass); + l->CheckClass(); + } + } + ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s (using oper '%s')", - nick.c_str(), ident.c_str(), host.c_str(), info->NameStr(), opername.c_str()); - this->WriteNumeric(381, "%s :You are now %s %s", nick.c_str(), strchr("aeiouAEIOU", info->name[0]) ? "an" : "a", info->NameStr()); + nick.c_str(), ident.c_str(), host.c_str(), oper->NameStr(), opername.c_str()); + this->WriteNumeric(381, "%s :You are now %s %s", nick.c_str(), strchr("aeiouAEIOU", oper->name[0]) ? "an" : "a", oper->NameStr()); - ServerInstance->Logs->Log("OPER", DEFAULT, "%s!%s@%s opered as type: %s", this->nick.c_str(), this->ident.c_str(), this->host.c_str(), info->NameStr()); + ServerInstance->Logs->Log("OPER", DEFAULT, "%s!%s@%s opered as type: %s", this->nick.c_str(), this->ident.c_str(), this->host.c_str(), oper->NameStr()); ServerInstance->Users->all_opers.push_back(this); // Expand permissions from config for faster lookup if (IS_LOCAL(this)) oper->init(); - FOREACH_MOD(I_OnPostOper,OnPostOper(this, info->name, opername)); + FOREACH_MOD(I_OnPostOper,OnPostOper(this, oper->name, opername)); } void OperInfo::init() -- cgit v1.2.3