Add mass_notice oper priv, enabled by default for compatibility.
Controls /wallops and masked notices/privmsgs.
This commit is contained in:
parent
333d73ff28
commit
c13a2d9ad3
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 *);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) ||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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' }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue