From 655e7dee45ecf5471ecb9cc6d545fd514442cc7b Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 22 Jan 2012 04:05:34 -0600 Subject: [PATCH] extban $o: add support for matching against specific permissions. Syntax: $o:oper:admin (match against the oper:admin permission) --- extensions/extb_oper.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extensions/extb_oper.c b/extensions/extb_oper.c index ff859aa4..083b587b 100644 --- a/extensions/extb_oper.c +++ b/extensions/extb_oper.c @@ -8,6 +8,8 @@ #include "stdinc.h" #include "modules.h" #include "client.h" +#include "privilege.h" +#include "s_newconf.h" #include "ircd.h" static int _modinit(void); @@ -36,9 +38,10 @@ static int eb_oper(const char *data, struct Client *client_p, (void)chptr; (void)mode_type; - /* perhaps use data somehow? (opernick/flags?) */ - /* so deny any bans with data for now */ + if (data != NULL) - return EXTBAN_INVALID; - return IsOper(client_p) ? EXTBAN_MATCH : EXTBAN_NOMATCH; + return IsOper(client_p) ? EXTBAN_MATCH : EXTBAN_NOMATCH; + + /* $o:admin or whatever */ + return HasPrivilege(client_p, data) ? EXTBAN_MATCH : EXTBAN_NOMATCH; }