Class: Irc::Bot::Auth::ManagerClass

Class | Irc::Bot::Auth::ManagerClass
In: | lib/rbot/botuser.rb
Parent: | Object

This is the ManagerClass singleton, used to manage Irc::User/Irc::Bot::Auth::BotUser connections and everything

### Methods

allow? autologin bot_associate changed? create_botuser create_transient_botuser get_botuser include? irc_to_botuser load_array login logout_transients make_permanent new permit? reset_changed reset_hashes save_array set_changed

### Included Modules

Singleton

### Attributes

bot | [R] |
botowner | [R] |
everyone | [R] |
maskdb | [R] |

### Public Class methods

new()

The instance manages two `Hash`es: one that maps `Irc::User`s onto `BotUser`s, and the other that maps usernames onto `BotUser`

### Public Instance methods

allow?(cmdtxt, user, chan=nil)

Checks if command cmd is allowed to User user on chan, optionally telling if the user is authorized

autologin(user)

Tries to auto-login Irc::User user by looking at the known botusers that allow autologin and trying to login without a password

bot_associate(bot)
changed?()
create_botuser(name, password=nil)

creates a new BotUser

create_transient_botuser(user)

Creates a new transient BotUser associated with Irc::User user, automatically logging him in. Note that transient botuser creation can fail, typically if we don‘t have the complete user netmask (e.g. for messages coming in from a linkbot)

get_botuser(name)

returns the botuser with name name

include?(botusername)

checks if we know about a certain BotUser username

irc_to_botuser(ircuser)

Maps `Irc::User` to BotUser

load_array(ary, forced)
login(user, botusername, pwd=nil)

Logs Irc::User user in to BotUser botusername with password pwd

raises an error if botusername is not a known BotUser username

It is possible to autologin by Netmask, on request

logout_transients(m)

Logs out any Irc::User matching Irc::Netmask m and logged in to a transient BotUser

make_permanent(user, name)

Makes transient BotUser user into a permanent BotUser named name; if user is an Irc::User, act on the transient BotUser (if any) it‘s logged in as

permit?(user, cmdtxt, channel=nil)

Checks if User user can do cmd on chan.

Permission are checked in this order, until a true or false is returned:

- associated BotUser on chan
- associated BotUser on all channels
- everyone on chan
- everyone on all channels

reset_changed()
reset_hashes()

resets the hashes

save_array()
set_changed()

[Validate]