Add mass_notice oper priv, enabled by default for compatibility.

Controls /wallops and masked notices/privmsgs.
This commit is contained in:
Jilles Tjoelker 2007-12-24 21:47:05 +01:00
parent 333d73ff28
commit c13a2d9ad3
7 changed files with 22 additions and 3 deletions

View File

@ -232,6 +232,7 @@ operator "god" {
* channels etc. see /quote help operspy
* hidden_oper: hides the oper from /stats p (OLD UMODE +p)
* remoteban: allows remote kline etc [DEFAULT]
* mass_notice: allows sending wallops and mass notices [DEFAULT]
*/
flags = global_kill, remote, kline, unkline, gline,
die, rehash, admin, xline, operwall;

View File

@ -398,6 +398,7 @@ operator "god" {
* channels etc. see /quote help operspy
* hidden_oper: hides the oper from /stats p (OLD UMODE +p)
* remoteban: allows remote kline etc [DEFAULT]
* mass_notice: allows sending wallops and mass notices [DEFAULT]
*/
flags = global_kill, remote, kline, unkline, gline,
die, rehash, admin, xline, operwall;

View File

@ -152,14 +152,14 @@ extern void cluster_generic(struct Client *, const char *, int cltype,
#define OPER_INVIS 0x08000
#define OPER_SPY 0x10000
#define OPER_REMOTEBAN 0x20000
/* 0x40000 */
#define OPER_MASSNOTICE 0x40000
/* 0x400000 and above are in client.h */
#define OPER_FLAGS (OPER_KLINE|OPER_UNKLINE|OPER_LOCKILL|OPER_GLOBKILL|\
OPER_REMOTE|OPER_GLINE|OPER_XLINE|OPER_RESV|\
OPER_NICKS|OPER_REHASH|OPER_DIE|OPER_ADMIN|\
OPER_HADMIN|OPER_OPERWALL|OPER_INVIS|OPER_SPY|\
OPER_REMOTEBAN)
OPER_REMOTEBAN|OPER_MASSNOTICE)
#define IsOperConfEncrypted(x) ((x)->flags & OPER_ENCRYPTED)
@ -181,6 +181,7 @@ extern void cluster_generic(struct Client *, const char *, int cltype,
#define IsOperSpy(x) ((x)->flags2 & OPER_SPY)
#define IsOperInvis(x) ((x)->flags2 & OPER_INVIS)
#define IsOperRemoteBan(x) ((x)->flags2 & OPER_REMOTEBAN)
#define IsOperMassNotice(x) ((x)->flags2 & OPER_MASSNOTICE)
extern struct oper_conf *make_oper_conf(void);
extern void free_oper_conf(struct oper_conf *);

View File

@ -972,6 +972,13 @@ handle_special(int p_or_n, const char *command, struct Client *client_p,
return;
}
if(MyClient(source_p) && !IsOperMassNotice(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "mass_notice");
return;
}
if((s = strrchr(nick, '.')) == NULL)
{
sendto_one_numeric(source_p, ERR_NOTOPLEVEL,

View File

@ -104,6 +104,13 @@ ms_wallops(struct Client *client_p, struct Client *source_p, int parc, const cha
{
const char *prefix = "";
if (MyClient(source_p) && !IsOperMassNotice(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "mass_notice");
return 0;
}
if (IsPerson(source_p))
{
if (!strncmp(parv[1], "OPERWALL - ", 11) ||

View File

@ -326,6 +326,7 @@ static struct mode_table flag_table[] = {
{"oper_spy", OPER_SPY },
{"hidden_oper", OPER_INVIS },
{"remoteban", OPER_REMOTEBAN },
{"mass_notice", OPER_MASSNOTICE },
{NULL, 0}
};
@ -466,7 +467,7 @@ conf_begin_oper(struct TopConf *tc)
}
yy_oper = make_oper_conf();
yy_oper->flags |= OPER_ENCRYPTED|OPER_RESV|OPER_OPERWALL|OPER_REMOTEBAN;
yy_oper->flags |= OPER_ENCRYPTED|OPER_RESV|OPER_OPERWALL|OPER_REMOTEBAN|OPER_MASSNOTICE;
return 0;
}

View File

@ -344,6 +344,7 @@ static struct oper_flags oper_flagtable[] =
{ OPER_SPY, 'S', 's' },
{ OPER_INVIS, 'P', 'p' },
{ OPER_REMOTEBAN, 'B', 'b' },
{ OPER_MASSNOTICE, 'M', 'm' },
{ 0, '\0', '\0' }
};