- if($1 == @bot.config["auth.password"])
- @bot.auth.useradd(Regexp.escape(m.source), 1000)
- m.reply "Identified, security level maxed out"
+ if( $1 == @bot.config['auth.password'] )
+ if ! @users.has_key? 'master'
+ @bot.auth.useradd( 'master', 1000, @bot.config['auth.password'], m.source )
+ else
+ @bot.auth.usermod( 'master', '+hostmask', m.source )
+ end
+ m.reply 'Identified, security level maxed out'
+ else
+ m.reply 'Incorrect password'
+ end
+ when( /^identify\s+(\S+)\s+(\S+)/ )
+ if @bot.auth.identify( m.source, $1, $2 )
+ m.reply "Identified as #$1 (#{@users[$1].level})"
+ else
+ m.reply 'Incorrect username/password'
+ end
+ when( 'whoami' )
+ user = @bot.auth.matchingUser( m.source )
+ if user
+ m.reply "I recognize you as #{user} (#{@users[user].level})"