]> jfr.im git - solanum.git/commitdiff
extban $o: add support for matching against specific permissions.
authorWilliam Pitcock <redacted>
Sun, 22 Jan 2012 10:05:34 +0000 (04:05 -0600)
committerWilliam Pitcock <redacted>
Sun, 22 Jan 2012 10:05:34 +0000 (04:05 -0600)
Syntax: $o:oper:admin (match against the oper:admin permission)

extensions/extb_oper.c

index ff859aa4035a7c29aac6e5119cc3099ac3fdd553..083b587b9433139ebe6e0a6777ed66dc0b7071d2 100644 (file)
@@ -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;
 }