View/Edit #12:@registerme @register-me

Switch to edit mode.

Name(s): @registerme @register-me
1:  "@registerme as <email-address> -- enter a new email address for player"
2:  "   will change the database entry, assign a new password, and mail the new password to the player at the given email address."
3:  if (player != this)
4:    return player:tell(E_PERM)
5:  elseif (this:isa($guest))
6:    return player:tell("Sorry, guests should request characters from the Moo's title screen.  Type '@quit', then reconnect to the Moo.  Don't log in as a guest, use the 'request' command.")
7:  endif
8:  connection = $string_utils:connection_hostname(connection_name(player))
9:  if (!argstr)
10:   if (player.email_address)
11:     player:tell("You are currently registered as:  ", player.email_address)
12:   else
13:     player:tell("You are not currently registered.")
14:   endif
15:   return player:tell("Use @registerme as &lt;address&gt; to change this.")
16: elseif (prepstr != "as" || !iobjstr || dobjstr)
17:   return player:tell("Usage: @registerme as &lt;address&gt;")
18: endif
19: email = iobjstr
20: if (reason = $wiz_utils:check_reregistration(this.name, email, connection))
21:   if (reason[1] == "-")
22:     if (!$command_utils:yes_or_no(reason[2..$] + ".  Automatic registration not allowed.  Ask to be registered at this address anyway?"))
23:       return player:notify("Okay.")
24:     endif
25:   else
26:     return player:tell(reason, " Please try again.")
27:   endif
28: endif
29: if ($network.active && !reason)
30:   if (!$command_utils:yes_or_no(tostr("If you continue, your password will be changed, the new password mailed to `", email, "'. Do you want to continue?")))
31:     return player:notify("Registration terminated.")
32:   endif
33:   password = $wiz_utils:random_password(5)
34:   old = player.email_address || "[ unregistered ]"
35:   player:tell("Registering you, and changing your password and mailing new one to ", email, ".")
36:   result = $network:sendmail(email, tostr("Your ", $name, " character, ", player.name), "Reply-to: " + $login.registration_address, @$editor:fill_string(tostr("Your ", $name, " character, ", $string_utils:nn(player), " has been registered to this email address (", email, "), and a new password assigned.  The new password is `", password, "'. Please keep your password secure. You can change your password with the @password command."), 75))
37:   if (result != 0)
38:     player:tell("Mail sending did not work: ", reason, ". Reregistration terminated.")
39:     return
40:   endif
41:   player:tell("Mail with your new password forwarded. If you do not get it, send regular email to ", $login.registration_address, " with your character name.")
42:   $mail_agent:send_message($slacker, $pcl, "reg " + $string_utils:nn(this), {email, tostr("formerly ", old)})
43:   this:set_email_address(email, "Reregistered at " + ctime())
44:   player.password = string_hash(password)
45: else
46:   player:notify("No automatic reregistration: your request will be forwarded.")
47:   if (typeof(curreg = $registration_db:find_exact(email)) == $LIST)
48:     additional_info = {"Current registration information for this email address:", @$registration_db:describe_registration(curreg)}
49:   else
50:     additional_info = {}
51:   endif
52:   $mail_agent:send_message(this, $slacker, "Registration request", {"Reregistration request from " + $string_utils:nn(player) + " connected via " + connection + ":", "", "@register " + player.name + " " + email, "@new-password " + player.name + " is ", "", "Reason this request was forwarded:", reason, @additional_info})
53: endif
54: "Last modified by Dax (#789) on Sat May 21 03:51:16 2005 MDT."

Verb arguments: any any any
Verb perms: Readable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]