mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 23:40:57 +01:00
m_privs: Add stuff for privsets here too.
This commit is contained in:
parent
f37fc9389b
commit
50f2579264
1 changed files with 10 additions and 33 deletions
|
@ -60,28 +60,6 @@ struct mode_table
|
||||||
int mode;
|
int mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct mode_table oper_table[] = {
|
|
||||||
/*{"encrypted", OPER_ENCRYPTED },*/
|
|
||||||
{"local_kill", OPER_LOCKILL },
|
|
||||||
{"global_kill", OPER_GLOBKILL/*|OPER_LOCKILL*/ },
|
|
||||||
{"remote", OPER_REMOTE },
|
|
||||||
{"kline", OPER_KLINE },
|
|
||||||
{"unkline", OPER_UNKLINE },
|
|
||||||
{"nick_changes", OPER_NICKS },
|
|
||||||
{"rehash", OPER_REHASH },
|
|
||||||
{"die", OPER_DIE },
|
|
||||||
{"admin", OPER_ADMIN },
|
|
||||||
{"hidden_admin", OPER_HADMIN },
|
|
||||||
{"xline", OPER_XLINE },
|
|
||||||
{"resv", OPER_RESV },
|
|
||||||
{"operwall", OPER_OPERWALL },
|
|
||||||
{"oper_spy", OPER_SPY },
|
|
||||||
{"hidden_oper", OPER_INVIS },
|
|
||||||
{"remoteban", OPER_REMOTEBAN },
|
|
||||||
{"mass_notice", OPER_MASSNOTICE },
|
|
||||||
{NULL, 0}
|
|
||||||
};
|
|
||||||
|
|
||||||
/* there is no such table like this anywhere else */
|
/* there is no such table like this anywhere else */
|
||||||
static struct mode_table auth_client_table[] = {
|
static struct mode_table auth_client_table[] = {
|
||||||
{"resv_exempt", FLAGS2_EXEMPTRESV },
|
{"resv_exempt", FLAGS2_EXEMPTRESV },
|
||||||
|
@ -101,23 +79,22 @@ static void show_privs(struct Client *source_p, struct Client *target_p)
|
||||||
struct mode_table *p;
|
struct mode_table *p;
|
||||||
|
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
p = &oper_table[0];
|
if (target_p->localClient->privset)
|
||||||
while (p->name != NULL)
|
rb_strlcat(buf, target_p->localClient->privset->privs, sizeof buf);
|
||||||
{
|
|
||||||
if (target_p->flags2 & p->mode)
|
|
||||||
{
|
|
||||||
if (buf[0] != '\0')
|
|
||||||
rb_strlcat(buf, " ", sizeof buf);
|
|
||||||
rb_strlcat(buf, p->name, sizeof buf);
|
|
||||||
}
|
|
||||||
p++;
|
|
||||||
}
|
|
||||||
if (IsOper(target_p))
|
if (IsOper(target_p))
|
||||||
{
|
{
|
||||||
if (buf[0] != '\0')
|
if (buf[0] != '\0')
|
||||||
rb_strlcat(buf, " ", sizeof buf);
|
rb_strlcat(buf, " ", sizeof buf);
|
||||||
rb_strlcat(buf, "operator:", sizeof buf);
|
rb_strlcat(buf, "operator:", sizeof buf);
|
||||||
rb_strlcat(buf, target_p->localClient->opername, sizeof buf);
|
rb_strlcat(buf, target_p->localClient->opername, sizeof buf);
|
||||||
|
|
||||||
|
if (target_p->localClient->privset)
|
||||||
|
{
|
||||||
|
if (buf[0] != '\0')
|
||||||
|
rb_strlcat(buf, " ", sizeof buf);
|
||||||
|
rb_strlcat(buf, "privset:", sizeof buf);
|
||||||
|
rb_strlcat(buf, target_p->localClient->privset->name, sizeof buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
p = &auth_client_table[0];
|
p = &auth_client_table[0];
|
||||||
while (p->name != NULL)
|
while (p->name != NULL)
|
||||||
|
|
Loading…
Reference in a new issue