View/Edit #350:_render_delete

Switch to edit mode.

Name(s): _render_delete
1:  "*** DON'T TOUCH THIS CODE *** AUTOMATICALLY GENERATED ***"
2:  caller == this || raise(E_PERM)
3:  "Delete the offending message."
4:  ng = $www:parse_GET("ng")
5:  msg = $www:parse_GET("msg")
6:  ng = toobj(ng)
7:  msg = toint(msg)
8:  error = ""
9:  "Check for referers"
10: if (player.referer && !($www:previous_object() in {$mail_agent, ng}))
11:   error = "Warning!  Previous page doesn't appear to be authorised!"
12: endif
13: "Do delete if allowed."
14: if (ng:ok_write($no_one, player.user) || (ng:ok($no_one, player.user) && ng.rmm_own_msgs && msg in ng:from_msg_seq(player.user)))
15:   "Success."
16:   ng:rm_message_seq({msg, msg + 1})
17: else
18:   "Failure."
19:   error = "Permission denied!  You may not delete that message."
20: endif
21: "Forward user to index."
22: if (error)
23:   player:tell({"<HTML><HEAD>", "<TITLE>Error!</TITLE>"})
24:   player:tell("</HEAD><BODY ", ng.www_body_args, ">")
25:   $msg:mtell("www_error", error)
26:   player:tell("<P>Back to ", $www:link(ng), ".")
27:   player:tell("</BODY></HTML>")
28: elseif (ng:isa($player))
29:   $www.error:moved_temporarily(tostr($www.url, "mail_agent?ng=", toint(ng)))
30: else
31:   $www.error:moved_temporarily(tostr($www.url, toint(ng)))
32: endif
33: "Last modified by Dax (#789) on Tue May  3 14:09:31 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]