]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/botuser.rb
[auth] randomized default password
[user/henk/code/ruby/rbot.git] / lib / rbot / botuser.rb
index a4bec7088e22be52a6598c25eba6e5dba4695629..110c078f6b3be36aea496a13a5be2689a1924b9f 100644 (file)
@@ -24,7 +24,7 @@ require 'rbot/maskdb'
 #     }
 #   }
 # end
-# 
+#
 
 module Irc
 class Bot
@@ -35,7 +35,7 @@ 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, :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 +90,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