X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fbotuser.rb;h=97bab93cc34545c3ed4c875209107eec3dd2624c;hb=8218e3f05e8ccd95497dd3c7aa115cfde8b01a40;hp=8fa04fc54f47f21fe95eea61ce47cb5d04b7fb1f;hpb=9a1cf6a11b12c06cd925dd6a789ec98fe750c8ad;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/botuser.rb b/lib/rbot/botuser.rb index 8fa04fc5..97bab93c 100644 --- a/lib/rbot/botuser.rb +++ b/lib/rbot/botuser.rb @@ -24,7 +24,7 @@ require 'rbot/maskdb' # } # } # end -# +# module Irc class Bot @@ -35,7 +35,8 @@ class Bot module Auth Config.register Config::StringValue.new( 'auth.password', - :default => 'rbotauth', :wizard => true, + :default => [*?a..?z,*?A..?Z,*?0..?9].sample(8).join, :store_default => true, + :wizard => true, :on_change => Proc.new {|bot, v| bot.auth.botowner.password = v}, :desc => _('Password for the bot owner')) Config.register Config::BooleanValue.new( 'auth.login_by_mask', @@ -90,8 +91,8 @@ class Bot # def initialize(cmd) cmdpath = sanitize_command_path(cmd).split('::') - seq = cmdpath.inject(["*"]) { |list, cmd| - list << (list.length > 1 ? list.last + "::" : "") + cmd + seq = cmdpath.inject(["*"]) { |list, cc| + list << (list.length > 1 ? list.last + "::" : "") + cc } @path = seq.map { |k| k.to_sym @@ -461,7 +462,7 @@ class Bot # Adds a Netmask # def add_netmask(mask) - m = mask.to_irc_netmask(:server => nil,:force => true) + m = mask.to_irc_netmask @netmasks << m if self.autologin? Auth.manager.maskdb.add(self, m) @@ -872,7 +873,7 @@ class Bot if user.class <= BotUser botuser = user else - botuser = irc_to_botuser(user) + botuser = user.botuser end cmd = cmdtxt.to_irc_auth_command