[[project @ 2004-06-14 04:26:29 by unknown_lamer] unknown_lamer**20040614042629 Fixed a typo in README, disabled DCC CHAT for users below level 3 (FRIEND), and worked on the manual. ] { hunk ./ChangeLog 1 +2004-06-14 Clinton Ebadi + + * bobot++.texinfo (Protection): Added Section + (User Levels): Rewrote section to be useful + (bot.users): Added section + hunk ./ChangeLog 9 + * source/DCCChatConnection.C (connect): Checks to make sure the + person initiating a DCC CHAT with the bot is at least a FRIEND of + the bot. + + * README: Fixed a typo + hunk ./NEWS 13 -Version 2.1.5: Manual Stuff +Version 2.1.5: Cleanups +- A DCC CHAT with the bot may now only be initiated if the user is a + Friend of the bot +- Implemented bot:ctcp-quote hunk ./README 6 -compatible. The biggest change is that all bot-* functions are not +compatible. The biggest change is that all bot-* functions are now hunk ./TODO 1 +Done: +* DCC CHAT min user level +* Lots of hooks related stuff that I never wrote down +* Abstract DCC support so that DCC FILE may be easily implemented + hunk ./TODO 12 -* DCC CHAT min user level hunk ./TODO 16 +* bot:protection/[none|no-ban|no-kick|no-deop] constants +* bot:aop/[no|yes] constants +* Extend AOP to support +v (0 = no op, 1 = +o, 2 = +v) hunk ./bobot++.info 51 +* bot.users:: hunk ./bobot++.info 61 +* Protection:: +* Automatic Op:: hunk ./bobot++.info 96 -Bobot++ is easy to configure. The configuration file format may be -changing in the 2.1 series, so it is not documented for now. See the -`examples' directory for an example configuration. +Bobot++ is easy to configure. See the `examples' directory for an +example configuration. hunk ./bobot++.info 113 +* bot.users:: hunk ./bobot++.info 116 -File: bobot++.info, Node: bot.conf, Prev: Configuration Files, Up: Configuration Files +File: bobot++.info, Node: bot.conf, Next: bot.users, Prev: Configuration Files, Up: Configuration Files hunk ./bobot++.info 121 -`bot.conf' contains key value pairs separated by `='. +* Menu: + +* server syntax:: +* channel syntax:: + + `bot.conf' contains key value pairs separated by `='. hunk ./bobot++.info 163 -* Menu: - -* server syntax:: -* channel syntax:: - hunk ./bobot++.info 209 + +File: bobot++.info, Node: bot.users, Prev: bot.conf, Up: Configuration Files + +bot.users +--------- + +`bot.users' is the default file name of the userlist. It may be changed +in `bot.conf'. The file contains lines with the format: + + `MASK:CHANNEL:LEVEL:PROTECTION:AUTO-OP' + + * MASK is the host mask (e.g. `*!*username + .domain.com') of the user + + * CHANNEL is a channel mask of the channels that the user has + priviliges to use the bot in (e.g. `*' for all channels, `#*' for + all non-local channel, `#foo*' for all channels starting with + "foo," `#bar' for channel "#bar" only, etc.) + + * LEVEL is the user level of the user (*Note User Levels::). + + * PROTECTION is the protection level of the user (*Note + Protection::). + + * AUTO-OP is set to control whether a user is automatically given + operator priviliges on channel entry (*Note Automatic Op::). + + hunk ./bobot++.info 260 +* Protection:: +* Automatic Op:: hunk ./bobot++.info 264 -File: bobot++.info, Node: User Levels, Prev: Using the Bot, Up: Using the Bot +File: bobot++.info, Node: User Levels, Next: Protection, Prev: Using the Bot, Up: Using the Bot hunk ./bobot++.info 269 -There are five levels that a user may be when interfacing with a bot: -NONE, USER, TRUSTED_USER, FRIEND, MASTER. All users default to NONE -unless they are changed by a script, the `!adduser' command or the -`bot.users' file. NONE is for everyone--very few commands (e.g. help) -are available to the users and almost everyone should be this level. A -USER can execute many of the bot commands, but can't use masks on kicks -and bans. A TRUSTED user can everything a USER can do, but can also use -masks on kicks and bans. A FRIEND can do everything except for stopping -the bot (be careful who you give this to!). The MASTER level is for the -bot's owner (probably you) and can do _everything_ to the bot. Be -_very_ careful if you give MASTER level access to anyone else. You -cannot use this symbolic levels with the `!adduser' command. See -(FIXME: ref) for the numbers you must use with `!adduser'. +There are several user levels available in Bobot++ to provide gradated +access to commands. `!adduser' and `bot.users' use the numeric code; +Scheme uses the textual name for the level. By default (if no catch-all +setting is found in *Note bot.users::.) a user is not even a +`bot:user-none' and cannot execute *any* commands, even commands +available to `bot:user-none'. + + 0. `bot:user-none' - No *built-in* commands may be executed _by + default_ (commands may be added from Scheme that can be executed + by users of level none and the level required to execute a command + may be changed from Scheme). + + 1. `bot:user-user' - Will be able to execute most commands but not + all and cannot use masks on kicks and bans. + + 2. `bot:user-trusted' - For built-ins with a default configuration + this user has access to the same set of commands as an `user' but + may use masks on kicks and bans. Scheme commands may be added + which require a user to be of this level. + + 3. `bot:user-friend' - In the default configuration a user who is a + friend will be able to do everything short of stopping the bot. + Again, there may be user added commands that require a higher user + level. + + 4. `bot:user-master' - This is the highest user level and has access + to every feature of the bot. + + + +File: bobot++.info, Node: Protection, Next: Automatic Op, Prev: User Levels, Up: Using the Bot + +Protection +========== + +A user added via Scheme, the `bot.users' file, or `!adduser' may be +protected from being deoped, kicked, or banned. There are currently no +symbolic levels in Scheme; just use the numeric code. + + 0. No protection + + 1. No ban. If a user is banned the bot will unban him.. + + 2. No kick. The user may still be kicked but the bot will kickban the + user who kicked the protected user. + + 3. No deop. The bot will ensure that the user always maintains + operator status. + + + +File: bobot++.info, Node: Automatic Op, Prev: Protection, Up: Using the Bot + +Automatic Op +============ + +A user may be automatically given operator status upon entering a +channel. Set the AOP field to "0" to disable auto-op or "1" to enable +auto-op. hunk ./bobot++.info 345 -Bobot++ 2.4. The command `perl -pi -e ``s/bot-/bot:/g'' YOUR-FILES' -should be enough to convert your code to use the new functions. +Bobot++ 3.0. New commands are only available with the `bot:' prefix. +The command `perl -pi -e ``s/bot-/bot:/g'' YOUR-FILES' should be enough +to convert your code to use the new functions. hunk ./bobot++.info 737 -Node: Introduction1722 -Node: Configuration1910 -Node: Configuration Files2291 -Node: bot.conf2484 -Node: server syntax3889 -Node: channel syntax4737 -Node: Configuration File Placement5564 -Node: Using the Bot6034 -Node: User Levels6205 -Node: Scripting7206 -Node: Adding New Commands8111 -Node: Hooks9375 -Node: Creating a Hook10346 -Node: Hook Types11482 -Node: Scheme User Levels14953 -Node: Sending Messages16079 -Node: High Level Message Functions16687 -Node: Low Level Message Functions16898 -Node: Misc Scripting Stuff17648 -Node: Concept Index18064 -Node: Function Index18246 -Node: Variable Index18507 +Node: Introduction1768 +Node: Configuration1956 +Node: Configuration Files2239 +Node: bot.conf2446 +Node: server syntax3872 +Node: channel syntax4720 +Node: bot.users5547 +Node: Configuration File Placement6438 +Node: Using the Bot6908 +Node: User Levels7111 +Node: Protection8556 +Node: Automatic Op9157 +Node: Scripting9412 +Node: Adding New Commands10373 +Node: Hooks11637 +Node: Creating a Hook12608 +Node: Hook Types13744 +Node: Scheme User Levels17215 +Node: Sending Messages18341 +Node: High Level Message Functions18949 +Node: Low Level Message Functions19160 +Node: Misc Scripting Stuff19910 +Node: Concept Index20326 +Node: Function Index20508 +Node: Variable Index20769 hunk ./bobot++.texinfo 1 -\input texinfo @c -*- texinfo -*- +input texinfo @c -*- texinfo -*- hunk ./bobot++.texinfo 77 +* bot.users:: hunk ./bobot++.texinfo 87 +* Protection:: +* Automatic Op:: hunk ./bobot++.texinfo 120 -Bobot++ is easy to configure. The configuration file format may be -changing in the 2.1 series, so it is not documented for now. See the -@file{examples} directory for an example configuration. +Bobot++ is easy to configure. See the @file{examples} directory for an +example configuration. hunk ./bobot++.texinfo 133 +* bot.users:: hunk ./bobot++.texinfo 136 -@node bot.conf, , Configuration Files, Configuration Files +@node bot.conf, bot.users, Configuration Files, Configuration Files hunk ./bobot++.texinfo 139 +@menu +* server syntax:: +* channel syntax:: +@end menu + hunk ./bobot++.texinfo 178 -@menu -* server syntax:: -* channel syntax:: -@end menu - hunk ./bobot++.texinfo 221 +@node bot.users, , bot.conf, Configuration Files +@subsection bot.users + +@file{bot.users} is the default file name of the userlist. It may be +changed in @file{bot.conf}. The file contains lines with the format: + +@samp{@var{mask}:@var{channel}:@var{level}:@var{protection}:@var{auto-op}} + +@itemize + +@item @var{mask} is the host mask +(e.g. @samp{*!*username@*.domain.com}) of the user + +@item @var{channel} is a channel mask of the channels that the user +has priviliges to use the bot in (e.g. @samp{*} for all channels, +@samp{#*} for all non-local channel, @samp{#foo*} for all channels +starting with ``foo,'' @samp{#bar} for channel ``#bar'' only, etc.) + +@item @var{level} is the user level of the user (@ref{User Levels}). + +@item @var{protection} is the protection level of the user +(@ref{Protection}). + +@item @var{auto-op} is set to control whether a user is automatically +given operator priviliges on channel entry (@ref{Automatic Op}). + +@end itemize + hunk ./bobot++.texinfo 255 -not root or you want to have your own personal configuration, put it in -@file{~/.bobotpp/config/default/}. +not root or you want to have your own personal configuration, put it +in @file{~/.bobotpp/config/default/}. hunk ./bobot++.texinfo 265 +* Protection:: +* Automatic Op:: hunk ./bobot++.texinfo 269 -@node User Levels, , Using the Bot, Using the Bot +@node User Levels, Protection, Using the Bot, Using the Bot hunk ./bobot++.texinfo 272 -There are five levels that a user may be when interfacing with a bot: -@var{none}, @var{user}, @var{trusted_user}, @var{friend}, -@var{master}. All users default to @var{none} unless they are changed -by a script, the @code{!adduser} command or the @file{bot.users} -file. @var{none} is for everyone---very few commands (e.g. help) are -available to the users and almost everyone should be this -level. A @var{user} can execute many of the bot commands, but can't -use masks on kicks and bans. A @var{trusted} user can everything a -@var{user} can do, but can also use masks on kicks and bans. A -@var{friend} can do everything except for stopping the bot (be -careful who you give this to!). The @var{master} level is for the -bot's owner (probably you) and can do @emph{everything} to the bot. Be -@emph{very} careful if you give @var{master} level access to anyone -else. You cannot use this symbolic levels with the @code{!adduser} -command. See (FIXME: ref) for the numbers you must use with -@code{!adduser}. +There are several user levels available in Bobot++ to provide gradated +access to commands. @command{!adduser} and @file{bot.users} use the +numeric code; Scheme uses the textual name for the level. By default +(if no catch-all setting is found in @xref{bot.users}.) a user is not +even a @code{bot:user-none} and cannot execute @strong{any} commands, +even commands available to @code{bot:user-none}. + +@enumerate 0 + +@item @code{bot:user-none} - No @strong{built-in} commands may be +executed @emph{by default} (commands may be added from Scheme that can +be executed by users of level none and the level required to execute a +command may be changed from Scheme). + +@item @code{bot:user-user} - Will be able to execute most commands but +not all and cannot use masks on kicks and bans. + +@item @code{bot:user-trusted} - For built-ins with a default +configuration this user has access to the same set of commands as an +@code{user} but may use masks on kicks and bans. Scheme commands may +be added which require a user to be of this level. + +@item @code{bot:user-friend} - In the default configuration a user who +is a friend will be able to do everything short of stopping the +bot. Again, there may be user added commands that require a higher +user level. + +@item @code{bot:user-master} - This is the highest user level and has +access to every feature of the bot. + +@end enumerate + +@node Protection, Automatic Op, User Levels, Using the Bot +@section Protection + +A user added via Scheme, the @file{bot.users} file, or +@command{!adduser} may be protected from being deoped, kicked, or +banned. There are currently no symbolic levels in Scheme; just use the +numeric code. + +@enumerate 0 + +@item No protection + +@item No ban. If a user is banned the bot will unban him.. + +@item No kick. The user may still be kicked but the bot will kickban +the user who kicked the protected user. + +@item No deop. The bot will ensure that the user always maintains +operator status. + +@end enumerate + +@node Automatic Op, , Protection, Using the Bot +@section Automatic Op + +A user may be automatically given operator status upon entering a +channel. Set the @var{aop} field to ``0'' to disable auto-op or ``1'' +to enable auto-op. hunk ./bobot++.texinfo 346 -deprecated and will be removed in Bobot++ 2.4. The command -@command{perl -pi -e ``s/bot-/bot:/g'' @var{your-files}} should be enough to -convert your code to use the new functions. +deprecated and will be removed in Bobot++ 3.0. New commands are only +available with the @code{bot:} prefix. The command @command{perl -pi +-e ``s/bot-/bot:/g'' @var{your-files}} should be enough to convert +your code to use the new functions. hunk ./source/DCCChatConnection.C 40 + DCCPerson *from = new DCCPerson (this); + + if (Utils::getLevel (bot, from->getAddress()) < User::FRIEND) + { + from->sendNotice + ("\002You do not have permission to DCC CHAT the bot\002"); + delete from; + return false; + } + hunk ./source/DCCChatConnection.C 52 - DCCPerson *tmp = new DCCPerson (this); hunk ./source/DCCChatConnection.C 53 - tmp->getAddress (), + from->getAddress (), hunk ./source/DCCChatConnection.C 55 - string2SCM (tmp->getAddress ()), + string2SCM (from->getAddress ()), hunk ./source/DCCChatConnection.C 57 - delete tmp; hunk ./source/DCCChatConnection.C 60 + delete from; hunk ./source/ScriptCommands.H 86 - static SCM sendCTCP(SCM, SCM, SCM); + static SCM sendCTCP(SCM, SCM, SCM); }