# Register a new user.
defcmd_register(irc, password)if irc.channel
irc.reply 'This command can only be used in private.'elsif!password or password.length ==0
irc.reply 'Empty password given. USAGE: register <password>.'else
from = irc.from
map =$config.ensure("servers/#{irc.server.name}/users/#{from.nnick}")if map.empty?
map['password']=Digest::SHA1.hexdigest(password)
irc.reply "Ok, you've been registrated with password '#{password}'. Default authentication mode is 'trusted'."else
irc.reply "You're already registrated, or someone else is with YOUR nick! *gasp*"endendend
help :register,"Use 'register <password>' in a private message, to register yourself as a user with your current nick and hostmask."