From b5b08d707388a49126de80d1c73ca40bf6edbe6f Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 17 Sep 2006 15:10:27 +0000 Subject: Add operonly aliases, (boolean). Any operonly aliases that are executed by non-oper appear to not exist git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5270 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_alias.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index fc07b5f2d..bf085fcc0 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -37,6 +37,8 @@ class Alias : public classbase std::string requires; /** Alias requires ulined server */ bool uline; + /** Requires oper? */ + bool operonly; }; class ModuleAlias : public Module @@ -60,7 +62,7 @@ class ModuleAlias : public Module a.replace_with = MyConf.ReadValue("alias", "replace", i); a.requires = MyConf.ReadValue("alias", "requires", i); a.uline = MyConf.ReadFlag("alias", "uline", i); - + a.operonly = MyConf.ReadFlag("alias", "operonly", i); Aliases.push_back(a); } @@ -144,6 +146,9 @@ class ModuleAlias : public Module { if (Aliases[i].text == c) { + if ((Aliases[i].operonly) && (!*user->oper)) + return 0; + if (Aliases[i].requires != "") { u = ServerInstance->FindNick(Aliases[i].requires); -- cgit v1.2.3