2007-01-24 22:40:21 -08:00
|
|
|
/*
|
|
|
|
* Oper extban type: matches opers
|
|
|
|
* -- jilles
|
|
|
|
*/
|
|
|
|
|
2016-08-17 22:33:38 -07:00
|
|
|
namespace mode = ircd::chan::mode;
|
2016-08-16 20:01:20 -07:00
|
|
|
namespace ext = mode::ext;
|
2016-08-12 20:05:54 -07:00
|
|
|
using namespace ircd;
|
|
|
|
|
2016-03-09 01:29:41 -06:00
|
|
|
static const char extb_desc[] = "Oper ($o) extban type";
|
|
|
|
|
2007-01-24 22:40:21 -08:00
|
|
|
static int _modinit(void);
|
|
|
|
static void _moddeinit(void);
|
2016-08-21 18:57:43 -07:00
|
|
|
static int eb_oper(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
2007-01-24 22:40:21 -08:00
|
|
|
|
2016-03-07 00:31:41 -06:00
|
|
|
DECLARE_MODULE_AV2(extb_oper, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
2007-01-24 22:40:21 -08:00
|
|
|
|
|
|
|
static int
|
|
|
|
_modinit(void)
|
|
|
|
{
|
2016-08-16 20:01:20 -07:00
|
|
|
ext::table['o'] = eb_oper;
|
2007-01-24 22:40:21 -08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_moddeinit(void)
|
|
|
|
{
|
2016-08-16 20:01:20 -07:00
|
|
|
ext::table['o'] = NULL;
|
2007-01-24 22:40:21 -08:00
|
|
|
}
|
|
|
|
|
2016-08-17 22:33:38 -07:00
|
|
|
static int
|
2016-08-21 18:57:43 -07:00
|
|
|
eb_oper(const char *data, client::client *client_p, chan::chan *chptr, mode::type type)
|
2007-01-24 22:40:21 -08:00
|
|
|
{
|
2016-08-16 20:01:20 -07:00
|
|
|
using namespace ext;
|
2007-01-24 22:40:21 -08:00
|
|
|
|
2007-12-18 23:00:42 +01:00
|
|
|
if (data != NULL)
|
2016-01-05 19:12:38 -06:00
|
|
|
{
|
|
|
|
struct PrivilegeSet *set = privilegeset_get(data);
|
|
|
|
if (set != NULL && client_p->localClient->privset == set)
|
2016-08-16 20:01:20 -07:00
|
|
|
return MATCH;
|
2016-01-05 19:12:38 -06:00
|
|
|
|
2012-01-24 17:13:32 +00:00
|
|
|
/* $o:admin or whatever */
|
2016-08-16 20:01:20 -07:00
|
|
|
return HasPrivilege(client_p, data) ? MATCH : NOMATCH;
|
2016-01-05 19:12:38 -06:00
|
|
|
}
|
2012-01-22 04:05:34 -06:00
|
|
|
|
2016-08-23 15:25:09 -07:00
|
|
|
return is(*client_p, umode::OPER) ? MATCH : NOMATCH;
|
2007-01-24 22:40:21 -08:00
|
|
|
}
|