BoBot::PlugIn::Auth - Plugin to authenticate people.
This plugin allows other plugins to ask for authorization.
The plugin catches AUTH_REQUEST messages. Those messages are formatted
the following way:
AUTH_REQUEST usermask #channel CMD for channel commands (kick, op,
etc.). For example, CMD will be KICK for kick requests.
AUTH_REQUEST usermask * CMD for general commands (signoff, etc.).
To achieve its goals, this module needs a database that links a usermask to a policy concerning the user. The key is a string to be interpreted as a regex, to see if a given nick!user@host#chan matches the regex. The value is a string, beginning with 9 numbers giving the score of the regex, followed by the name of commands the user can issue. The score is calculated when supplying the regex, but can be overriden by the !!FIXME!! command.
When performing authentication, the plugin find all matching keys. It then takes the best ones. It achieves this goal by looking at the value associated to the key, and keeping only the keys with the higher score. If there were two or more keys with the same score, the plugin gives authorization only if all those keys allow the action.
The database is a DBM file in order to be as fast as possible. You can
use the bbt.tk application to easily modify them.
Creates a new auth plugin. Opens the auth database.
Handles the request given as param.
Copyright (c) 1997-2002 Sebastien BONNET Copyright (c) 2001-2002 Samuel MOUNIEE Copyright (c) 2002 Jerome QUELIN
This file is part of Bobot.
Bobot is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Bobot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Bobot; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Jérôme Quelin