diff options
-rw-r--r-- | lib/rbot/botuser.rb | 1 | ||||
-rw-r--r-- | lib/rbot/core/auth.rb | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/rbot/botuser.rb b/lib/rbot/botuser.rb index d859e9c3..5ae7fc2b 100644 --- a/lib/rbot/botuser.rb +++ b/lib/rbot/botuser.rb @@ -19,6 +19,7 @@ module Irc BotConfig.register BotConfigStringValue.new( 'auth.password',
:default => 'rbotauth', :wizard => true,
+ :on_change => Proc.new {|bot, v| bot.auth.botowner.password = v},
:desc => _('Password for the bot owner'))
BotConfig.register BotConfigBooleanValue.new( 'auth.login_by_mask',
:default => 'true',
diff --git a/lib/rbot/core/auth.rb b/lib/rbot/core/auth.rb index d1cdfd42..82fd1aa4 100644 --- a/lib/rbot/core/auth.rb +++ b/lib/rbot/core/auth.rb @@ -299,6 +299,9 @@ class AuthModule < CoreBotModule def set_prop(botuser, prop, val)
k = prop.to_s.gsub("-","_")
botuser.send( (k + "=").to_sym, val)
+ if prop == :password and botuser == @bot.auth.botowner
+ @bot.config.items[:'auth.password'].set_string(@bot.auth.botowner.password)
+ end
end
def reset_prop(botuser, prop)
|