summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/cs_list.c19
-rw-r--r--src/core/ns_info.c9
-rw-r--r--src/core/ns_list.c16
3 files changed, 20 insertions, 24 deletions
diff --git a/src/core/cs_list.c b/src/core/cs_list.c
index cda14a1df..04e84ecf4 100644
--- a/src/core/cs_list.c
+++ b/src/core/cs_list.c
@@ -32,18 +32,9 @@ int AnopeInit(int argc, char **argv)
moduleAddVersion("$Id$");
moduleSetType(CORE);
- if (CSListOpersOnly) {
- c = createCommand("LIST", do_list, is_oper, -1, CHAN_HELP_LIST,
- CHAN_SERVADMIN_HELP_LIST,
- CHAN_SERVADMIN_HELP_LIST,
- CHAN_SERVADMIN_HELP_LIST);
-
- } else {
- c = createCommand("LIST", do_list, NULL, -1, CHAN_HELP_LIST,
- CHAN_SERVADMIN_HELP_LIST,
- CHAN_SERVADMIN_HELP_LIST,
- CHAN_SERVADMIN_HELP_LIST);
- }
+ c = createCommand("LIST", do_list, NULL, -1, CHAN_HELP_LIST,
+ CHAN_SERVADMIN_HELP_LIST,
+ CHAN_SERVADMIN_HELP_LIST, CHAN_SERVADMIN_HELP_LIST);
moduleAddCommand(CHANSERV, c, MOD_UNIQUE);
@@ -91,6 +82,10 @@ int do_list(User * u)
char *keyword;
int32 matchflags = 0;
+ if (!(!CSListOpersOnly || (is_oper(u)))) {
+ notice_lang(s_ChanServ, u, ACCESS_DENIED);
+ return MOD_STOP;
+ }
if (!pattern) {
syntax_error(s_ChanServ, u, "LIST",
diff --git a/src/core/ns_info.c b/src/core/ns_info.c
index 1f150b7c3..bb4c613ac 100644
--- a/src/core/ns_info.c
+++ b/src/core/ns_info.c
@@ -245,8 +245,13 @@ int do_info(User * u)
*buf ? buf : getstring(u->na, NICK_INFO_OPT_NONE));
if (na->nc->flags & NI_SUSPENDED) {
- notice_lang(s_NickServ, u, NICK_INFO_SUSPENDED,
- na->last_quit);
+ if (na->last_quit) {
+ notice_lang(s_NickServ, u, NICK_INFO_SUSPENDED,
+ na->last_quit);
+ } else {
+ notice_lang(s_NickServ, u,
+ NICK_INFO_SUSPENDED_NO_REASON);
+ }
}
if (na->status & NS_NO_EXPIRE) {
diff --git a/src/core/ns_list.c b/src/core/ns_list.c
index a06c78f9a..825406acd 100644
--- a/src/core/ns_list.c
+++ b/src/core/ns_list.c
@@ -32,15 +32,8 @@ int AnopeInit(int argc, char **argv)
moduleAddVersion("$Id$");
moduleSetType(CORE);
- if (NSListOpersOnly) {
- c = createCommand("LIST", do_list, is_oper, -1, NICK_HELP_LIST, -1,
- NICK_SERVADMIN_HELP_LIST,
- NICK_SERVADMIN_HELP_LIST);
- } else {
- c = createCommand("LIST", do_list, NULL, -1, NICK_HELP_LIST, -1,
- NICK_SERVADMIN_HELP_LIST,
- NICK_SERVADMIN_HELP_LIST);
- }
+ c = createCommand("LIST", do_list, NULL, -1, NICK_HELP_LIST, -1,
+ NICK_SERVADMIN_HELP_LIST, NICK_SERVADMIN_HELP_LIST);
moduleAddCommand(NICKSERV, c, MOD_UNIQUE);
@@ -106,7 +99,10 @@ int do_list(User * u)
char *tmp = NULL;
char *s = NULL;
-
+ if (!(!NSListOpersOnly || (is_oper(u)))) { /* reverse the help logic */
+ notice_lang(s_NickServ, u, ACCESS_DENIED);
+ return MOD_STOP;
+ }
if (!pattern) {
syntax_error(s_NickServ, u, "LIST",