View/Edit #12:do_www_setup

Switch to edit mode.

Name(s): do_www_setup
1:  "Processes the GET arguments from a setup request."
2:  "This verb handles player setup (gender/password)."
3:  "Override to add more functionality.  Don't forget to pass."
4:  caller == this && player:isa($webber) || raise(E_PERM)
5:  pass(@args)
6:  player.user:controls(this) || raise(E_PERM)
7:  casematters = 0
8:  pass1 = $www:parse_POST("pass1")
9:  pass2 = $www:parse_POST("pass2")
10: if (!pass1 && !pass2)
11:   "No change."
12: elseif (!pass1 || !pass2)
13:   $msg:mtell("www_error", "Password change failed.")
14:   player:tell("Password must be typed into both fields.")
15: elseif (pass1 != pass2)
16:   $msg:mtell("www_error", "Password change failed.")
17:   player:tell("The two passwords don't match.")
18: elseif (casematters && !equal(pass1, pass2))
19:   $msg:mtell("www_error", "Password change failed.")
20:   player:tell("The two passwords don't match; passwords are case-sensitive.")
21: else
22:   casematters || (pass = $string_utils:lowercase(pass1))
23:   okpass = $wiz_utils:acceptable_password(pass, player.user)
24:   if (okpass != 1)
25:     player:tell(okpass)
26:   else
27:     this.password = string_hash(pass)
28:     player:tell("<B>Password changed!</B><BR>")
29:     player:tell("Because you have changed your password, you will need to <A HREF=\"/?login=", toint($hacker), "&amp;goto=", $su:subst(tostr($www.url, toint(this), prepstr, dobjstr), $www.desubst), "\">login again</A>.<BR>")
30:   endif
31: endif
32: set_task_perms(player.user.wizard ? this.owner | player.user)
33: if ((x = $www:parse_POST("gender")) != E_PROPNF)
34:   if (x != this.gender)
35:     player:tell("<B>Changing your gender from <TT>", this.gender, "</TT> to <TT>", x, "</TT>.</B><BR>")
36:     result = `this:_set_gender(x) ! ANY'
37:     if (result == E_PERM)
38:       $msg:mtell("www_error", "Permission denied!  You cannot set the gender of this player.")
39:     elseif (!result)
40:       $msg:mtell("www_error", tostr("Unknown error: ", result))
41:     endif
42:   endif
43: endif
44: "Last modified by Dax (#789) on Sat Aug  6 12:49:38 2005 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Dax (#789)

You are not logged in.

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