View/Edit #8090:_render_page

Switch to edit mode.

Name(s): _render_page
1:  "*** DON'T TOUCH THIS CODE *** AUTOMATICALLY GENERATED ***"
2:  caller == this || raise(E_PERM)
3:  player:tell({"<HTML><HEAD>", "  <TITLE>Sending email from the MOO.</TITLE>"})
4:  player:tell($html_utils:nav_links(this:www_nav_links()))
5:  player:tell({"</HEAD>", ""})
6:  player:tell(this.header)
7:  player:tell({"", "<H3>Sending email from the MOO.</H3>", ""})
8:  if (player.user == $no_one)
9:    "The web user isn't logged in."
10:   player:tell("Sorry, the demonstration of how to send mail only works if you are logged into one of our MOO accounts.  The MOO can send email to anyone, but it isn't our policy to allow an unrestricted email gateway.")
11: elseif (iobjstr)
12:   "We have data; lets send some mail."
13:   if (player.referer && $www:previous_object() != this)
14:     "We have a rogue form refering a mail request to us."
15:     "Only a hacker would try this."
16:     $msg:mtell("www_error", "Warning!  Previous page doesn't appear to be this one!")
17:     player:tell("For security reasons the eval will not be executed.  Refering page: [", player.referer, "]")
18:   else
19:     to = player.user.email_address
20:     subject = $www:parse_POST("subject")
21:     text = $www:parse_POST("text")
22:     text = {tostr("This email was sent from ", $www.url, toint(this)), "", @text}
23:     error = $network:sendmail(to, subject, @text)
24:     if (error)
25:       $msg:mtell("www_error", "Error!  Email was not sent.")
26:       player:tell(error)
27:     else
28:       player:tell("<H3>Mail successfully sent to ", to, ".</H3>")
29:     endif
30:   endif
31: else
32:   "Show the email form."
33:   player:tell()
34:   player:tell("<form action=\"/", toint(this), "\" method=\"POST\">")
35:   player:tell({" <center>", " <table>"})
36:   player:tell(" <tr><td><b>To: </b></td><td><TT>", player.user.email_address, "</TT></td></tr>")
37:   player:tell({" <tr><td><b>Subject: </b></td><td><input type=\"Text\" name=\"subject\" size=\"30\" value=\"MOO Canada's MSP demo\"></td></tr>", " <tr><td><b>Message: </b></td><td><textarea cols=\"30\" rows=\"5\" name=\"text\" wrap=\"virtual\">Moo Server Pages are a great way to create dynamic web applications quickly and easilly.</textarea></td></tr>", " <tr><td colspan=2 align=center><input type=\"Submit\" value=\"Send Mail\"></td></tr>", " </table>", " </center>", " </form>"})
38: endif
39: player:tell({"<P>", ""})
40: player:tell(this:viewsourcelink())
41: player:tell()
42: player:tell(this.footer)
43: this:tell_www_tail(@args)
44: player:tell("</BODY></HTML>")
45: "Last modified by Dax (#789) on Tue May  3 14:09:36 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]