summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-23 19:07:40 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-23 19:07:40 +0000
commit38e125bdb8422343a86017479d00b462bf36e784 (patch)
treeb016af970c84de61a071ad1ec4fd98a53165b570 /src/users.cpp
parentefc75198ded220f6af88914252c3361f6a5664d9 (diff)
Change to <type:vhost> and <oper:vhost> because <oper:host> is taken.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11957 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp22
1 files changed, 18 insertions, 4 deletions
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()