diff options
-rw-r--r-- | Changes.lang | 3 | ||||
-rw-r--r-- | include/services.h | 2 | ||||
-rw-r--r-- | lang/en_us.l | 13 | ||||
-rw-r--r-- | src/nickserv.c | 36 | ||||
-rw-r--r-- | src/servers.c | 1 | ||||
-rw-r--r-- | src/users.c | 2 | ||||
-rw-r--r-- | version.log | 6 |
7 files changed, 46 insertions, 17 deletions
diff --git a/Changes.lang b/Changes.lang index 40cf1207b..c7b677c3f 100644 --- a/Changes.lang +++ b/Changes.lang @@ -15,7 +15,8 @@ Anope Version S V N NICK_UNSUSPEND_SYNTAX NICK_UNSUSPEND_SUCCEEDED NICK_UNSUSPEND_FAILED - NICK_SERVADMIN_HELP_SUSPEND + NICK_SERVADMIN_HELP_SUSPEND + NICK_SERVADMIN_HELP_UNSUSPEND *** Mod Strings: OPER_HELP_SET diff --git a/include/services.h b/include/services.h index 63f64f608..1590637bf 100644 --- a/include/services.h +++ b/include/services.h @@ -1074,7 +1074,6 @@ struct session_ { #define NS_MASTER 0x0200 /* Was a master nick; used to import old databases */ #define NS_TRANSGROUP 0xC000 /* Status flags that can be passed to a nick of the same group during nick change */ -#define NS_SUSPENDED 0x0400 /* Nickname has been suspended */ #define NS_TEMPORARY 0xFF00 /* All temporary status flags */ /* These two are not used anymore */ #define NS_OLD_ENCRYPTEDPW 0x0001 /* Nickname password is encrypted */ @@ -1098,6 +1097,7 @@ struct session_ { #define NI_SERVICES_ROOT 0x00008000 /* User is a Services root */ #define NI_MEMO_MAIL 0x00010000 /* User gets email on memo */ #define NI_HIDE_STATUS 0x00020000 /* Don't show services access status */ +#define NI_SUSPENDED 0x00040000 /* Nickname is suspended */ /* Languages. Never insert anything in the middle of this list, or * everybody will start getting the wrong language! If you want to change * the order the languages are displayed in for NickServ HELP SET LANGUAGE, diff --git a/lang/en_us.l b/lang/en_us.l index 70b7cbbd0..934410885 100644 --- a/lang/en_us.l +++ b/lang/en_us.l @@ -3734,10 +3734,17 @@ NICK_SERVADMIN_HELP_FORBID Limited to Services admins. NICK_SERVADMIN_HELP_SUSPEND - Syntax: SUSPEND nickname reason / UNSUSPEND nickname + Syntax: SUSPEND nickname reason + + SUSPENDs a nickname from being used. + + Limited to Services admins. + +NICK_SERVADMIN_HELP_UNSUSPEND + Syntax: UNSUSPEND nickname + + UNSUSPENDS a nickname from being used. - SUSPENDs / UNSUSPENDs a nickname from being identified to - Limited to Services admins. ########################################################################### diff --git a/src/nickserv.c b/src/nickserv.c index a334d61db..db4c23840 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -140,7 +140,7 @@ void moduleAddNickServCmds(void) { c = createCommand("GETEMAIL", do_getemail, is_services_admin, -1,-1, -1,NICK_SERVADMIN_HELP_GETEMAIL, NICK_SERVADMIN_HELP_GETEMAIL); addCoreCommand(NICKSERV,c); c = createCommand("FORBID", do_forbid, is_services_admin, -1,-1, -1,NICK_SERVADMIN_HELP_FORBID, NICK_SERVADMIN_HELP_FORBID); addCoreCommand(NICKSERV,c); c = createCommand("SUSPEND", do_suspend, is_services_admin, -1,-1, -1,NICK_SERVADMIN_HELP_SUSPEND, NICK_SERVADMIN_HELP_SUSPEND); addCoreCommand(NICKSERV,c); - c = createCommand("UNSUSPEND",do_unsuspend,is_services_admin, -1,-1, -1,NICK_SERVADMIN_HELP_SUSPEND, NICK_SERVADMIN_HELP_SUSPEND); addCoreCommand(NICKSERV,c); + c = createCommand("UNSUSPEND",do_unsuspend,is_services_admin, -1,-1, -1,NICK_SERVADMIN_HELP_UNSUSPEND, NICK_SERVADMIN_HELP_UNSUSPEND); addCoreCommand(NICKSERV,c); } /* *INDENT-ON* */ /*************************************************************************/ @@ -1063,6 +1063,12 @@ int validate_user(User * u) return 0; } + if (na->nc->flags & NI_SUSPENDED) { + notice_lang(s_NickServ, u, NICK_X_SUSPENDED, u->nick); + collide(na, 0); + return 0; + } + on_access = is_on_access(u, na->nc); if (on_access) na->status |= NS_ON_ACCESS; @@ -2403,12 +2409,20 @@ static int do_group(User * u) alog("%s: %s@%s tried to use GROUP from FORBIDden nick %s", s_NickServ, u->username, u->host, u->nick); notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, u->nick); + } else if (u->na && (u->na->nc->flags & NI_SUSPENDED)) { + alog("%s: %s@%s tried to use GROUP from SUSPENDED nick %s", + s_NickServ, u->username, u->host, u->nick); + notice_lang(s_NickServ, u, NICK_X_SUSPENDED, u->nick); } else if (u->na && NSNoGroupChange) { notice_lang(s_NickServ, u, NICK_GROUP_CHANGE_DISABLED, s_NickServ); } else if (u->na && !nick_identified(u)) { notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ); } else if (!(target = findnick(nick))) { notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick); + } else if (target && (target->nc->flags & NI_SUSPENDED)) { + alog("%s: %s@%s tried to use GROUP from SUSPENDED nick %s", + s_NickServ, u->username, u->host, u->nick); + notice_lang(s_NickServ, u, NICK_X_SUSPENDED, target->nick); } else if (target->status & NS_VERBOTEN) { notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick); } else if (u->na && target->nc == u->na->nc) { @@ -2545,7 +2559,7 @@ static int do_identify(User * u) } } else if (na->status & NS_VERBOTEN) { notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick); - } else if (na->status & NS_SUSPENDED) { + } else if (na->nc->flags & NI_SUSPENDED) { notice_lang(s_NickServ, u, NICK_X_SUSPENDED, na->nick); } else if (nick_identified(u)) { notice_lang(s_NickServ, u, NICK_ALREADY_IDENTIFIED); @@ -2851,7 +2865,7 @@ static int do_set(User * u) notice_lang(s_NickServ, u, NICK_NOT_REGISTERED); } else if (na->status & NS_VERBOTEN) { notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick); - } else if (na->status & NS_SUSPENDED) { + } else if (na->nc->flags & NI_SUSPENDED) { notice_lang(s_NickServ, u, NICK_X_SUSPENDED, na->nick); } else if (!is_servadmin && !nick_identified(u)) { notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ); @@ -3291,7 +3305,7 @@ static int do_access(User * u) return MOD_CONT; } - if (na->status & NS_SUSPENDED) { + if (na->nc->flags & NI_SUSPENDED) { notice_lang(s_NickServ, u, NICK_X_SUSPENDED, na->nick); return MOD_CONT; } @@ -3319,7 +3333,7 @@ static int do_access(User * u) } else if (na->status & NS_VERBOTEN) { notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick); - } else if (na->status & NS_SUSPENDED) { + } else if (na->nc->flags & NI_SUSPENDED) { notice_lang(s_NickServ, u, NICK_X_SUSPENDED, na->nick); } else if (!nick_identified(u)) { @@ -3572,7 +3586,7 @@ static int do_info(User * u) notice_lang(s_NickServ, u, NICK_INFO_OPTIONS, *buf ? buf : getstring(u->na, NICK_INFO_OPT_NONE)); - if (na->status & NS_SUSPENDED) { + if (na->nc->flags & NI_SUSPENDED) { notice_lang(s_NickServ, u, NICK_INFO_SUSPENDED, na->last_quit); } @@ -3938,7 +3952,7 @@ static int do_recover(User * u) notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick); } else if (na->status & NS_VERBOTEN) { notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick); - } else if (na->status & NS_SUSPENDED) { + } else if (na->nc->flags & NI_SUSPENDED) { notice_lang(s_NickServ, u, NICK_X_SUSPENDED, na->nick); } else if (stricmp(nick, u->nick) == 0) { notice_lang(s_NickServ, u, NICK_NO_RECOVER_SELF); @@ -3984,7 +3998,7 @@ static int do_release(User * u) notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick); } else if (na->status & NS_VERBOTEN) { notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick); - } else if (na->status & NS_SUSPENDED) { + } else if (na->nc->flags & NI_SUSPENDED) { notice_lang(s_NickServ, u, NICK_X_SUSPENDED, na->nick); } else if (!(na->status & NS_KILL_HELD)) { notice_lang(s_NickServ, u, NICK_RELEASE_NOT_HELD, nick); @@ -4030,7 +4044,7 @@ static int do_ghost(User * u) notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick); } else if (na->status & NS_VERBOTEN) { notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick); - } else if (na->status & NS_SUSPENDED) { + } else if (na->nc->flags & NI_SUSPENDED) { notice_lang(s_NickServ, u, NICK_X_SUSPENDED, na->nick); } else if (stricmp(nick, u->nick) == 0) { notice_lang(s_NickServ, u, NICK_NO_GHOST_SELF); @@ -4340,7 +4354,7 @@ static int do_suspend(User * u) } if (na) { - na->status |= NS_SUSPENDED; + na->nc->flags |= NI_SUSPENDED; na->nc->flags |= NI_SECURE; na->status &= ~(NS_IDENTIFIED | NS_RECOGNIZED); na->nc->flags &= ~(NI_KILLPROTECT | NI_KILL_QUICK | NI_KILL_IMMED); @@ -4397,7 +4411,7 @@ static int do_unsuspend(User * u) } if (na) { - na->status &= ~NS_SUSPENDED; + na->nc->flags &= ~NI_SUSPENDED; if (WallForbid) anope_cmd_global(s_NickServ, "\2%s\2 used UNSUSPEND on \2%s\2", diff --git a/src/servers.c b/src/servers.c index e5579bca0..5c8e253f6 100644 --- a/src/servers.c +++ b/src/servers.c @@ -167,6 +167,7 @@ static void delete_server(Server * serv, const char *quitreason) unext = nextuser(); if (u->server == serv) { if ((na = u->na) && !(na->status & NS_VERBOTEN) + && (!(na->nc->flags & NI_SUSPENDED)) && (na->status & (NS_IDENTIFIED | NS_RECOGNIZED))) { na->last_seen = time(NULL); if (na->last_quit) diff --git a/src/users.c b/src/users.c index 784876728..af95c067c 100644 --- a/src/users.c +++ b/src/users.c @@ -821,6 +821,7 @@ void do_quit(const char *source, int ac, char **av) alog("debug: %s quits", source); } if ((na = user->na) && (!(na->status & NS_VERBOTEN)) + && (!(na->nc->flags & NI_SUSPENDED)) && (na->status & (NS_IDENTIFIED | NS_RECOGNIZED))) { na->last_seen = time(NULL); if (na->last_quit) @@ -856,6 +857,7 @@ void do_kill(char *nick, char *msg) alog("debug: %s killed", nick); } if ((na = user->na) && (!(na->status & NS_VERBOTEN)) + && (!(na->nc->flags & NI_SUSPENDED)) && (na->status & (NS_IDENTIFIED | NS_RECOGNIZED))) { na->last_seen = time(NULL); if (na->last_quit) diff --git a/version.log b/version.log index 38947cfb7..51888d6c3 100644 --- a/version.log +++ b/version.log @@ -8,10 +8,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="8" -VERSION_BUILD="643" +VERSION_BUILD="644" # $Log$ # +# BUILD : 1.7.8 (644) +# BUGS : 330 +# NOTES : Fixed bugs with nickserv suspend +# # BUILD : 1.7.8 (643) # BUGS : # NOTES : Fixed: (1) memleak in nickIsServices [src/misc.c] (2) Fixed language files to reflect r641 (3) Updated nl.l (4) Added event of r642 to docs/EVENTS |