Log in | Back to darenet.org

Extended Bans

m
Line 1: Line 1:
-
We have recently added support for extended bans to ircd-darenet, our server software. Extended bans gives channel operators more flexibility and control over their channel's ban list. The proper syntax for extended bans is as follows:
+
Extended bans, also known as ban conditional, allow different checks than the usual nick!user@host match to determine whether someone should be banned, giving channel operators more flexibility and control over their channel's ban list.
-
'''<code>/mode #channel +b $type:mask</code>'''  
+
On DareNET (like a few other networks) extended bans are of the form <code>'''$[!]<type>[:<data>]'''</code>. The <type> is one character (case sensitive) and determines the type of match that is to be used. Currently all types require an extra field <data>. If the exclamation mark (!) is present, the result of the comparison will be negated (discussed below).
The following types of extended bans are currently supported:
The following types of extended bans are currently supported:
-
{| class="wikitable" width="100%" style="font-size: 85%;"
+
{| class="simpletable" width="100%" style="font-size: 90%;"
! style="text-align: center;" | Type
! style="text-align: center;" | Type
! style="text-align: center;" | Name
! style="text-align: center;" | Name
Line 38: Line 38:
| Allows you to specify text that will be blocked if a user's privmsg or notice to the channel contains it. * and ? wildcards supported.
| Allows you to specify text that will be blocked if a user's privmsg or notice to the channel contains it. * and ? wildcards supported.
|-
|-
-
|}
+
|}<br />
== Quiet and Nick Change ==
== Quiet and Nick Change ==
-
$q (quiet) and $n (nick change) are similar to normal bans, except that they allow you to control what a user can do without preventing them from joining the channel. $q prevents users matching the ban from sending messages/notices to the channel, while $n prevents them from changing their nickname.
+
The $q (quiet) and $n (nick change) types are similar to normal bans, except that they allow you to control what a user can do without preventing them from being able to join the channel. The $q type prevents users matching a given mask from sending messages/notices to the channel, while the $n type prevents them from changing their nickname.
-
'''Syntax:'''
+
{| class="simpletable" width="55%" style="font-size: 90%;"
-
 
+
! style="text-align: left; width: 25px;" | Type
-
<code>/mode #channel +b $q:nick!ident@host<br>
+
! style="text-align: left;" | Syntax
-
/mode #channel +b $n:nick!ident@host</code>
+
|-
 +
| $q
 +
| <code>/mode #channel +b '''$q:nick!user@host'''</code>
 +
|-
 +
| $n
 +
| <code>/mode #channel +b '''$n:nick!user@host'''</code>
 +
|-
 +
|}
'''Examples:'''
'''Examples:'''
-
Let's say that we wanted to allow AOL users to join the channel, but prevent them from speaking. This could be achieved by setting the following $q (quiet) extended ban:
+
A.) If we wanted to allow users connecting from a ".br" host to join the channel, but prevent them from being able to send messages/notices to the channel, we could set the following $q type extended ban:
-
<code>/mode #channel +b $q:*!*@*.aol.com</code>
+
<html><pre>/mode #ourchannel +b <strong>$q:*!*@*.br</strong></pre></html>
-
If we wanted to also prevent AOL users from changing their nickname while their in our channel, we could also set the following $n (nick change) extended ban to achieve that:
+
B.) If we also wanted to prevent users connecting from a ".br" host from changing their nickname while their in our channel, we could set the following $n type extended ban:
-
<code>/mode #channel +b $n:*!*@*.aol.com</code>
+
<html><pre>/mode #ourchannel +b <strong>$n:*!*@*.br</strong></pre></html>
-
== Channel and Realname ==
+
== Channel ==
-
$c and $r are channel and realname (gecos) bans, respectively.
+
The $c (channel) type prevents users who are in a matching channel from joining your channel.
-
When $c is used, it will prevent users who are currently in the channel specified from joining your channel. When $r is used, it will prevent users who's realname (gecos) matches the ban from joining your channel. Note, $r treats '_' as both the underscore character and a space.
+
{| class="simpletable" width="55%" style="font-size: 90%;"
 +
! style="text-align: left; width: 25px;" | Type
 +
! style="text-align: left;" | Syntax
 +
|-
 +
| $c
 +
| <code>/mode #channel +b '''$c:#channel'''</code>
 +
|-
 +
|}
-
'''Syntax:'''
+
'''Example:'''
-
<code>/mode #channel +b $c:#channel<br>
+
A.) If we wanted to prevent users who are currently in a channel with the word ''warez'' in its name from joining our channel, we could set the following $c type extended ban:
-
/mode #channel +b $r:realname</code>
+
-
'''Examples:'''
+
<html><pre>/mode #ourchannel +b <strong>$c:#*warez*</strong></pre></html>
-
Let's say we wanted to prevent all users who are inchannels with the word ''warez'' in their name from joining our channel. We could achieve this by setting the following $c (channel) extended ban:
+
== Realname ==
-
<code>/mode #channel +b $c:#*warez*</code>
+
The $r (realname/gecos) type prevents users with a matching realname from joining your channel.
-
Let's say we also want to prevent all users with the word ''bot'' in their realname (gecos) from joining the channel, as well. To do this, we could set the following $r (realname) extended ban:
+
Note that the $r type treats "_" as both the underscore character and a space.
-
<code>/mode #channel +b $r:*bot*</code>
+
{| class="simpletable" width="55%" style="font-size: 90%;"
 +
! style="text-align: left; width: 25px;" | Type
 +
! style="text-align: left;" | Syntax
 +
|-
 +
| $r
 +
| <code>/mode #channel +b '''$r:realname'''</code>
 +
|-
 +
|}
 +
 
 +
'''Example:'''
 +
 
 +
A.) If we wanted to prevent users who had the word ''bot'' in their realname (gecos) from the joining our channel, we could set the following $r type extended ban:
 +
 
 +
<html><pre>/mode #ourchannel +b <strong>$r:*bot*</strong></pre></html>
== Account Bans ==
== Account Bans ==
-
The $a (account) extended ban type allows you to ban (logged in) users who's account matches the specified ban mask. Note, these types of bans can only ever match users logged into their NickServ account.
+
The $a (account) type allows you to ban (logged in) users who's username (i.e., account name) matches the specified account mask.
-
'''Syntax:'''
+
Note, these types of bans can only ever match users logged into their NickServ account.
-
<code>/mode #channel +b $a:mask</code>
+
{| class="simpletable" width="55%" style="font-size: 90%;"
 +
! style="text-align: left; width: 25px;" | Type
 +
! style="text-align: left;" | Syntax
 +
|-
 +
| $a
 +
| <code>/mode #channel +b '''$a:account'''</code>
 +
|-
 +
|}
-
'''Examples:'''
+
'''Example:'''
-
If we wanted to ban all users who's account names contained the word ''joe'' in them, we could set the following $a (account) extended ban to achieve this:
+
A.) If we wanted to ban all users who's account name contained the word ''joe'', we could set the following $a type extended ban:
-
<code>/mode #channel +b $a:*joe*</code>
+
<html><pre>/mode #ourchannel +b <strong>$a:*joe*</strong></pre></html>
-
NOTE: Extended account bans act identical to the previous method of banning user's based on their account name (e.g. <code>/mode #channel +b *!*@accountname.*</code>); however, the reverse logic function can also be used with extended account bans, which cannot presently do with the old method. We discuss the reverse logic function a little later in this guide.
+
Account type extended bans act identical to the previous method of banning users based on their account name (i.e., <code>/mode #channel +b *!*@accountname.*</code>); however, negation (reverse logic) can also be used with account type extended bans, which cannot presently be done with the old method. We discuss negation a little later in this guide.
== Shared Bans ==
== Shared Bans ==
-
The $j (shared bans) extended ban type allows you to use another channel's ban list.
+
The $j type allows sharing channel ban lists.
-
'''Syntax:'''  
+
{| class="simpletable" width="55%" style="font-size: 90%;"
 +
! style="text-align: left; width: 25px;" | Type
 +
! style="text-align: left;" | Syntax
 +
|-
 +
| $j
 +
| <code>/mode #channel +b '''$j:#channel'''</code>
 +
|-
 +
|}
-
<code>/mode #channel +b $j:mask</code>
+
'''Example:'''
-
 
+
-
'''Examples:'''
+
-
Okay, for this example, our channel is ''#channel'' and we want to use ''#shared''<nowiki>'</nowiki>s channel ban list along with our own. To do this, we would set the following $c (shared bans) extended ban on ''#channel'':
+
A.) For this example, the name of our channel is ''#ourchannel'' and we want to use ''#shared''<nowiki>'</nowiki>s channel ban list inconjunction with our own. So, to do this we could set the following $j type extended ban:
-
<code>/mode #channel +b $j:#shared</code>
+
<html><pre>/mode #ourchannel +b <strong>$j:#shared</strong></pre></html>
-
Now, whenever a user tries to join ''#channel'', they will be checked against ''#shared''<nowiki>'</nowiki>s channel ban list, in addition to ''#channel''<nowiki>'</nowiki>s channel ban list. If a match is found in either ban list, they will be prevented from joining.
+
Now, whenever a user tries to join our channel, ''#ourchannel'', they'll be checked against ''#shared''<nowiki>'</nowiki>s ban list in addition to our own ban list. If a match is found in either ban list, the user will be prevented from joining.
== Text Bans ==
== Text Bans ==
-
The $t (text ban) extended ban type allows channel operators to specify text that will blocked if a user's message or notice to the channel contains it. The * and ? wildcards are supported. Note, this currently affects channel operators, half operators and voices as well.
+
The $t (text) type allows channel operators to specify text (wildcards supported) that will be blocked if (1) the user's message or notice to the channel matches it, and (2) the user's host matches the entry as well.
-
'''Syntax:'''
+
{| class="simpletable" width="55%" style="font-size: 90%;"
-
 
+
! style="text-align: left; width: 25px;" | Type
-
<code>/mode #channel +b $t:mask</code>
+
! style="text-align: left;" | Syntax
 +
|-
 +
| $t
 +
| <code>/mode #channel +b '''$t:nick!user@host:text'''</code>
 +
|-
 +
|}
'''Examples:'''
'''Examples:'''
-
Let's say we wanted to block all channel messages and notices that contained the word ''damn''. To do this, we would set the following:
+
A.) Let's say we wanted to block all channel messages and notices that contained the word ''damn'', regardless of the user sending it. To do this we could set the following $t type extended ban:
-
<code>/mode #channel +b $t:damn</code>
+
<html><pre>/mode #ourchannel +b <strong>$t:*!*@*:*damn*</strong></pre></html>
-
== Reverse Logic ==
+
B.) Using example A, let's say we only wanted to block such messages from users connected from a ".br" host. To do this we would slightly modify the above $t type extended ban as follows:
-
If "!" is specified in an extended ban, then it will have a reverse effect. Please note this does not work with quiets. Instead, use excepts.
+
<html><pre>/mode #ourchannel +b <strong>$t:*!*@*.br:*damn*</strong></pre></html>
-
'''Syntax:'''
+
== Negation / Reverse Logic ==
-
<code>/mode #channel +b $!<type>:mask</code>
+
If "!" is prepended to the type of an extended ban, then the result of the comparison is negated. In other words, it will have a reversed effect. Negation is currently not possible with quiets. We suggest using excepts in this instance, instead.
'''Example:'''
'''Example:'''
-
Let's say we wanted to an extended channel ban on #darenet with the "!" (reverse) flag, we'd use:
+
A.) Let's say we wanted to allow users to join our channel ONLY if they're already present in #darenet. To do this, we would set a $c type extended ban, but prepending "!" to the type flag:
-
 
+
-
<code>/mode #channel +b $!c:#darenet</code>
+
-
This would prevent anyone from joining #channel if they are not already in #darenet as well.
+
<html><pre>/mode #ourchannel +b <strong>$!c:#darenet</strong></pre></html>
== Assistance ==
== Assistance ==
-
Should you need assistance using the new extended bans feature, feel free to stop by #Support
+
Should you need assistance using the extended bans feature, feel free to stop by #Support
[[Category:All]] [[Category:Documentation]]
[[Category:All]] [[Category:Documentation]]

Revision as of 03:10, 20 September 2010

Extended bans, also known as ban conditional, allow different checks than the usual nick!user@host match to determine whether someone should be banned, giving channel operators more flexibility and control over their channel's ban list.

On DareNET (like a few other networks) extended bans are of the form $[!]<type>[:<data>]. The <type> is one character (case sensitive) and determines the type of match that is to be used. Currently all types require an extra field <data>. If the exclamation mark (!) is present, the result of the comparison will be negated (discussed below).

The following types of extended bans are currently supported:

Type Name Purpose
$a Account If a user's account name matches this ban, (s)he will be unable to join.
$c Channel If a user is in a channel that matches this ban, (s)he will be unable to join.
$j Shared Bans If a user matches a ban on the channel who's ban list is being shared, (s)he will be unable to join.
$n Nick Change If a user matches this ban, (s)he will be unable to change their nickname while in the channel.
$q Quiet If a user matches this ban, (s)he will be unable to send messages to the channel.
$r Realname If a user's realname (gecos) matches this ban, (s)he will be unable to join.
$t Text Allows you to specify text that will be blocked if a user's privmsg or notice to the channel contains it. * and ? wildcards supported.

In This Guide:

Quiet and Nick Change

The $q (quiet) and $n (nick change) types are similar to normal bans, except that they allow you to control what a user can do without preventing them from being able to join the channel. The $q type prevents users matching a given mask from sending messages/notices to the channel, while the $n type prevents them from changing their nickname.

Type Syntax
$q /mode #channel +b $q:nick!user@host
$n /mode #channel +b $n:nick!user@host

Examples:

A.) If we wanted to allow users connecting from a ".br" host to join the channel, but prevent them from being able to send messages/notices to the channel, we could set the following $q type extended ban:

/mode #ourchannel +b $q:*!*@*.br

B.) If we also wanted to prevent users connecting from a ".br" host from changing their nickname while their in our channel, we could set the following $n type extended ban:

/mode #ourchannel +b $n:*!*@*.br

Channel

The $c (channel) type prevents users who are in a matching channel from joining your channel.

Type Syntax
$c /mode #channel +b $c:#channel

Example:

A.) If we wanted to prevent users who are currently in a channel with the word warez in its name from joining our channel, we could set the following $c type extended ban:

/mode #ourchannel +b $c:#*warez*

Realname

The $r (realname/gecos) type prevents users with a matching realname from joining your channel.

Note that the $r type treats "_" as both the underscore character and a space.

Type Syntax
$r /mode #channel +b $r:realname

Example:

A.) If we wanted to prevent users who had the word bot in their realname (gecos) from the joining our channel, we could set the following $r type extended ban:

/mode #ourchannel +b $r:*bot*

Account Bans

The $a (account) type allows you to ban (logged in) users who's username (i.e., account name) matches the specified account mask.

Note, these types of bans can only ever match users logged into their NickServ account.

Type Syntax
$a /mode #channel +b $a:account

Example:

A.) If we wanted to ban all users who's account name contained the word joe, we could set the following $a type extended ban:

/mode #ourchannel +b $a:*joe*

Account type extended bans act identical to the previous method of banning users based on their account name (i.e., /mode #channel +b *!*@accountname.*); however, negation (reverse logic) can also be used with account type extended bans, which cannot presently be done with the old method. We discuss negation a little later in this guide.

Shared Bans

The $j type allows sharing channel ban lists.

Type Syntax
$j /mode #channel +b $j:#channel

Example:

A.) For this example, the name of our channel is #ourchannel and we want to use #shared's channel ban list inconjunction with our own. So, to do this we could set the following $j type extended ban:

/mode #ourchannel +b $j:#shared

Now, whenever a user tries to join our channel, #ourchannel, they'll be checked against #shared's ban list in addition to our own ban list. If a match is found in either ban list, the user will be prevented from joining.

Text Bans

The $t (text) type allows channel operators to specify text (wildcards supported) that will be blocked if (1) the user's message or notice to the channel matches it, and (2) the user's host matches the entry as well.

Type Syntax
$t /mode #channel +b $t:nick!user@host:text

Examples:

A.) Let's say we wanted to block all channel messages and notices that contained the word damn, regardless of the user sending it. To do this we could set the following $t type extended ban:

/mode #ourchannel +b $t:*!*@*:*damn*

B.) Using example A, let's say we only wanted to block such messages from users connected from a ".br" host. To do this we would slightly modify the above $t type extended ban as follows:

/mode #ourchannel +b $t:*!*@*.br:*damn*

Negation / Reverse Logic

If "!" is prepended to the type of an extended ban, then the result of the comparison is negated. In other words, it will have a reversed effect. Negation is currently not possible with quiets. We suggest using excepts in this instance, instead.

Example:

A.) Let's say we wanted to allow users to join our channel ONLY if they're already present in #darenet. To do this, we would set a $c type extended ban, but prepending "!" to the type flag:

/mode #ourchannel +b $!c:#darenet

Assistance

Should you need assistance using the extended bans feature, feel free to stop by #Support