summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands.c27
-rw-r--r--src/core/os_akill.c1
-rw-r--r--src/core/os_modload.c1
-rw-r--r--src/send.c2
4 files changed, 31 insertions, 0 deletions
diff --git a/src/commands.c b/src/commands.c
index 4deecb0c1..4460678db 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -127,6 +127,31 @@ void do_run_cmd(char *service, User * u, Command * c, const char *cmd)
/*************************************************************************/
/**
+ * Output the 'Limited to' line for the given command
+ * @param service Services Client
+ * @param u User Struct
+ * @param c Command Struct
+ * @return void
+ */
+void do_help_limited(char *service, User * u, Command * c)
+{
+ if (c->has_priv == is_services_oper)
+ notice_lang(service, u, HELP_LIMIT_SERV_OPER);
+ else if (c->has_priv == is_services_admin)
+ notice_lang(service, u, HELP_LIMIT_SERV_ADMIN);
+ else if (c->has_priv == is_services_root)
+ notice_lang(service, u, HELP_LIMIT_SERV_ROOT);
+ else if (c->has_priv == is_oper)
+ notice_lang(service, u, HELP_LIMIT_IRC_OPER);
+ else if (c->has_priv == is_host_setter)
+ notice_lang(service, u, HELP_LIMIT_HOST_SETTER);
+ else if (c->has_priv == is_host_remover)
+ notice_lang(service, u, HELP_LIMIT_HOST_REMOVER);
+}
+
+/*************************************************************************/
+
+/**
* Print a help message for the given command.
* @param services Services Client
* @param u User Struct
@@ -202,6 +227,8 @@ void do_help_cmd(char *service, User * u, Command * c, const char *cmd)
}
if (has_had_help == 0) {
notice_lang(service, u, NO_HELP_AVAILABLE, cmd);
+ } else {
+ do_help_limited(service, u, c);
}
mod_current_module = calling_module;
diff --git a/src/core/os_akill.c b/src/core/os_akill.c
index 7b1a5f616..a37b58821 100644
--- a/src/core/os_akill.c
+++ b/src/core/os_akill.c
@@ -65,6 +65,7 @@ void myOperServHelp(User * u)
{
if (is_services_oper(u)) {
notice_lang(s_OperServ, u, OPER_HELP_CMD_AKILL);
+ notice_lang(s_OperServ, u, HELP_LIMIT_SERV_OPER);
}
}
diff --git a/src/core/os_modload.c b/src/core/os_modload.c
index 10b72703a..ca782ce0b 100644
--- a/src/core/os_modload.c
+++ b/src/core/os_modload.c
@@ -59,6 +59,7 @@ void myOperServHelp(User * u)
{
if (is_services_root(u)) {
notice_lang(s_OperServ, u, OPER_HELP_CMD_MODLOAD);
+ notice_lang(s_OperServ, u, HELP_LIMIT_SERV_ROOT);
}
}
diff --git a/src/send.c b/src/send.c
index 7ef63222f..beb19d077 100644
--- a/src/send.c
+++ b/src/send.c
@@ -187,11 +187,13 @@ void notice_lang(char *source, User * dest, int message, ...)
char buf[4096]; /* because messages can be really big */
char *s, *t;
const char *fmt;
+
if (!dest || !message) {
return;
}
va_start(args, message);
fmt = getstring(dest->na, message);
+
if (!fmt)
return;
memset(buf, 0, 4096);