]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
auth core botmodule: advertise and act on mismatched master password
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 29 Jul 2008 18:54:23 +0000 (20:54 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 29 Jul 2008 20:20:38 +0000 (22:20 +0200)
lib/rbot/core/auth.rb

index fe781a2107467653daf30f59987c1ef747d26f97..75c59f27cd55c93e5713c1a8495b44ded3aa1b67 100644 (file)
@@ -37,6 +37,13 @@ class AuthModule < CoreBotModule
   def load_array(key=:default, forced=false)
     debug "loading botusers (#{key}): #{@registry[key].pretty_inspect}"
     @bot.auth.load_array(@registry[key], forced) if @registry.has_key?(key)
+    if @bot.auth.botowner.password != @bot.config['auth.password']
+      error "Master password is out of sync!"
+      debug "  db password: #{@bot.auth.botowner.password}"
+      debug "conf password: #{@bot.config['auth.password']}"
+      error "Using conf password"
+      @bot.auth.botowner.password = @bot.config['auth.password']
+    end
   end
 
   # The permission parameters accept arguments with the following syntax: