summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-17 15:10:27 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-17 15:10:27 +0000
commitb5b08d707388a49126de80d1c73ca40bf6edbe6f (patch)
tree00c09a943a5d1e9f0b00f6e518876435c98a031c /src/modules
parente4371c74f90239ae3f9bd269a712aa31ce97b6f6 (diff)
Add operonly aliases, <alias:operonly> (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
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_alias.cpp7
1 files changed, 6 insertions, 1 deletions
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);